视频关键帧和 Iframe
Video Keyframe and Iframe
我对视频帧提取感到困惑。
我有sample.mp4
video,15FPS。
我尝试使用 FFMPEG 提取关键帧。
ffmpeg -skip_frame nokey -i sample.mp4 -vsync 0 -frame_pts true out%d.png
我得到了 29 张图片,我相信我有 29 个 I 帧。 (如有错误,请指正)
然后我尝试用图片提取特定的时间线(10秒)帧
ffmpeg -i sample.mp4 -ss 00:00:10 -frames:v 1 test1.png
这个输出图片,我在我得到的关键帧中找不到相同的一张。
问题:test1.png
,什么是帧类型?是P帧还是B帧之一不是我?
I get 29 Pictures and I believe I have got 29 I frames. (If I have wrong, Please correct me)
正确。请参阅 Checking keyframe interval? 进行验证。
Question: test1.png, What is frame type? Does it one of P or B frame not I ?
使用ffprobe
:
ffprobe -select_streams v -show_entries "frame=pkt_pts_time,pict_type" -of csv input.mp4
示例输出:
frame,9.968000,B
frame,10.010000,B <---
frame,10.052000,P
请注意,在此示例中 -ss 00:00:10
向上舍入到最接近的帧 (10.010000)。这是本例中的 B 帧 (input.mp4
)。
我对视频帧提取感到困惑。
我有sample.mp4
video,15FPS。
我尝试使用 FFMPEG 提取关键帧。
ffmpeg -skip_frame nokey -i sample.mp4 -vsync 0 -frame_pts true out%d.png
我得到了 29 张图片,我相信我有 29 个 I 帧。 (如有错误,请指正)
然后我尝试用图片提取特定的时间线(10秒)帧
ffmpeg -i sample.mp4 -ss 00:00:10 -frames:v 1 test1.png
这个输出图片,我在我得到的关键帧中找不到相同的一张。
问题:test1.png
,什么是帧类型?是P帧还是B帧之一不是我?
I get 29 Pictures and I believe I have got 29 I frames. (If I have wrong, Please correct me)
正确。请参阅 Checking keyframe interval? 进行验证。
Question: test1.png, What is frame type? Does it one of P or B frame not I ?
使用ffprobe
:
ffprobe -select_streams v -show_entries "frame=pkt_pts_time,pict_type" -of csv input.mp4
示例输出:
frame,9.968000,B
frame,10.010000,B <---
frame,10.052000,P
请注意,在此示例中 -ss 00:00:10
向上舍入到最接近的帧 (10.010000)。这是本例中的 B 帧 (input.mp4
)。