How is a h264 idea bitstream organized? / header start codes

时光毁灭记忆、已成空白 提交于 2019-12-11 03:27:23

问题


I was trying to learn a bit about h264 by looking at the bitstream of a video file with a hex editor. I found here the start codes for a video object planes (0x000001b6) and for i-frames (0x000001b600).

But I can't find many of those bytes in video files. Most of the time those start codes appear at the beginning of a file with only a few bites in between. I expected them to show up very regularly, in equal distance all over the file!?

Is is even ok to look at a file with a hex editor this way? What other start codes exist and how is a h264 file organised?


回答1:


The 0x000001b6 start code applies to mpeg-4 part 2 video which is the simple profile. This corresponds to codecs such as XVID and DIVX. H.264 is mpeg-4 part 10 which is the advanced video coding profile. H.264 uses different start codes.

I am not as familiar with part 10 as I am with part 2, but a brief look through the standard (ISO 14496-10) shows that the bitstream is broken into sections called NAL units. These units have the 24 bit code 0x000001 preceding them for synchronization as per section B.1.1. The following byte is made up of the fields forbidden_zero_bit, nal_ref_idc, and nal_unit_type as per section 7.3.1.

I am not sure whether these NAL units are separated on frame boundaries or not. You may just have to get a hold of the standard that lays out all of the bitstream syntax.



来源:https://stackoverflow.com/questions/2732028/how-is-a-h264-idea-bitstream-organized-header-start-codes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!