Is there an easy not horrifyingly complex way to detect key-frame in an H264 video stream wrapped in a Transport Stream?
Also, if extra pr开发者_运维百科evious packets needed for the decoding of the key-frame is there a way to find those as well?
There is no super simple way of finding the I frame. You have to read the transport stream packets of the AVC stream. Then you have to assemble the packetized elementry stream packets (PES), strip the PES header and then identify the NAL type 5. So you will need an transport stream demuxer, find the beginning of PES packets and do minimal H.264 parsing. For demuxing you could look at this source code: http://tsdemuxer.googlecode.com/svn/trunk/v1.0/tsdemux.cpp
精彩评论