LVPE: Encoding High Bitrate 24p Footage for DVD
(this post is part of the Linux Video Production Experience series, which chronicles my experiences with creating a high-quality home movie almost entirely in open source software.)
For my past movie-making adventures, I used mencoder or ffmpeg to encode my noisy, low-motion, un-color corrected video for DVD, which it happily did. There were never any huge spikes in the data, since all of the scenes were equally poor in quality. :D
And now that I've properly cleaned everything up and made it pretty, mencoder did not work out too well for this project, due to its not-so-good MPEG-2 rate control. ffmpeg apparently has the same problem. The issue came up with rapid scene changes or high motion video areas. Several areas in the video caused a friend's DVD player to skip horribly, which has never happened with any of my videos before.
I needed one additional feature in my encoder this time, and that's 2:3 pulldown. 24p footage needs to be yanked back up to 29.97fps footage so that it's playable on most DVD players. And as far as I can tell, you can't enable soft pulldown in ffmpeg, so that encoder's out for this job.
Now, in my research, I've come across four possible open source solutions that might work:
- Use mencoder, but specify a very low bit rate tolerance (vratetol in the lavcopts options).
- Use mencoder with experimental Xvid rate control compiled in and enable with with vrc_strategy=1 in the lavcopts options. Xvid rate control seems to be more aggressive against the high bitrate spikes than mencoder's libavcodec rate control.
- Use AviSynth with QuEnc (both running in Wine), which reportedly has extremely good rate control.
- Use Avidemux, which uses its own flavor of the Xvid rate control mechanism. Avidemux will automatically enable the soft pulldown flag if you're encoding an MPEG-2 file at ~23.976FPS.
mencoder + a low vratetol (somewhere between 100 and 1000) still produced some very high spikes. mplex reported that the max bitrate of the stream was well over the DVD spec. mencoder also has experimental Xvid rate control, which required compiling a new mencoder. With that enabled, however, the output video stream still spikes too high.
AviSynth + QuEnc would have taken some additional work to get the AVI files I output from Cinelerra (in Motion JPEG format) to load with AviSynth. I couldn't find a free way to get AviSynth to read MJPEG frames. Maybe I'll have to dust off my old registered copy of the PICVideo MJPEG codec if I want to go down that road...
Avidemux, however, got the job done. The DVD preset gets you 90% of the settings you need for DVD MPEG-2 files. Be sure to enable Xvid rate control in the DVD (lavc) settings and you should be fine. The only tricky part was joining all of the 21 movie files. If all of your final videos are alphabetically sequential in a directory, let's say "FinalRender," you can use this bash one-liner to open all of the files into Avidemux (which is in your path) in the right order:
cmd=""; for i in FinalRender/*; do if [ "$cmd" == "" ]; then cmd="--load $i"; else cmd="${cmd} --append $i"; fi; done; `avidemux ${cmd}`
Avidemux appears to be the best way for me to encode my final, cleaned up, 24p Cinelerra AVI files to MPEG-2 DVD format to avoid skipping during playback on standalone DVD players. As usual, if I missed something in my writeup, please leave a commenton the story!
And that's it! Please let me know if you have any comments or questions about the series. If you want to see some additional part of the process I went through for this production, let me know and I'll find the time to post another article.
See what else is here...
- Jasmine and Vim, a happy pairing
- Fast JavaScript and CoffeeScript Unit Testing with jasmine-headless-webkit
- Actually Throwing One Away
- Slice and dice Cucumber run-times
- Site migrated and future plans
- Bash magic: convert a high-res PNG to a small PDF with convert and sam2p
- Bash magic: Get the chronological Originals contents from an iPhoto library that will fit on a CD
- What's the deal with "johncoswell"?
- Flex 3: Better SWF Embedding
- Ustreaming your desktop on Ubuntu Intrepid Ibex
- Mom's Delicious Pizza Dough Recipe
- LVPE: Avidemux and JPEG Photo AVI files not working?
- Guest strip!
- Dawn's Dictionary Drama is back!
- Video: The DC Conspiracy at Beyond Comics for Free Comic Book Day
- Joining the cartoon party: Myself as a Teen
- Quick Drying Paint: Profiling Inkscape using Valgrind
- LVPE: Encoding High Bitrate 24p Footage for DVD
- LVPE: Rendering and Exporting Video & Audio from Cinelerra
- LVPE: Processing a Bunch of Photos for Cinelerra
- LVPE: Color Correction in Cinelerra
- LVPE: Capturing & Deinterlacing DV Footage
- A Linux Video Production Experience
- Tons of .msp files in C:\Windows\Installer?
- A Moment of Inkscape Screenshots!
- The Amelia Rules! Charity Auction this Veterans Day
- PayPal and Visa: One card per account, ever?
- A Moment of Clarity Volume 2 Chapter 1 Reviewed!
- The Inkscape Perfect-Bound Cover Template Generator
- Freedom Dance wins in the 2007 Peer Awards!
- Untwisting the Spine of Perfect-Bound Books
- Small Press Expo 2007
- AMoC in Prismacolors and Brush Pens!
- Xinerama/TwinView + Single Screen + GTK = FAIL
- Baltimore Comic-Con
- ImageMagick: A simple, and kind of overkill, way to resize and pad an image
- Comics and Time Management
- Practical Inkscape for Comic Artists: The Right-Handed Illustration Keyboard Layout
- Red Hat High 2007 Update
- Cinelerra DV Rendering Problems? Try JPEG Photo
- Red Hat High 2007
- Freedom Dance!!
- One Reason Why Drawing Comics in Vector is Better Than in Bitmap
- Ogg Theora/Vorbis Conversion Information
- Linux iPod Video Conversion Information
- Libre Graphics Meeting 2007 - Creating Comics in Inkscape Presentation Video
- More Cinelerra and Mencoder fun!
- Libre Graphics Meeting 2007 - The Coswell Productions Report
- Libre Graphics Meeting 2007 - Wallpapers and Shirts!
- Indy Comic Review reviews A Moment of Clarity Volume 1
- Libre Graphics Meeting 2007
- Comics in Inkscape 0.45 with John Bintz
- Cinelerra Hints for Rendering
- Automating WinTV-PVR/ivtv captures in Ubuntu Edgy
- Inkscape 0.45 About Screen Content Entry
- Staircase Visualization for Volume 2
- Digital Minicomic Production - Using Free Software to Do Inexpensive Digital Paste-Up
- Blue Dot Television Commercial - A New Face
- Marylanders in Snow (Animation)
- Slippie Slide
- Blue Dot Television Commercial - Warm Up with Blue Dot
- TP Monitor
- Virus