由于未知原因,串联在ffmpeg中不起作用 [英] Concatenation not working in ffmpeg for unknown reason
问题描述
我正在尝试使用 ffmpeg -y -f concat -safe 0 -i/path/to/mylist.txt -c:v libvpx-vp9 -c:a libopus输出连接ffmpeg中的2个视频.webm
,其中 mylist.txt
是
i'm trying to concatenate 2 videos in ffmpeg, using ffmpeg -y -f concat -safe 0 -i /path/to/mylist.txt -c:v libvpx-vp9 -c:a libopus output.webm
, in which mylist.txt
is
file /path/to/file.mp4
file /path/to/file.mkv
输出为
[concat @ 0x7b53638000] Line 1: unknown keyword 'file' /path/to/mylist.txt: Invalid data found when processing input
我也尝试使用"concat:file.mp4 | file.mkv"
,但它只是复制了 file.mp4
我的问题是,这是什么问题?我使用的方法已在ffmpeg的网站上得到验证
i also tried using "concat:file.mp4|file.mkv"
but it just replicated file.mp4
my question is, what is the problem here? the method i used is verified on ffmpeg's website
推荐答案
有一个不可见的字符,称为导致错误的字节顺序标记(BOM).一些文本编辑器添加了BOM,尤其是Windows记事本和Google Docs输出的纯文本( .txt
).
There is an invisible character called a Byte Order Mark (BOM) that is causing the error. Some text editors add a BOM: notably Windows Notepad and the Plain text (.txt
) output from Google Docs.
FFmpeg中的concat多路分解器当前不支持带有BOM表的文本文件.一个开发人员认为它是"Microsoft废话":#3718:ffmpeg无法正确读取输入文本文件.
A text file with a BOM is not currently supported by the concat demuxer in FFmpeg. One developer considers it to be "broken Microsoft bullshit": #3718: ffmpeg does not correctly read input text file.
解决方案是在将文本文件提供给 ffmpeg
之前,使用更好的文本编辑器或删除BOM.可以在中找到一些与Linux相关的示例.如何从UTF-8文件中删除BOM表?
Solution is to use a better text editor or remove the BOM before providing the text file to ffmpeg
. Some Linux related examples can be seen in How can I remove the BOM from a UTF-8 file?
这篇关于由于未知原因,串联在ffmpeg中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!