[MPlayer-dev-eng] [PATCH] H.264 encoding in mencoder

Bernhard Rosenkraenzer bero at arklinux.org
Thu Aug 5 07:09:39 CEST 2004


On Tuesday 03 August 2004 07:02, snacky at ikaruga.co.uk wrote:
> Line 262 of the patch contains this line:
> +       for(int i=0; i<4; i++) {
> i has already been declared once in this scope.

This is valid in ISO C99, but I see why it would cause problems with some 
compilers. I've fixed it in the (attached) newer version.

> 1. The encoder completely fails to open for videos with width or height
> not divisible by 16. I realize there are probably a few people who think
> this is a GOOD thing...

That's a limitation of the x264 library - there's nothing we can do about it 
on the mencoder side. Or is it preferrable to ignore (fix) the width/height 
parameters passed to config()?

> 2. Sometimes the encoder dies due to colorspace problems, with the message
> "invalid CSP (only I420 supported)." This can be triggered by using a
> filter chain that includes -vf unsharp with (apparently) any parameters
> at all.

Fixed

> 3. Any time the encoder works, it automatically appends decoded video
> output to fdec.yuv. (I actually ran out of disk space before I noticed
> this.) This is something x264 does which I am not smart enough to change.

That's a matter of how you compile the x264 library.
I recommend compiling it with DEBUG_DUMP_FRAME removed (in encoder/encoder.c) 
and -DDEBUG removed from the toplevel Makefile.

> 4. Somewhat contrary to the report of the patch submitter, I had
> no problem generating files that mplayer will play, but only with the
> setting bframe=0. Otherwise mplayer always crashes on decoding. This is
> the case with nightly CVS from August 1. I have abslutely zero insight
> or useful data into this.

Still happens here. With quite a few (though not all) files I encode, mplayer 
gives a signal 11 in decode_video.
When playing the same files with vlc, it works and I get some warnings on 
stderr:
[h264 @ 0xb7f217d0]non existing PPS referenced

This points to an encoder bug in x264, and vlc handling a slightly damaged 
h264 bitstream more gracefully than mplayer.

> 5. The encoder ignores the bitrate option, but the manpage doesn't
> mention this fact.

This, again, is a limitation of the x264 library in its current version.
The patch sets the bitrate setting in the x264 parameter struct correctly, but 
x264 goes on to ignore it (this is a known problem; it's one of the items in 
x264's TODO list).

LLaP
bero
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mencoder-20040805-h264.patch
Type: text/x-diff
Size: 17048 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20040805/88d0e392/attachment.patch>


More information about the MPlayer-dev-eng mailing list