Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ffmpeg concat command error

I am trying to concatenate two video files using ffmpeg, and I am receiving an error.

To eliminate compatibility issues between the two videos, I have been concatenating the same video with itself, and the same error persists.

ffmpeg \
  -f concat \
  -safe 0 \
  -i intro_prepped.avi intro_prepped.avi \
  -c copy \
  concat.avi  

And the error output I receive is....

[concat @ 0x220d420] Line 1: unknown keyword 'RIFFf�?' intro_prepped.avi: Invalid data found when processing input

I have tried various combinations of concat flags and have not been able to get it to work. Has anyone seen this error before?

like image 478
Scorb Avatar asked Jun 20 '17 01:06

Scorb


People also ask

How do I concatenate in ffmpeg?

There are two methods within ffmpeg that can be used to concatenate files of the same type: the concat ''demuxer'' the concat ''protocol''


2 Answers

Docs for several ways of concatenating files: https://trac.ffmpeg.org/wiki/Concatenate

Here's a command I use to concatenate videos:

ffmpeg \
  -i "concat:input1.avi|input2.avi|input3.avi" \
  -c:a copy \
  -c:v copy \
  output.avi
like image 186
mdasari Avatar answered Oct 08 '22 19:10

mdasari


This is a bit late for the original post, but I was just searching for answers to the same problem so I think it's still relevant and I haven't found any more recent posts answering the same problem.

I found that my .txt file was encoded wrong. I opened the file in Notepad and did a 'Save As...' I changed the encoding to UTF-8 and the ffmpeg concat command worked.

like image 39
KogaWolf Avatar answered Oct 08 '22 18:10

KogaWolf