Skip to content

Instantly share code, notes, and snippets.

@kfigiela
Created October 21, 2013 10:53
Show Gist options
  • Save kfigiela/7081994 to your computer and use it in GitHub Desktop.
Save kfigiela/7081994 to your computer and use it in GitHub Desktop.
ffmpeg timelapse / image sequence with video fade in and fade out and audio fade out commandline
ffmpeg -r 20 # input frame rate \
-i "%05d.JPG" # input file pattern \
-i audio.mp3 # input audio file \
-af "afade=t=out:st=132:d=4" # fade out audio for 4 seconds starting at 132 second \
-vf "fade=in:0:40, fade=out:2694:40" # fade in video in first 40 frames, then fade out for 40 frames starting at frame 2694 \
-r 30 # out frame rate is 30s (in that way youtube allows hd movies) \
-s 1280x720 # resize video to hd-ready res \
-vcodec libx264 -threads 4 -profile:v main -preset fast # video encoding settings \
-shortest # output file length should be of shortest input file length (usually audio file will be longer, so we fade out and cut) \
output.mp4 #output file name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment