bashbang + check for ffmpeg
This commit is contained in:
parent
c9cce2b2f3
commit
f5fc82a2da
@ -1,8 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
[[ -z `command -v ffmpeg` ]] && echo "No ffmpeg" && exit 1
|
||||
|
||||
counter=0
|
||||
for i in *.mp4
|
||||
do
|
||||
# ffprobe -show_entries stream=width,height -v error "$i" | grep width
|
||||
resol=$(ffprobe -show_entries stream=width -select_streams v:0 -v error "$i" | grep width | sed 's/width=//g')
|
||||
|
||||
resol=$(ffprobe -show_entries stream=width -select_streams v:0 -v error "$i" | grep width | sed 's/width=//g')
|
||||
echo $resol - $i
|
||||
[[ resol -gt 1280 ]] && echo '== Converting ' $i && ffmpeg -y -i "$i" -vf scale=1280:720 -framerate 30 "$(echo $i | sed 's/.mp4/_720p30.mp4/')" && echo 'RM!!!' && sleep 3 && rm "$i"
|
||||
echo $i
|
||||
|
Loading…
x
Reference in New Issue
Block a user