Batch MOV to MP4 conversion using HandBrakeCLI
Posted by jamie on 01 Feb 2011 in Activity log
Due to certain browsers handling HTML5 differently, we also need MP4 versions of the movies in addition to OGG. So, I used HandBrake (specifically HandBrakeCLI) to batch convert all of the MOV files to MP4. Two commands this time - one to convert and one to rename:
find media -name *.mov | xargs -I file HandBrakeCLI -e x264 -q 20.0 --input file --output file.mp4
find media -name '*.mov.mp4' | xargs rename 's/\.mov.mp4$/\.mp4/'
Be sure to specify "-e x264" when using HandBrakeCLI or else it'll use ffmpeg.