[FFmpeg-user] How to identify I frame or IDR frame?

penguin flying theflyingpenguin2020 at gmail.com
Sun Jul 19 06:56:24 EEST 2020


After reading a frame like this:

AVFormatContext *ifmt_ctx = NULL;
AVPacket pkt = { .data = NULL, .size = 0 };
...

if ((ret = av_read_frame(ifmt_ctx, &pkt)) < 0)
            break;

How to identify this video frame is IDR frame or not ?

as far as I know,
(pkt.flags & AV_PKT_FLAG_KEY)  only show it is a keyframe,
but can not identify is a IDR frame.

PS: video codec is 264 or 265


More information about the ffmpeg-user mailing list