[x264-devel] Question about x264 real time encoding

Jason Garrett-Glaser darkshikari at gmail.com
Tue Apr 6 18:32:31 CEST 2010


On Tue, Apr 6, 2010 at 7:27 AM, Bo SONG <benben841212 at gmail.com> wrote:
> Hi, I'm new to here. Hope that I'm not posting in the wrong place.
>
> I use x264 to encode my camera video in real time. The original video is in
> 720P/30 format and captured by my AJA card. I en-capsuled x264 into a
> Directshow filter.
>
> I wrote some lines to measure the average return time of
> x264_encoder_encode, which should be throughput I think; and also some
> lines measuring the average corresponding latency of specific frame
> (currenttime - pts returned by x264_encoder_encoder ).
>
> Here is my result:
> 1. Commandline:
> --bframes 0 --force-cfr --rc-lookahead 0
> --sync-lookahead 0 -B 2500
> Result:
> X264Enc: 15.16 ms/frame, throughtput 30.0481 frames/sec, latency
> 367.031 ms/frame
> 2. Commandline:
> --tune zerolatency -B 2500
> Result:
> X264Enc: 59.99 ms/frame, throughtput 16.2417 frames/sec, latency 0
> ms/frame
>
> So it seems that high throughput leads to long latency, while low latency
> cannot get such throughput. It is really frustrating. Anyone has some clue
> to fix this?

Sliced-threads is a bit slower than regular threads (not that much
slower though).

Have you tried using faster encoding settings?  720p at default
settings in realtime requires a very fast CPU.  Using, say, veryfast,
should easily get you up to 100fps or more.

Dark Shikari


More information about the x264-devel mailing list