Question:
I have a file ffmpeg_list_of_files.txt
with the content
1 2 3 4 5 6 7 |
file '.\Output_0\forces_vs_radii.pdf' file '.\Output_1\forces_vs_radii.pdf' file '.\Output_2\forces_vs_radii.pdf' file '.\Output_3\forces_vs_radii.pdf' file '.\Output_4\forces_vs_radii.pdf' and so on... |
and then run ffmpeg -f concat -i ffmpeg_list_of_files.txt -c copy output.mkv
as is stated at
http://trac.ffmpeg.org/wiki/Concatenate
I, unfortunately, get the error
1 2 3 |
Line 1: unknown keyword ' ■f' .\ffmpeg_list_of_files.txt: Invalid data found when processing input |
in Windows PowerShell in Windows 10.
What am I doing wrong?
Answer:
It’s an encoding problem I also got that I solved changing the file encoding.
Steps to solve it:
- Open the ffmpeg_list_of_files.txt with the notepad, notepad++ or similar
- Change the encoding to UTF-8 without BOM. To do it follow one of the next steps:
- with windows notepad, this is done using the “save as…” option and at the bottom changing the encoding to “UTF-8” and press “save”
- with notepad++ select “encoding” in the main menu and select “encoding with UTF-8 without BOM” and save the file after that
Names could change a little bit depending on the version, but following the steps it’s pretty straight forward.
Note: In my case, when redirecting ls or dir to a file in powershell, the default encoding of the file is USC-2