Mar*_*evi 4 video ffmpeg keyframe ffprobe
我正在尝试按照此链接并使用命令将视频的关键帧间隔更改为 1
ffmpeg -i myvideo.mp4 -vcodec libx264 -x264-params keyint=30:no-scenecut -acodec copy out.mp4
Run Code Online (Sandbox Code Playgroud)
如第一个答案所示。我写的是keyint=30我的视频,所以。然而,只有第一帧的关键帧是,其余的都保留(如上面命令之前),如命令所示:fps301*30=3010ffprobe -select_streams v:0 -show_frames out.mp4
...
[FRAME]
media_type=video
stream_index=0
key_frame=1
pkt_pts=0
pkt_pts_time=0.000000
pkt_dts=0
pkt_dts_time=0.000000
best_effort_timestamp=0
best_effort_timestamp_time=0.000000
pkt_duration=512
pkt_duration_time=0.033333
pkt_pos=48
pkt_size=18693
width=560
height=320
pix_fmt=yuv420p
sample_aspect_ratio=N/A
pict_type=I
coded_picture_number=0
display_picture_number=0
interlaced_frame=0
top_field_first=0
repeat_pict=0
[/FRAME]
[FRAME]
media_type=video
stream_index=0
key_frame=0
pkt_pts=512
pkt_pts_time=0.033333
pkt_dts=512
pkt_dts_time=0.033333
best_effort_timestamp=512
best_effort_timestamp_time=0.033333
pkt_duration=512
pkt_duration_time=0.033333
pkt_pos=21764
pkt_size=199
width=560
height=320
pix_fmt=yuv420p
sample_aspect_ratio=N/A
pict_type=B
coded_picture_number=3
display_picture_number=0
interlaced_frame=0
top_field_first=0
repeat_pict=0
[/FRAME]
...
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
最后,我通过命令实现了我想要的:
ffmpeg -i myvideo.mp4 -qscale 0 -g 1 outputFile.mp4
Run Code Online (Sandbox Code Playgroud)