简体   繁体   中英

Find frame rate from h265 NAL packets

I have h265 NAL packets and need to determine the frame rate using them. I can do that if i use FFMPEG.

But for my application I cannot use ffmpeg and i need to determine the frame rate by analyzing the bit-stream (by C/C++). I did some research and found that it might be possible to use SPS headers for this. But i couldn't find out how to extract SPS headers and then fame rate.

Can some one tell me how to do this?

Thank you.

You're looking for the time_scale and num_units_in_tick elements in the VUI, which is located at the end of the SPS. The FPS is time_scale / num_units_in_tick. You can check decode_vui() in hevc_ps.c to see how to decode it exactly.

[edit] Oh and these same elements can be present in the VPS also; their values should be identical, but either one of them could be present alone, so you probably want to check both.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM