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

Måns Rullgård mru at inprovide.com
Mon Mar 27 00:36:44 CEST 2006


David Liontooth <liontooth at cogweb.net> writes:

> Måns Rullgård wrote:
>> David Liontooth <liontooth at cogweb.net> writes:
>>
>>> 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.
>>
> Thanks! Marillat just released an updated version of mplayer, so I got
> to test this -- and it still fails to stream.
> The aspect ratio is wrong at the receiving end -- as if it's using
> width for height? It's all blurred and blocky.

It sounds like you are loosing packets or something.  Does VLC report
anything of the kind?  There's a menu option somewhere to open a
window where all messages show up.

> Strings now shows,
>
> x264 - core 45 - 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 nr=0 bfram
> es=3 b_pyramid=0 b_adapt=1 b_bias=0 direct=1 wpredb=0 bime=0
> keyint=250 keyint_min=25 scen
> ecut=40 rc=2pass bitrate=667 ratetol=1.0 rceq='blurCplx^(1-qComp)'
> qcomp=0.60 qpmin=10 qpm
> ax=51 qpstep=2 cplxblur=20.0 qblur=0.5 ip_ratio=1.40 pb_ratio=1.30
>> One difference I see here is that mencoder used B-frames, while ffmpeg
>> didn't.  B-frames in AVI is a Bad Idea (tm).
>>
> In mencoder, I was using this --
>
> mencoder -tv
> driver=v4l2:device=/dev/video$DEV:fps=30000/1001:chanlist=us-bcast:\
> audiorate=32000:adevice=/dev/dsp$DEV:input=0:amode=1:normid=4:width=384:height=288
> \
> -ovc x264 -x264encopts
> threads=2:bitrate=500:bframes=3:subq=6:me=2:frameref=4:8x8dct \
> -oac mp3lame -lameopts cbr:br=64 -endpos $TIM -o $DIR/$FIL.avi tv:// >
> /dev/null
>
> Setting "bframes=0" slowed the encoder; should I just leave it out? 

That's odd.  Not using B-frames usually encodes faster.

> What are sensible values to use for mencoder? I don't have to use
> the avi wrapper -- what would you recommend? All we need is for the
> files to play well in VLC on Linux, OSX, and Windows -- a bonus
> would be if they could be read into Quicktime on OSX.
>
> I tested again without "bframes=3" and now the aspect ratio is
> correct, but the stream is still completely messed up. Strings show,
>
> x264 - core 45 - 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 nr=0 bfram
> es=0 keyint=250 keyint_min=25 scenecut=40 rc=2pass bitrate=669
> ratetol=1.0 rceq='blurCplx^
> (1-qComp)' qcomp=0.60 qpmin=10 qpmax=51 qpstep=2 cplxblur=20.0
> qblur=0.5 ip_ratio=1.40
>
> So bframes causes problems with aspect ratio for VLC when streaming,

I doubt that the bframes option is directly causing your aspect ratio
issues.

> but there's some other factor that messes up the picture.  Again,
> the file plays fine locally, and for some reason ffmpeg-encoded
> files stream flawlessly.

Try increasing the I-frame (keyint) frequency a bit.  You have it set
at 250, which is a bit high for streaming.  Try with 25 instead.

How are you streaming the files?

-- 
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