bashbang + check for ffmpeg

This commit is contained in:
lulzette 2021-01-24 09:04:37 +03:00
parent c9cce2b2f3
commit f5fc82a2da

View File

@ -1,7 +1,11 @@
#!/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')
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"