【问题标题】:ffmpeg video length is 0 when concatenating pictures拼接图片时ffmpeg视频长度为0
【发布时间】:2019-11-09 09:41:09
【问题描述】:

我正在尝试连接单个帧,但视频长度为 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")

帧速率也是帧数

【问题讨论】:

  • 打印 List_tb.txt 并分享第一条命令的日志
  • 在哪里可以找到日志?
  • 重新运行添加了 -report 的命令并查看工作目录。
  • ffmpeg 于 2019 年 11 月 9 日 19:16:57 开始 报告写入“ffmpeg-20191109-191657.log”命令行:“C:\\FFmpeg\\bin\\ffmpeg. exe" -f concat -safe 0 -i List_tb.txt -c copy output.mp4 -report ffmpeg version N-94335-g9869e21776 版权所有 (c) 2000-2019 FFmpeg 开发人员使用 gcc 9.1.1 (GCC) 20190716 构建跨度>
  • 这就是开始。添加整个日志。

标签: python video ffmpeg concat frames


【解决方案1】:

由于图像没有固有的时间戳,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 的一帧的持续时间(以秒为单位)。

【讨论】:

    猜你喜欢
    • 2022-01-13
    • 1970-01-01
    • 1970-01-01
    • 2020-02-24
    • 2016-11-02
    • 2017-10-10
    • 2010-12-16
    • 1970-01-01
    • 2013-02-22
    相关资源
    最近更新 更多