I use this command to convert files in batch plus crop and re-scale:
for i in $( ls *.mp4 ); do
ffmpeg -y -i "$i" -acodec libfaac -ab 128k -ar 44100 -vcodec libx264 -b 850k -threads 0 -vf [in]crop=in_w-112:in_h-63:56:0,scale=1280:720[out] "../../archive/${i/.mp4/}.mp4"
done
this command will start at second 15, and makes video 30 seconds long:
for i in $( ls *.mp4 ); do
ffmpeg -ss 00:00:15 -t 30 -y -i "$i" -acodec libfaac -ab 128k -ar 44100 -vcodec libx264 -b 850k -threads 0 -vf [in]crop=in_w-112:in_h-63:56:0,scale=1280:720[out] "${i/.mp4/}_test.mp4"
done
what I would like is a command that cuts off 15s from the beginning and 15s from the end of EACH video from the BATCH ... the trick is that each video has different duration, so "how long it is" must be a variable (duration minus 15s or minus 30s if I count 15s from the start as well)
video duration examples:
video 1 - 00:25:19
video 2 - 00:15:34
video 3 - 00:19:21
video 4 - 00:22:49
etc.