Skip to content

Instantly share code, notes, and snippets.

@gahan9
Forked from kfigiela/gist:7081994
Created March 22, 2018 10:45
Show Gist options
  • Save gahan9/7087f2d2a7e4a948fe602a97f6ba3f18 to your computer and use it in GitHub Desktop.
Save gahan9/7087f2d2a7e4a948fe602a97f6ba3f18 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