Log in

View Full Version : how to judge the key frame in h264 stream


alexsmith
4th July 2012, 02:55
Dear all,

Is there a simple way to judge whether a h264 frame is a key
frame or not?

If not, is there any document that I can use to solute this
problem?

thanks in advance,
alex

Dust Signs
4th July 2012, 07:05
IDR pictures (NAL unit type 5) are always key pictures. I pictures can be key pictures, but do not have to be, since the pictures after it may be predicted from pictures coded before the I picture. Sometimes, recovery point SEI messages (NAL unit type 6 with SEI payload type 6) are present which indicate that I pictures are actually key pictures, but you can't rely on the existence of these SEI messages since they are optional.

Dust Signs

hello_hello
4th July 2012, 08:03
Aside from the above, of which I was blissfully unaware, ffdshow has "frame type" as part of it's on screen display. Of course you've got to play the video and stop it on the frame in question.....

Blue_MiSfit
9th July 2012, 03:25
You can also use ffdshow + DirectShowSource in AviSynth to get granular seeking.

I believe this method doesn't make a distinction between IDR pictures and I pictures, and simply calls them all I pictures.