Gentoo Wiki




The HOWTO Create a DVD guides gives a simple example of how to transcode divx and other video formats to DVD format. This page is intended to document that example as well as some more complex examples.


If you want to encode your input files into DVD video without setting any other particular option, you can run:

$ ffmpeg -i input_file.avi -target ntsc-dvd -aspect 4:3 movie.mpg


$ ffmpeg -i input_file.avi -target pal-dvd -aspect 4:3 movie.mpg 

All the format options (bitrate, codecs, buffer sizes) are automatically set by the "-target" option.

Use -sameq to make sure you don't lose any quality in the reencoding process. That switch apparently tells ffmpeg to adjust the bitrate as needed. It may not be required but it can't hurt. WARNING: -sameq can sometimes generate bitrate spikes above 9.8 Mbit/s (DVD-Video MPEG-2 maximum bitrate). Stand-alone DVD players will freeze at these points in the video.

Setting the Correct Display Aspect Ratio

Unlike AVI files, etc PAL and NTSC can only display specific aspect ratios. Full PAL and NTSC resolutions are 720×576 and 720×480, respectively. For example, if one has an AVI file with a resolution of 624x268 (2.35:1). To get an DVD-Video-ready MPEG-2 without any squashing or squeezing of the video you would add black bar padding to the top and bottom of the MPEG, shown below

$ ffmpeg -i input_file.avi -target pal-dvd -s 720x440 -padtop 68 -padbottom 68 -aspect 16:9 movie.mpg   

The calculation of the correct aspect is a little confusing, but you can read about how to do it. However, there is a script available to calculate the correct aspect and padding required to maintain aspect of MPEG.


Retrieved from ""

Last modified: Thu, 28 Aug 2008 04:03:00 +0000 Hits: 15,362