无法使用 ffmpeg 将视频关键帧间隔更改为 1

Cannot change video keyframe interval to be 1 using ffmpeg

我正在尝试将视频的 关键帧间隔更改为 1 this link 并使用命令

ffmpeg -i myvideo.mp4 -vcodec libx264 -x264-params keyint=30:no-scenecut -acodec copy out.mp4

如第一个答案所示。我写 keyint=30 因为我的视频 fps30,所以 1*30=30。但是,只有第一帧的关键帧是1,其余的都保持0(和上面命令之前一样),如命令ffprobe -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]
...

有什么想法吗?

终于通过命令实现了我想要的效果:

ffmpeg -i myvideo.mp4 -qscale 0 -g 1 outputFile.mp4