$ export LD_RUN_PATH=/usr/local/lib:/usr/lib:/lib $ ./configure --prefix=/usr/local --enable-gpl --disable-debug \ --enable-liba52 --enable-liba52bin --enable-libxvid \ --enable-libx264 --enable-libfaac --enable-libfaad \ --enable-libfaadbin --enable-libmp3lame --enable-libamr-nb \ --enable-libamr-wb --enable-nonfree $ make $ su % make install % exitIt is important to specify LD_RUN_PATH so that the new version of ffmpeg links to the new versions of libavcodec, libavformat and libavutil.
A typical command using the patched version of ffmpeg-0.5 to encode a DVD compliant program stream from DV source is
$ ffmpeg -i s001.avi -interlace 1 -ildct -ilme -top 0 \ -target dvd -aspect 16:9 \ -qmin 5 -b 7000000 -ab 224000 -y s001.mpg
As of Aug 2009 the imgconvert.c.patch no longer applies to development versions of ffmpeg because the conv411() function has been removed. It appears that the development code still exhibits chroma subsampling errors with interlaced material. This is confirmed by Kevin Murraya in Believed Incorrect Chroma Subsampling on Interlaced 4:2:2 to 4:2:0. One can use y4mscaler to work around the chroma subsampling errors.
$ ffmpeg -i s001.avi -y s001.wav $ ffmpeg -i s001.avi -f yuv4mpegpipe -pix_fmt yuv411p -y /dev/stdout | y4mscaler -I ilace=BOTTOM_FIRST -O chromass=420mpeg2 | ffmpeg -f yuv4mpegpipe -i /dev/stdin -i s001.wav \ -interlace 1 -top 0 -flags +ildct+ilme \ -target dvd -aspect 16:9 \ -qmin 5 -b 7000000 -ab 224000 -y s001.mpgThere is also a change in syntax for specifying the ildct and ilme options in the development versions of ffmpeg.
$ mencoder s001.avi -aoc lavc -ovc lavc \ -lavcopts acodec=ac3:abitrate=224:vcodec=mpeg2video:\ ildct:ilme:top=0:vbitrate=7000:vqmin=5:vrc_maxrate=7500:\ vrc_buf_size=1835:aspect=16/9 \ -vf harddup,dsize=16/9 \ -of mpeg -mpegopts format=dvd:tsaf:vaspect=16/9 \ -o s001.mpgI have not checked whether mencoder correctly subsamples the chroma when converting interlaced DV source to interlaced mpeg2 video.
$ lav2yuv s001.avi | yuvcorrect -T INTERLACED_BOTTOM_FIRST | mpeg2enc -M0 -nn -a3 -f8 -G18 -b7000 -V230 -q9 -o s001.m2v $ lav2wav s001.avi > s001.wav $ toolame -b224 -s48 s001.wav s001.m2a $ mplex -f8 s001.m2v s001.m2a -o s001.mpgwork, but unfortunately reduce the effective color space to 4:1:0. Better results can be obtained by using y4mscaler and the commands
$ lav2yuv s001.avi -C 411 | y4mscaler -I ilace=BOTTOM_FIRST -O chromass=420mpeg2 | mpeg2enc -M0 -nn -a3 -f8 -G18 -b7000 -V230 -q9 -o s001.m2v $ lav2wav s001.avi > s001.wav $ toolame -b224 -s48 s001.wav s001.m2a $ mplex -f8 s001.m2v s001.m2a -o s001.mpgThis interpolates the chroma in the horizontal direction before subsampling it vertically.
Color space subsampling errors for interlaced video are present in unpatched versions of ffmpeg and possibly mencoder. Avisynth does color space conversion correctly as detailed in Sampling. Note that color space upsampling errors of a similar nature are present in some DVD players as described in The 4:2:0 Interlaced Chroma Problem. Unfortunately, the two chroma errors don't cancel each other out.
As a final note, if you will be authoring a DVD consisting of more than one file in dvdauthor, do not mix mpeg2 files produced with ffmpeg and mjpegtools in the same video title. Stick with one encoding method for the entire project. Otherwise, the end result will be a DVD with two separate audio tracks: an ac3 audio track and a mp2 audio track in which each track is partially blank. Anyone watching such a DVD would have to manually switch between audio tracks while they watched in order to hear the sound.