Keyframe Detection in TS with H264 Codec

Is there an easy, not terribly complicated way to detect a keyframe in an H264 video stream enclosed in a transport stream?

Also, if the additional previous packets needed to decode the key frame, is there a way to find them?

+4
source share
1 answer

There is no super easy way to find an I-frame. You should read the AVC stream transport stream packets. Then you need to collect packets with a packetized elementary data stream (PES), split the PES header, and then identify the type of NAL 5. So, you need a transport stream demonstrator, find the beginning of the PES packets and do a minimal H.264 parsing. For demultiplexing, you can look at this source code: http://tsdemuxer.googlecode.com/svn/trunk/v1.0/tsdemux.cpp

+2
source

All Articles