ffmpeg commands from Episode 3 Cinelerra Tutorial #4
Here are the commands I am currently using when I transcode my episodes into the various media formats. Please feel free to comment on suggested improvements or email them to me.
First, I start be rendering the video in a high quality format. If you are rendering just to one format (i.e. H264) this probably isn't necessary, but since I put out multiple versions of the show I start with a master and then use ffmpeg to transcode to the other formats.
In Cinelerra's rendering dialog choose "Quicktime for Linux" as the format type and check both Audio and Video. Then click on the wrench next to Video and choose "YUV 4:2:0 Planar" as the compression type. Keep in mind this file will be VERY large. Episode 3 was 38 minutes long and the resulting file was 50GB.

Now that I have my master print I can start transcoding into the various media formats. Here are the ffmpeg commands I use to do that.
Ogg Audio:
ffmpeg -i (master filename) -ab 128k filename_audio.ogg
Mp3 Audio:
ffmpeg -i (master filename) -ab 128k filename_audio.mp3
Xvid/Nokia:
I used to do two Xvid versions. One was larger and another one smaller for the Nokia Internet Tablet. I have scaled that back to just one Nokia compatible version.
Pass 1
ffmpeg -i (master filename) -vcodec mpeg4 -r 29.97 -acodec libmp3lame -vtag DIVX -s 320:208 -aspect 16:9 -b 200k -pass 1 filename.avi
Pass 2
ffmpeg -i (master filename) -vcodec mpeg4 -r 29.97 -acodec libmp3lame -vtag DIVX -s 320:208 -aspect 16:9 -b 200k -pass 2 filename.avi
H.264:
Currently this is by far the highest quality. Ogg Vorbis/Theora isn't far behind if I don't do any scaling. This is also a 2 pass process.
Pass 1
ffmpeg -i (master filename) -an -pass 1 -aspect 16:9 -vcodec libx264 -b 512k -r 29.97 -flags +loop -cmp +chroma -partitions 0 -me epzs -subq 1 -trellis 0 -refs 1 -coder 0 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 512k -maxrate 768k -bufsize 2M -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 13 filename.mp4
Pass 2
ffmpeg -i (master filename) -acodec libfaac -ab 128k -pass 2 -aspect 16:9 -vcodec libx264 -b 512k -r 29.97 -flags +loop -cmp +chroma -partitions +parti4x4+partp4x4+partp8x8+partb8x8 -flags2 +mixed_refs -me umh -subq 7 -trellis 2 -refs 5 -coder 0 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 512k -maxrate 768k -bufsize 2M -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 13 filename.mp4
Ogg Vorbis/Theora:
Here I use a program called ffmpeg2theora to simplify things a little.
ffmpeg2theora -A 128 -V 512 --optimize -o filename.ogg (master filename)



Delicious
Digg
Reddit
Facebook
Technorati
Post new comment