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

penguin flying theflyingpenguin2020 at gmail.com
Sun Jul 19 06:58:48 EEST 2020


In the situation without decoding, how to identify it ?

penguin flying <theflyingpenguin2020 at gmail.com> 于2020年7月19日周日 上午11:56写道:

> 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