Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid data found when processing input | ffmpeg

Tags:

ffmpeg

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'
like image 288
GoekhanDev Avatar asked Aug 14 '26 11:08

GoekhanDev


1 Answers

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.

like image 113
llogan Avatar answered Aug 17 '26 18:08

llogan