How does ffprobe identifies I frame and IDR, when it sets key_frame=1 How does ffprobe identifies I frame as an IDR and sets key_frame=1.
Is it for the scene change?

My requirement is to filter out IDR frames: the steps I am following are


ffprobe output_file -show_frames -select_streams v:0
Filter above command results with key_frame=1 values(as per ffprobe IDR)
The total count i got is 259. Using ffprobe I am getting wrong sets of key_frame=1 values.
When i analyzed the same file with textronic analyzer I got correct values idr = 118


Textronix analyzer gives me below details for a a file verification.

TotalPictures:Count[ 5864]
I Pictures: Count[  259]
P Pictures: Count[ 1059]
B Pictures: Count[ 4546]

RAP Pictures:Count[259]
IDR Pictures:Count[118] 
BLA Pictures:Count[0] 
CRA Pictures:Count[141]

Frames:     Count[ 5864]    Percentage[100.00]
Fields:     Count[    0]    Percentage[0.00]

GOP (in Pictures, between I): Count[258] AverageSize[22] MinSize[1] MaxSize[50]
CVS (in Pictures, between IDR):Count[117] AverageSize[50]MinSize[50]MaxSize[50]


Now how to identify correct IDR count using ffprobe?

FFmpeg is setting iskey to 1 for CRA frames as well(tried with -skip_frame nokey). I need to collect only IDR frames
It sounds like you're analyzing a HEVC bitstream. HEVC has multiple types of Random Access Pictures, only one of which clears the buffer. But ffmpeg flags all of them as keyframes.

You have to use the HEVC decoder to parse this info out. The skip_frame option, as implemented in the HEVC decoder, only decodes IDR frames.

Use

ffmpeg -skip_frame nokey -i in.mp4 -vf showinfo -vsync 0 -f null -


The number of frames output is the IDR count.



For the sample file, you can use the filter_units bitstream filter to keep only IDR frames

ffmpeg -copyts -i HEVC-1080i25-STB_02_576i25.ts -an -c copy -bsf:v filter_units="19-20" -f mpegts - | ffmpeg -copyts -i - -vf showinfo -f null NUL


This will show the data of 118 frames, same as the analyzer.