本文介绍了FFMPEG concat视频完成,但视频丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将视频与FFMPEG连接在一起.这是代码: ffmpeg -i"concat:video1.webm | video2.webm | video3.webm | video4.webm" -c复制output_video.webm

I was concatenated video with FFMPEG. Here is code:ffmpeg -i "concat:video1.webm|video2.webm|video3.webm|video4.webm" -c copy output_video.webm

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

After concatenate finished, I play the video but the video display only video1. It missing the video2, video3, video4. Although, The output_video.webm is full size. I don't know why? Please help me, How to fix it?

非常感谢你,比恩

推荐答案

它不起作用,因为"webm"文件格式不支持"concat协议"(也称为二进制concat).avi,mpeg-ts支持该功能.请找到 FFMPEG Concat 文档对此进行详细讨论.

It is not working because the 'concat protocol' (also called as binary concat) is not supported for 'webm' file format. It is supported for avi, mpeg-ts. Please find the FFMPEG Concat documentation talks about this in detail.

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

Solution:As mentioned in above document, you can use the 'concat demuxer' which is more flexible as below:

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)的示例.

Example of combining 2 mp4 files (video1.mp4 and video2.mp4) in current directory.

ffmpeg命令:

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

"filelist.txt"的内容

content of 'filelist.txt'

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

级联的视频可用@ output.mp4

concatenated videos available @ output.mp4

这篇关于FFMPEG concat视频完成,但视频丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 14:37