How To: Batch prepare videos to upload to youtube with HandBrake

Categories How To, Tools

YouTube videos can take a massive amount of time to upload. For example, 30 FPS, MP4 video of size 870,4 MB takes around 2 hours on < 1Mbps upload speeds:

To minimize that time I use a simple workflow (i) and a script that feeds video files into HandBrake video transcoder (ii). You can find the installation steps for HandBrake here.

My workflow is simple:

- Download the videos from my phone/camera to my laptop;
- Add them to appropriate folders that I create based on the transformation needed for the videos contained there;
- Create a folder where I will store all the processed videos for that transformation;
- Upload them to YouTube. 

This is the batch processing statement I use:

for i in `ls ~/Videos/Rotate`; do HandBrakeCLI -i ~/Videos/Rotate/$i -o ~/Videos/Rotated/$i --encoder x264 --quality 30.0 --optimize --format av_mp4 --rotate="angle=90"; done

After the video is processed with this command, it is the same 30 FPS, MP4 video of size 120,5 MB and it takes around 15 minutes to upload on the same connection:

Leave a Reply