如何将flv文件连接成一个? [英] How to concatenate flv file into one?
问题描述
有一个名为input.txt的文件
There is a file named input.txt
file '/home/1.flv'
file '/home/2.flv'
我可以使用命令连接1.flv和2.flv转换成mp4文件。
I can use the command to Concatenate 1.flv and 2.flv into a mp4 file.
# there are two files in output.mp4
ffmpeg -f concat -i input.txt -c copy output.mp4
当我使用以下命令
ffmpeg -i "concat:1.flv|2.flv" -c copy output.mp4
我发现只有一个文件 1.flv
I found the there is only one file 1.flv
in the output.mp4
, why?
推荐答案
我发现在
output.mp4
中只有一个文件1.flv
。为什么?
I found the there is only one file
1.flv
in theoutput.mp4
. Why?
您的第一个命令使用 concat
demuxer 。如果您希望避免重新编码,并且输入不支持文件级连接,则可以使用此选项。使用解码器要求所有文件必须具有相同的流(相同格式,相同的时基等),但是相对较新的添加,所以较老的ffmpeg版本将不具有此功能。
Your first command uses the concat
demuxer. This can be used if you want to avoid re-encoding and when your inputs do not support file level concatenation. Using the demuxer requires that all files must have the same streams (same formats, same time base, etc.), but is a relatively recent addition so older ffmpeg builds will not have this feature.
您的第二个命令使用 concat
协议,这需要您的输入来支持文件级连接(如MPEG-1视频,MPEG-2视频和DV)。这些是两种不同的连接方式(或加入,通常由用户调用)。
Your second command uses the concat
protocol which requires your inputs to support file level concatenation (such as MPEG-1 video, MPEG-2 video, and DV). These are two different methods of concatenating (or "joining" as it is often called by users).
另请参阅如何连接(加入,合并)媒体文件在 FFmpeg Wiki 。我看到你也在ffmpeg-user上问了这个,其他人也提供了一个答案: [FFmpeg-user]不能连接flv文件。
Also see How to concatenate (join, merge) media files on the FFmpeg Wiki. I see you also asked this on ffmpeg-user where someone else also provided an answer: [FFmpeg-user] can't concatenate the flv file.
这篇关于如何将flv文件连接成一个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!