[FFmpeg-user] How to select audio stream in filter_complex with concat?

Dmitri dmitri.peredera at gmail.com
Thu Jul 12 17:23:58 EEST 2018


Hello,

I am trying to merge 3 videos with fade-out and use the audio stream from
the input index 0 in the resulting file (nothing should be played when it
ends)
Video 0 is cut at the beginning, but the original stream is long enough.

This command does the merging, unfortunately the audio is taken from files
1 and 2 when they are playing and 0:a is also cut:

ffmpeg -i "D:\videos\intro_1.mov" -ss 00:00:00 -to 00:00:40 -i
"D:\videos\logo_1.mp4" -i "D:\videos\logo_2.mp4" -filter_complex
"[0:v]fade=t=out:st=37:d=3[0v];[1:v]fade=t=out:st=11:d=1[1v];[2:v]fade=t=out:st=9:d=1[2v];
[0v][0:a][1v][1:a][2v][2:a] concat=n=3:v=1:a=1 [v1][a]" -map "[v1]" -map
"[a]" output.mp4 -y

I've also tried to add same file again and map it's audio stream, but it
gives error:
"Filter concat:out:a0 has an unconnected output"

ffmpeg -i "D:\videos\intro_1.mov" -ss 00:00:00 -to 00:00:40 -i
"D:\videos\logo_1.mp4" -i "D:\videos\logo_2.mp4" -i "D:\videos\intro_1.mov"
-filter_complex
"[0:v]fade=t=out:st=37:d=3[0v];[1:v]fade=t=out:st=11:d=1[1v];[2:v]fade=t=out:st=9:d=1[2v];
[0v][0:a][1v][1:a][2v][2:a] concat=n=3:v=1:a=1 [v1][a]" -map "[v1]" -map
3:1 output.mp4 -y

Feels like I am missing something simple :)

/Best regards


More information about the ffmpeg-user mailing list