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. (updated 7/10/08 for n800/n810) Pass 1
ffmpeg -i (master filename) -vcodec mpeg4 -r 29.97 -acodec libmp3lame -vtag DIVX -s 400:240 -aspect 16:9 -b 600k -pass 1 filename.avi
Pass 2
ffmpeg -i (master filename) -vcodec mpeg4 -r 29.97 -acodec libmp3lame -vtag DIVX -s 400:240 -aspect 16:9 -b 600k -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 and 2 with one command ...
ffmpeg -i (master filename) -an -pass 1 -aspect 16:9 -vcodec libx264 -b 512k -r 29.97 -flags +loop -cmp +chroma -partitions 0 -me_method 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 -y -f mp4 /dev/null && 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_method 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 -y -f mp4 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)






Thanks Aaron! Very useful
Pass 2 input above
RE: Pass 2 input above
Best Forum for Open Source Video questions?
RE: Best Forum for Open Source Video questions?
H.264 encoding
Hi Aaron,
For my version of ffmpeg (5:0.5+svn20090508-0.1 , from debian sid repo) I had to change -me to -me_method to run the commands for H.264.
Thanks for the info, very welcome!
Norv
Cinelerra tutorial
Hi,
The content of the tutorial is good but the pace is too slow and the tone of voice is monotonous.
Don't take this as a negative opinion it's just about trying to help you improve the video casts.
As for the software presentation where have you posted the other tutorials?
Keep up the good work!
Cheers,
JC
Re: Cinelerra tutorial
You can find the Cinelerra tutorials in Episodes 6, 1, 2 and 3. Just click on the episodes link at the top of the page to find them. I criticism is spot on and I have since changed the format and length of the show to compensate a bit.
Aaron
Post new comment