[MEncoder-users] converting and subtitle questions

Jorge Peixoto de Morais Neto please.no.spam.here at gmail.com
Sat Mar 29 21:43:34 CET 2008


On Fri, Mar 28, 2008 at 10:51 PM, RC <cooleyr at gmail.com> wrote:
> On Fri, 28 Mar 2008 18:06:30 -0300
>  "Jorge Peixoto de Morais Neto" <please.no.spam.here at gmail.com> wrote:
>
>  > And this is good, because in my experience, H.264 absolutely kicks the
>  > butt of MPEG-4 part 2. I was told that the difference was not very
>  > big, but they were wrong. The difference is huge.
>
>  At very low bitrates, H.264 does a very good job masking artifacts, and
>  preserving more detail.  Once you get up even just to medium bitrates
>  though, where ASP codecs don't have terribly obvious heavy artifacts,
>  the two are much more closely matched.
So your experience is that H.264 is always superior to MPEG-4, but
they are close for medium/high bitrates?
So maybe it is a good idea to chose
a) H.264 for low-bitrate encoding when you have little storage
b) MPEG-4 part 2 for high-bitrate encoding when you need little CPU usage.

My interesting experience is that H.264 is excellent for low bitrate.
I am encoding Futurama episodes with the best multimedia technology:
H.264 video, Vorbis audio, Matroska muxing. For audio,
oggenc -q 0 audiodump.wav
For video,
mencoder -profile anime0 -x264encopts crf=36 -o ${TEMP} ${ORIG}
Where profile anime0 means

ovc=x264=yes
oac=copy=yes
x264encopts=subq=6:8x8dct=yes:frameref=4:bframes=1:nob_adapt=yes:keyint=512:partitions=all:me=umh:me_range=15:trellis=1:direct_pred=auto

The episode length is 21m42.4s . The vorbis stream is 9795482 bytes
(about 60 kbps), and it sounds identical the the original 192 kbps mp3
stream.
The video stream is 17824588 bytes (about 109 kbps), and even at this
absurdly low bitrate (for a 512x384 25 fps cartoon) the video looks
good after the intro. And it is no wonder the intro looks bad, since
it has lots of objects  flying rapidly in several directions.
Fortunately I don't care about the intro.

My remarks:
a) x264's constant quality (crf) option is excellent. In my testing,
it yields nearly the same encoding efficiency (in terms of bitrate at
a given PSNR) as 2-pass encoding. It has two advantages over two pass:
1) It allows the user to select the quality instead of the bitrate.
This is appropriate when you are not planning to exactly fill a CD or
DVD.
2) It is faster.
It is a huge shame that lavc's MPEG-4 part 2 doesn't have such an
option. Specially for people like me who capture video from TV.
Obviously I cannot use two-pass. and one-pass constant bitrate is
about 15% less efficient than two-pass in my testing (meaning, the
bitrate is about 15% bigger for a certain PSNR). It would be great if
I could use a constant quality.
The man page briefly suggests this:
HINT: To do constant quantizer encoding with different  quantizers
for  I/P-  and B-frames you can use: lmin=
<ip_quant>:lmax=<ip_quant>:vb_qfactor= <b_quant/ip_quant>.
I have toyed around with these parameters and I have managed to get a
little bit closer to two-pass efficiency. But it is hard to test
because there is very terse documentation for these parameters. Can
someone explain to me?

It is hard to understand what lmin and lmax exactly do. I have studied
lagrange multipliers, but I cannot understand what lmin and lmax
really do.

My specific requirement is to capture TV at (of course) realtime with
constant quality. The quality should probably be quite high, so I can
later (if I decide so) reencode with a super-high encoding efficiency
(probably H.264).

b) H.264's crf option does not really yield 'constant' quality. The
quality varies a lot; in my case, the intro looked bad, probably
because it has lots of motion. While I don't care about the intro of
my cartoons, I wouldn't like a, say, war movie to have bad looking
high motion scenes. Can the Mencoder guys fix this?

Also, what is the progress of Matroska for mencoder? That would be great.

-- 
Software is like sex: it is better when it is free - Linus Torvalds



More information about the MEncoder-users mailing list