0

Sorry for this silly question, but I hardly understand the mapping of input files in ffmpeg.

I use fading effect for a slideshow and a single audio file as

ffmpeg -loop 1 -i image.png -i 1.mp3 -i 2.mp3 -i 3.mp3 -i 4.mp3 -i 5.mp3 \ 
-filter_complex 'concat=n=5:v=0:a=1' -c:v libx264 -tune stillimage \
-c:a aac -vf format=yuv420p -r 25 -shortest out.mp4

How can I create fade in/out effect in the beginning and end of the video?

llogan
  • 63,280
Googlebot
  • 1,082

1 Answers1

1

Use the fade and afade filters. Assuming the output duration is 100 seconds:

ffmpeg -loop 1 -framerate 25 -i image.png -i 1.mp3 -i 2.mp3 -i 3.mp3 -i 4.mp3 -i 5.mp3 -filter_complex "[0]fade=t=in:d=1,fade=t=out:d=1:st=99,format=yuv420p[v];[1:a][2:a][3:a][4:a][5:a]concat=n=5:v=0:a=1,afade=t=in:d=1,afade=t=out:d=1:st=99[a]" -map "[v]" -map "[a]" -c:v libx264 -tune stillimage -c:a aac -shortest -movflags +faststart out.mp4
llogan
  • 63,280