Convert all mp4s

I have used this to convert rather large HD mp4s to a manageable size.

ffmpeg -i JakobFootball1.MP4 -s hd480 -strict -2 output.mp4

Is there a way to get it to convert ALL mp4s in a given directory ?
I realize that it would have to give unique file names.

Sure, something like:

find /path/to/dir -type f -name "*.mp4" | xargs -IX ffmpeg -i X -s hd480 -strict -2 X.small.mp4

You'll have one extraneous ".mp4" in the filename but if that works you can find a solution for that later.

1 Like

Thanks, it worked great.

I ran this first thinking that your script would be case insensitive.

shopt -s nocaseglob

But it would not convert .MP4 files that were also present.