[MEncoder-users] How to keep lavc bitrate within DVD spec?

Francois Visagie francois.visagie at gmail.com
Sat Oct 4 18:54:19 CEST 2008


On Fri, Oct 3, 2008 at 9:18 PM, Laine Lee <llee at lonestar.utsa.edu> wrote:

>
> Pardon me if I'm missing the obvious, but I don't see exactly what your
> resulting bitrate is. Maybe you could simply try raising the muxrate to
> avoid getting the error:
>
> muxrate=36000
>

To be DVD-compliant, video on its own may not exceed 9800 kbps and combined
video+audio+subpicture bitrate may not exceed 10.08 Mbps.

Some more test results. With a 34min source AVI (which contains the same
problem scene used above) and the same command line as above being

mencoder -field-dominance 1 -mc 0 -vf hqdn3d=2:1:2,harddup -oac lavc -ovc
lavc -lavcopts
abitrate=128:acodec=ac3:autoaspect:cmp=2:ilme:ildct:keyint=15:last_pred=2:mbcmp=2:mbd=2:mv0:precmp=2:predia=2:preme=2:subcmp=6:top=0:trell:vbitrate=6680:vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vstrict=0
-of mpeg -mpegopts format=dvd:tsaf %1 -o %OUTPUT% >%OUTPUT%.%PASS%.txt

the error messages are:


BUFFER UNDEFLOW at stream 0, raising muxrate to 11088 kb/s, delta_scr: 39896
Pos: 535.6s 13391f (25%) 3.64fps Trem: 177min 1729mb A-V:0.000 [6697:127]

BUFFER UNDEFLOW at stream 0, raising muxrate to 12196 kb/s, delta_scr: 36269
Pos: 535.7s 13392f (25%) 3.64fps Trem: 177min 1729mb A-V:0.000 [6697:128]

With a command line originally prepared for different type material (so it
has somewhat different options, but also specifies B-frames)

mencoder -field-dominance 1 -mc 0 -vf hqdn3d=2:1:2,harddup -oac lavc -ovc
lavc -lavcopts
abitrate=128:acodec=ac3:autoaspect:ilme:ildct:keyint=15:mbd=2:top=0:trell:vbitrate=6680:vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vstrict=0:vmax_b_frames=2%VB_STRAT%:dia=2:preme=2:predia=2:mbcmp=6:precmp=2:cmp=2:subcmp=6:last_pred=2:mv0:mv0_threshold=0
-of mpeg -mpegopts format=dvd:tsaf %1 -o %OUTPUT% >%OUTPUT%.%PASS%.txt

the single error message is:

 BUFFER UNDEFLOW at stream 0, raising muxrate to 11088 kb/s, delta_scr:
39896 Pos:1093.8s 27346f (52%) 2.25fps Trem: 183min 1719mb A-V:0.000
[6657:128]

and I manage to squeeze this glitch past the muxer.

So with the same input material but with some different lavc options,
MEncoder disobeys the maximum bitrate specification to a lesser extent.
Maybe the B-frames helped?

Perhaps one of you clever programmers could pick up on this info to spot
this bug and fix it. Let me know if you would like me to do more testing.
FYI, the problem point in the video is where an almost black sequence (the
lens was almost completely covered) transitions within one frame to an
almost white sequence with all colour and detail over-exposed and washed
out. I know in this case I could just cut that footage, but that would do
nothing about the bug.

Kind regards,

Francois



More information about the MEncoder-users mailing list