gpt4 book ai didi

python - 拼接图片时ffmpeg视频长度为0

转载 作者:行者123 更新时间:2023-12-04 23:23:32 29 4
gpt4 key购买 nike

我正在尝试连接各个帧,但视频长度为 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 的一帧的持续时间(以秒为单位)。

关于python - 拼接图片时ffmpeg视频长度为0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58778052/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com