[x264-devel] h.264 encoding live stream from a web cam

Jason Garrett-Glaser darkshikari at gmail.com
Mon Aug 24 03:03:26 CEST 2009


On Sun, Aug 23, 2009 at 6:02 PM, Jason
Garrett-Glaser<darkshikari at gmail.com> wrote:
> On Sun, Aug 23, 2009 at 5:56 PM, i-love-spam<i-love-spam at yandex.ru> wrote:
>> 24.08.09, 04:20, "Jason Garrett-Glaser" <darkshikari at gmail.com>:
>>> > Thanks for prompt reply!
>>> >
>>> > I prefer to use ffmpeg, since I use h263 from ffmepg, and many other utilities.
>>> > Are there any drawbacks to using ffmpeg than x264 directly?
>>> ffmpeg's option system with regards to x264 is braindead; the defaults
>>> that it uses are completely broken.  You basically have to re-set all
>>> the x264 defaults and then go back through and apply your settings.
>>> Of course, if you can do all this and be sure you don't screw up,
>>> you're fine.
>>
>> It appears that the version I was using was direct264, so I switched to x264 latest from git.
>> Without changing anything, I have now problems with video. Now, for the first 2-3
>> seconds av_encode_video returns error, but after that it starts to return OK and the pictures
>> are 2-3 sec old. Basically, it has some buffering now. Probably direct264 also had some extra
>> changes related to that buffering. I'll check with x264 tool to see what settings I should use instead.
>
> Probably because direct264 is forked off an old version of x264 before
> we added the looakhead-related features to x264.
>
> You can adjust lookahead via the rc-lookahead parameter in x264
> (param->rc.i_lookahead).  If you need minimal lookahead, you can
> disable MB-tree (param->rc.b_mbtree).
>
> The total encoder side buffering is:
>
> MAX( rc-lookahead, bframes ) + (threads - 1).
>
>>> The presets in ffpresets/libx264* in the ffmpeg source tree show
>>> command-line examples of how to set sane x264 settings.  The "default"
>>> preset has what used to be the x264 defaults, though it is now
>>> slightly inaccurate since the x264 defaults changed to High Profile.
>>> > By the way, are the any info on running x264 on wince devices? Is there arm optimized code, or x264 is x86 only?
>>> You're asking at a good time--in a day or two now we will be
>>> committing the results of one of the two successful Google Summer of
>>> Code projects this for year--ARM support and assembly optimizations
>>> for NEON SIMD.  This should vastly improve performance on Cortex A8
>>> and Cortex A9 ARM chips, allowing for high-performance mobile encoding
>>> at ultra low power.
>>> Dark Shikari
>>
>> When I updated I compared differences between libx264 and direct264 and my changes to x264 and I noticed that there is some arm specific stuff.
>> Probably, google with their android os should be interested to have high performance h264 lib for arm.
>> What about decoding of h264: ffmepg has it's own decoder. Is there decoder in x264, or it's encoder only? ffmpeg has arm optimized decoder and
>> I even was able to play a video stream from my camera on my mobile :)
>
> x264 is an encoder only.
>
> Dark Shikari
>

Also, if you want a more real-time environment to answer your libx264
usage questions, feel free to drop by #x264 or #x264dev on Freenode
IRC (irc.freenode.net).

Dark Shikari


More information about the x264-devel mailing list