Skip to content

Instantly share code, notes, and snippets.

@amureki
Created March 27, 2015 06:33
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save amureki/7fb26fa4dfe87736838c to your computer and use it in GitHub Desktop.
Save amureki/7fb26fa4dfe87736838c to your computer and use it in GitHub Desktop.
# Adds 3-sec fading out title image before video.
# What's going on here: We get title.png image, loop it for 3 sec video, create 3 sec silence, get video.mp4 (framerate 25). Next, we add fade out filter on looped image video, after that we concat our image video, audio silence and main video into one. Easy peasy.
ffmpeg -loop 1 -framerate 25 -t 3 -i title.png -t 3 -f lavfi -i aevalsrc=0 -i video.mp4 -filter_complex '[0:0]fade=out:50:25:alpha=1[title]; [title][1:0][2:0][2:1] concat=n=2:v=1:a=1' output.mp4
@lotaku
Copy link

lotaku commented Mar 24, 2017

Hi,
could you tell me how add image at the end of video ?
Thank You!

@amureki
Copy link
Author

amureki commented Dec 27, 2017

@lotaku hi
Sorry for late answer, @github is not sending notifications on gist comments.
The answer should be pretty simple, I guess, changing the arguments ordering would help you. Just try it out.
I cannot tell you the exact way, this been a long time I touched ffmpeg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment