Friday, August 1, 2014

Encoding for Streaming using FFMPEG and HandBrake CLI

While Youtube still young, they use FFMPEG to encode their uploaded videos. And for us, we can't live without it. MyKLIK is much more like Tonton.com where the users can watch recorded TV programmes.

The videos will be recorded in Standard Definition and we use MP4 with H264 Main and AAC for master video.

The master video will be uploaded to centralized cloud storage and our cloud encoder will do the hard job to split the video into different qualities.

Another FFMPEG contender is HandBrake CLI. Pretty good for H264 conversion, but FFMPEG can encode to Google WebM.

Some good reading :

1. http://webvideo.wikischolars.columbia.edu/H.264+Handbrake ( Handbrake and H264 )
2. http://sonnati.wordpress.com/2011/07/11/ffmpeg-the-swiss-army-knife-of-internet-streaming-part-i/ ( FFMPEG Basics )

Here's my FFMPEG and HandBrake CLI command used to encode the MBR video.




Save as encode.php and chmod +x the file and run it like this :


/usr/bin/php -q encode.php movie.mov

It will throw the job into background and will use all available CPU Cores.

HandBrake run in background

Top -d1



No comments:

Post a Comment