Skip to content
Advertisement

Concat multiple (self-generated) videos using ffmpeg on raspbian linux

I am a very talented sleep talker, so I decided to write a solution that records the things I talk at night to make funny videos with subtitles of it. The project is nearly done, but I got a big problem with concating videos I generated before.

The video parts are generated from single png frames using this command:

JavaScript

Then the sound is added using this command (got this from #9049970 and #11779490):

JavaScript

All this is causing no problems so far, but I think it may be relevant to know how the videos are generated. I can watch all this and get valid video and sound – the full source code of this first part can be found here.

Now I added a feature that is able to generate “full videos” containing a title and a various number of previously generated “video parts” using this command:

JavaScript

But something is wrong with it and I get this error:

JavaScript

The full output is:

JavaScript

I also wrote a test case so you can reproduce this on your local machine. Download the files from my dropbox. Also, the full script that renders the “final move” can be found here.

Would be great to get an Idea, got struggle to fix this the last two days.

Advertisement

Answer

You’re using both the concat demuxer as well as the concat filter. Skip the latter, because

a) it’s unnecessary and

b) I don’t believe the demuxer is inducting all input files as separate inputs so the indices beyond 0 don’t make sense. Also, the concat filter needs equal number of streams per input file, and their input assignment has to be pair-wise i.e. [0:v:0] [0:a:0] [1:v:0] [1:a:0] [2:v:0] [2:a:0]....

Instead, use

JavaScript

where ${video_list_textfile} is a text file of the form

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement