Reputation: 1
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
and the output is
[concat @ 0x7b53638000] Line 1: unknown keyword 'file' /path/to/mylist.txt: Invalid data found when processing input
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
Upvotes: 0
Views: 1200
Reputation: 134173
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.
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.
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?
Upvotes: 1