[vlc-devel] Re: files encoded to x264 with mencoder fail to stream with vlc

Måns Rullgård mru at inprovide.com
Sun Mar 26 22:43:44 CEST 2006

David Liontooth <liontooth at cogweb.net> writes:

> Måns Rullgård wrote:
>> David Liontooth <liontooth at cogweb.net> writes:
>>> A couple of weeks ago I reported to this list that files encoded to
>>> h264 by mencoder failed to display properly when played back on amd64
>>> vlc on Linux.
>>> People pointed out VLC supports h264 through the x264 project, and I
>>> rebuilt VLC and x264 from source. This in fact solved the problem; on
>>> this version, files encoded to h264 using mencoder display correctly
>>> on amd64 vlc.
>> This must have been a coincidence.  x264 is only an encoder.  VLC uses
>> ffmpeg's libavcodec for decoding H.264.
> I rebuilt agains Marillat's more recent ffmpeg. The problem is ffmpeg
> is currently being held up in Debian.

Well, what do you expect of Debian?  They're not exactly known for
being quick to include new versions of software.

>>> However, when these same files (mencoder-encoded h264 files) are
>>> streamed, they don't display properly on any platform. A streaming
>>> sample is available if someone is open to looking at it. The picture
>>> is incredibly blocky, freezes, and so on. I've tested reception on
>>> Linux amd64, i386, and Winxp i386 and there's no difference.
>>> In contrast, files encoded to h264 by ffmpeg stream perfectly.
>> Both ffmpeg and mencoder use x264 to encode H.264.  Run "strings" on
>> files encoded with both.  One of the first few lines should show all
>> the settings used and the version of x264.  If you post those lines
>> here maybe someone can tell why only one of them works.
> In my version, mencoder uses x264 core 43, and ffmpeg core 44. Could
> this make the difference?

That could make a lot of difference.  x264 v43 and earlier wrote an
incorrect frame rate.  FFmpeg from the same day as x264 v44 or later
have the corresponding fix and a workaround for streams encoded with
old x264 versions.  Using an old ffmpeg with a new x264 could make
video play at the wrong frame rate.

> The strings command also shows a hundred lines of junk early on in the
> mencoder-encoded file; could this throw VLC off when streaming?

That's just AVI header stuff.  Perfectly normal.

> Bear in mind these files all play fine on VLC locally; it's just that
> the mencoder-encoded files stream messed up.
> These files are encoded on amd64, but stream messed up also when
> streamed from i386.

There are no known compatibility problems with amd64 in x264 or ffmpeg.

> Encoded with mencoder (plays fine, but streams all messed up:
> x264 - core 43 - H.264/MPEG-4 AVC codec - Copyleft 2005 -
> http://www.videolan.org/x264.htm
> l - options: cabac=1 ref=4 deblock=1:0:0 analyse=0x3:0x113 me=hex
> subme=6 brdo=0 mixed_ref
> =0 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 chroma_qp_offset=0
> slices=2 bframes=3
> b_pyramid=0 b_adapt=1 b_bias=0 direct=2 wpredb=0 bime=0 keyint=250
> keyint_min=25 scenecut=
> 40 pass=2 bitrate=800 ratetol=1.0 rceq='blurCplx^(1-qComp)' qcomp=0.60
> qpmin=10 qpmax=51 q
> pstep=2 cplxblur=20.0 qblur=0.5 ip_ratio=1.40 pb_ratio=1.30
> Encoded with ffmpeg (plays and streams fine):
> x264 - core 44 - H.264/MPEG-4 AVC codec - Copyleft 2005 -
> http://www.videolan.org/x264.htm
> l - options: cabac=0 ref=1 deblock=0:0:0 analyse=0x1:0 me=dia subme=6
> brdo=0 mixed_ref=0 m
> e_range=4 chroma_me=0 trellis=0 8x8dct=0 cqm=0 chroma_qp_offset=0
> slices=1 nr=0 bframes=0
> keyint=12 keyint_min=7 scenecut=0 rc=abr bitrate=600 ratetol=6.7
> rceq='tex^qComp' qcomp=0.
> 50 qpmin=2 qpmax=31 qpstep=3 ip_ratio=1.25

One difference I see here is that mencoder used B-frames, while ffmpeg
didn't.  B-frames in AVI is a Bad Idea (tm).

Måns Rullgård
mru at inprovide.com

This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html

More information about the vlc-devel mailing list