How does ffprobe identifies I frame and IDR, when it sets key_frame=1
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.