How do you fade video and audio in from and out to back avconv? I have found many posts on how to do this with ffmpeg but non with avconv. The length of the video will change between videos. Is it still possible to fade video and audio in and out and how may I do it?

Below is my current setup:

avconv -loop 1 -i img.jpg -i "song.mp3" -c:v libx264 -tune stillimage -pix_fmt yuv420p -q:a 100 -q:v 0 -s hd1080 -shortest output.mp4

1 Answer 1


I have done this before using the morph option of the amazing 'convert' tool from imagemagick package. It's a very lengthy process, but once you write a script for it, it works flawlessly. (At least for me it was reliable.)

Here are the relevant lines from my scripts (take it as public domain):





convert slide${iii}${imgsuffix} slide${iii_plus_one}${imgsuffix} -delay 5 -morph ${NMORPH} frame%03d${imgsuffix}

mencoder -really-quiet mf://frame*${imgsuffix} -ovc copy -mf fps=${FPS} -vf scale=${videoX}:${videoY} -o slide${iii}_1.avi rm frame???${imgsuffix}

What happens:

  • (not shown in the code above) You extract the last image from the first video as a jpg file (slide001.jpg). You exctract the first image from the second video as a jpg file (slide002.jpg). Or if you want to fade to black/white, replace slide002.jpg with a simple black/white image.

  • Then you morph slide001.jpg to slide002.jpg. This will generate 10 new images that are a mix of the two original images by varying degree of transparency: frame001.jpg, frame002.jpg, frame003.jpg, ...

  • Then you compile the 1+10+1 images as a separate video using mencoder/avconv.

  • (not shown in the code above) You join the videos: first_video + slide001_1.avi + second_video

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .