Skip to content

Instantly share code, notes, and snippets.

@geranyl
Created March 18, 2015 18:53
Show Gist options
  • Save geranyl/4383c456fd7446264c94 to your computer and use it in GitHub Desktop.
Save geranyl/4383c456fd7446264c94 to your computer and use it in GitHub Desktop.
FFMPEG fade filter with variables
time=`ffprobe -i 510e_fingerstyle.mp4 -show_frames 2>&1 | grep -c media_type=video` \
filters=(-filter:v "fade=in:0:50,fade=out:$(($time - 50)):50") \
ffmpeg -i 510e_fingerstyle.mp4 "${filters[@]}" -c:v libx264 -crf 22 -preset veryfast -c:a copy output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment