Log in

View Full Version : Time per frame in x264


mavrick_264
21st December 2013, 13:09
hi,
i want to see how much time each frame is consuming for x264 encoding. Where should i look for?
i saw ticks_per_frame in the code, but not sure if it is the right thing to look at.
can anybody help?
Also does the code make any file where i can get this collective information?
i am a newbee. i have got the code from VideoLAN site and am using Ubuntu 12.04 and g++ for making the code.

P.S.: While using nemiver for a single step debugging, i found that the cursor for current execution goes upwards sometimes in the execution! i mean executing the declarations above. :eek: isn't that weird! or is it nothing to be worried? Encoder works fine though!
Thanks.

nm
21st December 2013, 14:02
hi,
i want to see how much time each frame is consuming for x264 encoding. Where should i look for?

Search for "print_status" in x264.c


Also does the code make any file where i can get this collective information?

Average encoding framerate is written to stderr at the end of the encoding. No frame-specific information about elapsed time is stored in any log.



i am a newbee. i have got the code from VideoLAN site and am using Ubuntu 12.04 and g++ for making the code.

You mean gcc since x264 codebase is plain C.



P.S.: While using nemiver for a single step debugging, i found that the cursor for current execution goes upwards sometimes in the execution! i mean executing the declarations above.

GCC reoders instructions when optimizing for speed.

LoRd_MuldeR
21st December 2013, 15:02
Also be aware that the "FPS" displayed by x264 is nothing but the total duration of the encoded (so far) divided by the total number of frames processed (so far).

If you want timings for individual frames, I think you will need to measure the time for each call of x264_encoder_encode() call. Though be aware of the effects of multi-threading!

BTW: ticks_per_frame is the duration that a frame will be displayed (for CFR video only), used to generate the presentation time stamps. Not related to encoding times...

mavrick_264
23rd December 2013, 08:18
Thanks alot!!
It is quite helpful!!