Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I'm trying to concat multiple videos with ffmpeg, im using a text file as input but im getting "Files.txt: Invalid data found when processing input".
My command:
ffmpeg -i Files.txt -filter_complex "[0:v]fps=25,format=yuv420p,setpts=PTS-STARTPTS[v0];[0:a]aformat=sample_rates=44100:channel_layouts=stereo,asetpts=PTS-STARTPTS[a0];[1:v]fps=25,format=yuv420p,setpts=PTS-STARTPTS[v1];[1:a]aformat=sample_rates=44100:channel_layouts=stereo,asetpts=PTS-STARTPTS[a1];[v0][a0][v1][a1]concat=n=2:v=1:a=1" -movflags +faststart output.mp4
My text file:
file '1.mp4'
file '2.mp4'
Only the concat demuxer accepts a text file list
Either use the concat demuxer:
ffmpeg -f concat -i input.txt output.mp4
Or list the inputs normally and use the concat filter:
ffmpeg -i 1.mp4 -i 2.mp4 -filter_complex "[0:v]fps=25,format=yuv420p,setpts=PTS-STARTPTS[v0];[0:a]aformat=sample_rates=44100:channel_layouts=stereo,asetpts=PTS-STARTPTS[a0];[1:v]fps=25,format=yuv420p,setpts=PTS-STARTPTS[v1];[1:a]aformat=sample_rates=44100:channel_layouts=stereo,asetpts=PTS-STARTPTS[a1];[v0][a0][v1][a1]concat=n=2:v=1:a=1" -movflags +faststart output.mp4
You can't use a text file listing inputs unless you use the concat demuxer as shown above, or if you use some capability in your shell to interpret the list as inputs. ffmpeg
has no such feature.
–
–
–
–
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.