0

"crossfade between 2 videos using ffmpeg"

In the above link I found a way to add fade between 2 videos, but losing the audio. How can I do the same without lose the audio?

This is the command line I'm currently using, which is working very well, just losing the audio:

ffmpeg -i in0.mp4 -i in1.mp4 -filter_complex "[0]fade=t=out:st=0:d=1:alpha=1,setpts=PTS-STARTPTS[va0];[1]fade=t=in:st=0:d=1:alpha=1,setpts=PTS-STARTPTS/TB[va1];[va0][va1]overlay[outv]" -map [outv] -crf 10 out.mp4
RLT
  • 3

1 Answers1

1

Use

ffmpeg -i in0.mp4 -i in1.mp4
    -filter_complex
        "[0]fade=t=out:st=0:d=1:alpha=1,setpts=PTS-STARTPTS[va0];
         [1]fade=t=in:st=0:d=1:alpha=1,setpts=PTS-STARTPTS[va1];
         [va0][va1]overlay[outv];
         [0][1]amix[outa]" -map [outv] -map "[outa]" -crf 10 out.mp4
Gyan
  • 38,955