I am trying to concatenate several media files. Each file contains video and audio. I need to add black-screen silent frames after each mediafile (except last one).
I mean file + gap + file + gap + file.
I found very useful answer here, but it works for audio only.
Then I changed command. It works too, but with no sound. Here is the command:
ffmpeg -i video-1489396334138.webm -i video-1-1489396340932.webm -i video-1489396346168.webm -f lavfi -i "color=c=black:s=640x480:r=25" \
-filter_complex "
[3]trim=duration=3.932[g0];[3]trim=duration=3.168[g1];
[0][g0][1][g1][2]concat=n=5:v=1:a=0"
output.webm
I know it's because of a=0. But when I change it to a=1, ffmpeg throws an error:
[Parsed_trim_0 @ 0x4448080] Media type mismatch between the 'Parsed_trim_0' filter output pad 0 (video) and the 'Parsed_concat_2' filter input pad 1 (audio)
[AVFilterGraph @ 0x4447600] Cannot create the link trim:0 -> concat:1
Probably that's because our lavfi input does not contain any audio. So, the question is, how to fix that?