Twitter Feed

Links

Ask Aaron

ffmpeg commands from Episode 3 Cinelerra Tutorial #4

  • : Function ereg() is deprecated in /var/www/thesourceshow/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /var/www/thesourceshow/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /var/www/thesourceshow/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /var/www/thesourceshow/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /var/www/thesourceshow/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /var/www/thesourceshow/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /var/www/thesourceshow/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /var/www/thesourceshow/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /var/www/thesourceshow/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /var/www/thesourceshow/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /var/www/thesourceshow/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /var/www/thesourceshow/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /var/www/thesourceshow/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /var/www/thesourceshow/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /var/www/thesourceshow/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /var/www/thesourceshow/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /var/www/thesourceshow/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /var/www/thesourceshow/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /var/www/thesourceshow/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /var/www/thesourceshow/includes/file.inc on line 647.

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)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Thanks Aaron! Very useful

Thanks Aaron! Very useful tips!

Pass 2 input above

The "(master filename)" in pass 2 is still same file used in pass 1? wouldn't pass2 overwrite to filename.mp4 of what's done in pass1? example: pass 1: ffmpeg originalfile.mov pass 1 -target newfile.mp4 pass 1: ffmpeg originalfile.mov pass 2 -target newfile.mp4 Wouldn't above example overwrite everything in newfile.mp4 from pass1?
anewcomb's picture

RE: Pass 2 input above

Nikhil, Yes. You are overwriting your initial output file, but this is OK. The second pass uses information collected during the first pass to improve the quality of the transcoding process. Of course, you could name the output file in the second pass to something else, but why would you want two versions of the same file where one version is slightly less quality than the other one? Aaron

Best Forum for Open Source Video questions?

I have a meta-question: what's a good forum for getting (and hopefully offering too) help on video editing under GNU/LInux? It would be cool if there were a unified place for video editing Q/A on Linux covering not only the technical side but also the artistic aspect of video editing.
anewcomb's picture

RE: Best Forum for Open Source Video questions?

As far as the artistic aspect goes I think this is not Linux specific so any site would probably be OK. You could try PixelCorps if you want to learn more for a fee. For technical discussion I would recommend you start with the Cinelerra mailing list. People there are generally open to all types of questions. Aaron

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

anewcomb's picture

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

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

Call Us NOW!

Cumulus Tag Cloud

Feeds

mpeg4 (G1/iPod)
theora
xvid (Nokia Compatible)
iTunes Video

Donate

Support Open Source!

Syndicate

Syndicate content