【问题标题】:FFMPEG concat video finished but the video missingFFMPEG concat 视频已完成,但视频丢失
【发布时间】:2017-04-21 07:50:14
【问题描述】:

我使用 FFMPEG 连接视频。这是代码: ffmpeg -i "concat:video1.webm|video2.webm|video3.webm|video4.webm" -c copy output_video.webm

连接完成后,我播放视频,但视频仅显示 video1。它缺少video2、video3、video4。虽然, output_video.webm 是全尺寸的。我不知道为什么?请帮助我,如何解决?

非常感谢, 边

【问题讨论】:

    标签: video ffmpeg


    【解决方案1】:

    它不起作用,因为“webm”文件格式不支持“concat 协议”(也称为二进制 concat)。支持 avi、mpeg-ts。请参阅FFMPEG Concat 文档详细讨论此问题。

    解决方案: 如上文档所述,您可以使用更灵活的“concat demuxer”,如下所示:

    ffmpeg -f concat -i mylist.txt -c copy output
    
    
    Where mylist.txt is something like:
    
    # this is a comment
    file '/path/to/file1'
    file '/path/to/file2'
    file '/path/to/file3'
    

    在当前目录中组合 2 个 mp4 文件(video1.mp4 和 video2.mp4)的示例。

    ffmpeg 命令:

    ffmpeg -f concat -i filelist.txt -c copy output.mp4
    

    'filelist.txt'的内容

    file 'video1.mp4'
    file 'video2.mp4'
    

    @output.mp4 可用的级联视频

    【讨论】:

    • 感谢 Arun Kumar,我正在使用来自网络浏览器的录制视频,我正在使用此命令进行连接:cd /var/www/html/record/uploads/tmp; ls > 文件列表.txt;查找 *.webm | sed 's:\ :\\\ :g'| sed 's/^/file /' > filelist.txt; ffmpeg -f concat -i filelist.txt -c 复制 /var/www/html/record/uploads/".$filename.".webm; rm -rf *
    • 当我完成连接视频时。我打开视频,但无法显示所有内容。输出视频仅显示 file1 之一。我尝试在窗口中将视频与 MKVToolNix 软件合并。它有同样的问题。 MKVToolNix 合并视频成功,但我打开视频它无法显示所有内容。输出视频仅显示 file1 的内容。我不知道为什么?以及如何解决?
    • 我猜上面的命令有问题。 $filename 前面加上了额外的 DOT。试试这个'ffmpeg -f concat -i filelist.txt -c copy /var/www/html/record/uploads/output.webm'。这曾经对我有用。
    • 亲爱的 Arun Kumar,我将视频与 ffmpeg 合并,但输出视频缺少内容。你用 ffmpeg 合并视频了吗?怎么做才能让输出的视频内容完整?
    • 它对我有用。我可以看到连接的输出视频。我使用了命令 'ffmpeg -f concat -i filelist.txt -c copy output.mp4' 和 'filelist.txt' 有 2 行。 Line1:文件'video1.mp4' Line2:文件'video2.mp4'
    猜你喜欢
    • 1970-01-01
    • 2019-01-28
    • 2019-12-28
    • 2017-09-20
    • 2016-05-26
    • 2016-04-30
    • 2018-10-10
    • 2017-04-13
    • 2017-12-19
    相关资源
    最近更新 更多