[FFmpeg-user] IDR frames v non-IDR frames

Srikanth Kotagiri srikanthk at gmail.com
Fri Jul 5 07:56:13 EEST 2024


>
> You think key_frame means IDR? Nope. I've asked many times what "key_frame" means but no one has
> offered an answer. But it definitely does not mean IDR. I have videos with frames reported as
> key_frames that are definitely non-IDR. It was considerate of you to reply, though.

Good point. Looking at the H.264 spec it says

>3.68 instantaneous decoding refresh (IDR) access unit: An access unit in which the primary coded picture is an
>IDR picture.

>3.69 instantaneous decoding refresh (IDR) picture: A coded picture for which the variable IdrPicFlag is equal to 1.
>An IDR picture causes the decoding process to mark all reference pictures as "unused for reference" immediately
>after the decoding of the IDR picture. All coded pictures that follow an IDR picture in decoding order can be
>decoded without inter prediction from any picture that precedes the IDR picture in decoding order. The first
>picture of each coded video sequence in decoding order is an IDR picture.

And the IdrPicFlag is defined as

>In the text, coded slice NAL unit collectively refers to a coded slice of a non-IDR picture NAL unit or to a coded slice of an IDR picture NAL unit. The variable IdrPicFlag is specified as
>     IdrPicFlag = ( ( >nal_unit_type = = 5 ) ? 1 : 0 )
>(7-1) When the value of nal_unit_type is equal to 5 for a NAL unit containing a slice of a particular picture, the picture shall not contain NAL units with nal_unit_type in the range of 1 to 4, inclusive. For coded >video sequences conforming to one or more of the profiles specified in Annex A

So any frame with NUT type 5 is automatically an IDR frame.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 326392 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-user/attachments/20240705/b70f76d1/attachment.png>


More information about the ffmpeg-user mailing list