I'm working on a Mac system in a video company where I have to clean up a lot of folders and subfolders containing large intermediate video files.
So I've been looking for a way to batch convert many .mov files to h.264 .mp4 files using ffmpeg. I've found several codes to do a batch convert using a script similar to
for f in '*.mov';
do ffmpeg -i $f -c:v libx264 -f mp4 "${%f.mov}.mp4" ;
done
However this only works on the current folder the script is run in, while I'm looking for a way to find .mov files recursively, and batch convert them all.
At the moment, the solution that works for me feels a little brute-force; I'm just using find and execute ffmpeg;
find . -name '*.mov' -type f -exec ffmpeg -i {} -c:v libx264 -f mp4 {}.mp4
However, One of the problems I'm having, is that I can't seem to substitute the .mov for .mp4 in this formatting, so the output will add .mp4 to the {}, with files ending up as *.mov.mp4
Besides that, I'm guessing this isn't the most secure or the nicest way of going about rendering a batch.
I was wondering if there is a more secure or less terminal-intense way of creating a batch for ffmpeg, that might even solve my naming problem, or a way to make the 'for f in *mov' command find videos recursively up to 5+ folders deep.
Any help would be greatly appreciated.