Skip to content

Instantly share code, notes, and snippets.

@kassoulet
Last active March 4, 2021 07:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kassoulet/ef90c6cfa3f936316290d62b9a127f58 to your computer and use it in GitHub Desktop.
Save kassoulet/ef90c6cfa3f936316290d62b9a127f58 to your computer and use it in GitHub Desktop.
# Recompress video, add audio waveform
# usage: ./compress-video-waveform.sh video-source video-destination
videocodec="libx264 -strict -2 -crf 20 -preset slow"
audiocodec="libmp3lame -b:a 320k"
waveform="[0:a]showwaves=s=1920x540:mode=cline:split_channels=1:colors=\#ffffff40|\#ffffff40,format=argb[w];[0:v][w]overlay=(W-w)/2:(H-h)/2[v]"
ffmpeg -y -i $1 -c:v $videocodec -acodec $audiocodec -filter_complex $waveform -map "[v]" -map 0:a $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment