[MEncoder-users] Cannot encode to mepg2

Nico Sabbi nsabbi at tiscali.it
Fri Mar 25 22:15:01 CET 2005


Stefan Frings wrote:

>>>You need a LOT more options to make valid DVD video. Min/max bitrate,
>>>vbv buffer size, B frames, ...
>>>      
>>>
>
>Do you know the correct values? Then please tell me.
>
>I am now able to create the DVD image with dvdauthor. This was my main prblem. 
>Now I surely like to tune all options so that the DVD will be as compatble as 
>possible.
>  
>

Rich is right. This is a possible command line configuration (the one I 
use):

mencoder "$INPUT"  -of mpeg -mpegopts format=dvd:vbitrate=$BITRATE -o 
"$OUTPUT" -vc ffmpeg12, -ovc lavc -lavcopts 
qprd:keyint=25:vcodec=mpeg2video:mbd=2:vbitrate=$BITRATE:vpass=1:lmin=1:mbqmin=1:vqmin=1:dia=-4:predia=-4:preme=2:vmax_b_frames=0:dc=8:sc_threshold=-1500:vrc_buf_size=1835:vrc_maxrate=9000:vrc_minrate=600:cmp=256:precmp=256:subcmp=256:mbcmp=256:vqcomp=0.75:turbo:aspect=16/9 
-sws 2 -oac toolame -toolameopts br=128 -af volnorm $EXTRA

repeated exactly the same for the second pass, with the exception of 
vpass=2.
Yet there are certain things that you should change if you want to get 
strict dvd compliance:
- for PAL keyint=15, fps must be 25 fps,
- for NTSC keyint=18, fps must be 23.976 (or 24000/1001) -mpegopts 
format=dvd:telecine

the other parameters you shouldn't touch are:  
mbd=2:vrc_buf_size=1835:vrc_maxrate=9000.

In my command above there are certain settings that may help you or make 
a mess:
- *cmp=256 set as motion estimation the default one + chroma motion 
(sometimes it helped me to avoid dancing walls)
- qprd: experiment yourself with and without and decide what is best
- bframes: standard wants up to 2 b-frames, but they are not mandatory 
afaik, so I always remove them
- vrc_minrate: set it according to the bitrate you want to get
- dia, predia, vqcomp: maybe you shouldn't touch them;  after dozens of 
attempts they seem to give
the most pleasant image (at least to my eyes and in my viewing conditions)
- sc_threshold: enables a mild scene change detection algorithm that 
seems to make a lot of difference to me

As usual, the more you experiment the better results you will get.

The other options regard toolame mp2 encoding, that you may want to 
avoid (in favor of ac3, that I dislike).

    Nico





More information about the MEncoder-users mailing list