[MEncoder-users] DVD compliant MPEG2 encoding

Lauri Myllari lauri at myllari.net
Fri Sep 9 00:14:18 CEST 2005


Hi!

After seeing MEncoder do very well in MPEG2 encoder challenge at
http://forum.doom9.org/showthread.php?t=98633 I decided to try it again.
A year ago I had no success and decided to just use mpeg2enc. Having
2pass and faster encoding would be nice, though.

Three problems and two solutions - any help on the third would be very
much appreciated!


1) me_range

The player I use for testing is a Pioneer DV-545 and it's apparently
quite strict about standard compliance. After adding "me_range=127" to
lavcopts the player stopped skipping/crashing on scenes with fast
motion.

I'm not sure what the correct value for me_range is. Mailing list
archives suggest 128 and 256 (IIRC). To quote from the doom9.org thread:

"For Main level, ISO 13818-2, table 7-8 and E-8:
horizontal range: -1024 : 1023.5 (f_code = 8)
vertical range: -128 : 127.5 (f_code = 5)"

Should this be noted in the encoding-guide.txt section about DVD
constraints?


2) telecine

3:2 pulldown was still causing stutter on NTSC playback. It seems
-mpegopts flag "telecine" doesn't work 100%. MPlayer recognizes this
pulldown and switches to 24000/1001fps, but the Pioneer was skipping
all the time.

I solved this by outputting 24000/1001fps raw m2v from MEncoder and
adding 3:2 pulldown flags with DGPulldown
(http://neuron2.net/dgpulldown/dgpulldown.html - works fine with wine
and comes with source).

I think some timecode manipulation might be needed in addition to
setting rff/tff flags in mpeg muxer.


3) rate control

This is a bit harder to describe. Sometimes it works, sometimes not.
I've had trouble with high peaks (sometimes over 15000k according to
mplex, with vrc_buf_size=1835 and vrc_maxrate=9000) and low average
bitrates.

Lower bitrates (~2000-3000kbps) seem to be accurate without any
B-frames. Adding max_bframes=2 leads to undersized encode.

Setting a higher bitrate (~4000kbps or more) gives undersized encodes
too.

I'll try to find out more (using different sources and noting the
settings) - unless someone knows already what's going on?

Does anyone have settings (or ideas) for accurate average bitrate,
strict max rate and high quality?

--rez




More information about the MEncoder-users mailing list