[FFmpeg-trac] #8820(avcodec:new): skip_frame nokey skips everything but IDR frames (H.264)
FFmpeg
trac at avcodec.org
Mon Jul 27 05:32:01 EEST 2020
#8820: skip_frame nokey skips everything but IDR frames (H.264)
-------------------------------------+-------------------------------------
Reporter: | Type: defect
skippableframe |
Status: new | Priority: minor
Component: avcodec | Version:
| unspecified
Keywords: avc | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
When using ffmpeg and ffprobe with `-skip_frame nokey` on H.264 files,
only IDR frames are retained. Other I frames are skipped.
This is doubly confusing because `ffprobe -show_frames` marks these (non-
IDR) I frames with `key_frame=1`.
Some retail Blu-ray disks are encoded with non-IDR I frames throughout.
Some encoders seem to emit no IDR frames when configured for open GOP.
This ticket for H.265 is similar.
https://trac.ffmpeg.org/ticket/7227
ffmpeg 4.3.1 built on FreeBSD, macOS.
Run ffprobe with `-skip_frames nokey` and most key frames are skipped.
{{{
% ffprobe -v error -skip_frame nokey -show_frames test.mkv
[h264 @ 0x80668b400] illegal short term buffer state detected
[FRAME]
media_type=video
stream_index=0
key_frame=1
pkt_pts=10000
pkt_pts_time=10.000000
pkt_dts=9920
pkt_dts_time=9.920000
best_effort_timestamp=10000
best_effort_timestamp_time=10.000000
pkt_duration=40
pkt_duration_time=0.040000
pkt_pos=3318507
pkt_size=43205
width=720
height=576
pix_fmt=yuv420p
sample_aspect_ratio=157:144
pict_type=I
coded_picture_number=1
display_picture_number=0
interlaced_frame=1
top_field_first=1
repeat_pict=0
color_range=tv
color_space=bt470bg
color_primaries=bt470bg
color_transfer=bt470bg
chroma_location=left
[/FRAME]
[FRAME]
media_type=video
stream_index=0
key_frame=1
pkt_pts=0
pkt_pts_time=0.000000
pkt_dts=N/A
pkt_dts_time=N/A
best_effort_timestamp=0
best_effort_timestamp_time=0.000000
pkt_duration=40
pkt_duration_time=0.040000
pkt_pos=635
pkt_size=2862
width=720
height=576
pix_fmt=yuv420p
sample_aspect_ratio=157:144
pict_type=I
coded_picture_number=0
display_picture_number=0
interlaced_frame=1
top_field_first=1
repeat_pict=0
color_range=tv
color_space=bt470bg
color_primaries=bt470bg
color_transfer=bt470bg
chroma_location=left
[/FRAME]
}}}
That's it, just the two frames.
Run ffprobe without `-skip_frames nokey` and all I frames are recognized.
{{{
% ffprobe -v error -show_frames test.mkv | grep key_frame=1
key_frame=1
key_frame=1
key_frame=1
key_frame=1
key_frame=1
key_frame=1
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/8820>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list