连接图片时ffmpeg视频长度为0
ffmpeg video length is 0 when concatenating pictures
我正在尝试连接各个帧,但视频长度为 0,而且所有帧似乎同时播放。我试过在 ffmpeg 中增加视频长度并更改帧速率。
os.system('ffmpeg -f concat -i List_tb.txt -c copy output.mp4')
os.system("ffmpeg -i output.mp4 -filter:v fps=fps=120 output_temp.mp4")
os.system("ffmpeg -i output_temp.mp4 -filter:v setpts=8.0*PTS final.mp4")
帧率也是帧数
由于图像没有固有的时间戳,concat demuxer 无法为其生成的数据包生成平滑单调的时间戳序列。您可以通过在列表中为每个文件指定持续时间指令来解决此问题,即
file '-1.1257558476894771_10_1_0j.png'
duration 0.04
file '-0.8103308013367797_10_1_0j.png'
duration 0.04
file '1.0805993584315776_10_1_0j.png'
duration 0.04
...
其中 0.04
是 25 fps 下一帧的持续时间(以秒为单位)。
我正在尝试连接各个帧,但视频长度为 0,而且所有帧似乎同时播放。我试过在 ffmpeg 中增加视频长度并更改帧速率。
os.system('ffmpeg -f concat -i List_tb.txt -c copy output.mp4')
os.system("ffmpeg -i output.mp4 -filter:v fps=fps=120 output_temp.mp4")
os.system("ffmpeg -i output_temp.mp4 -filter:v setpts=8.0*PTS final.mp4")
帧率也是帧数
由于图像没有固有的时间戳,concat demuxer 无法为其生成的数据包生成平滑单调的时间戳序列。您可以通过在列表中为每个文件指定持续时间指令来解决此问题,即
file '-1.1257558476894771_10_1_0j.png'
duration 0.04
file '-0.8103308013367797_10_1_0j.png'
duration 0.04
file '1.0805993584315776_10_1_0j.png'
duration 0.04
...
其中 0.04
是 25 fps 下一帧的持续时间(以秒为单位)。