Skip to content

Instantly share code, notes, and snippets.

@kastnerkyle
Last active April 23, 2024 06:22
Show Gist options
  • Save kastnerkyle/d8205ff521dbee3061d9b5ccd3dde8f8 to your computer and use it in GitHub Desktop.
Save kastnerkyle/d8205ff521dbee3061d9b5ccd3dde8f8 to your computer and use it in GitHub Desktop.
Fancy encoding of a wav file (or possibly others in the future) to youtube format
# Based on example here https://trac.ffmpeg.org/wiki/Encode/YouTube
text=$(basename $1 .wav)
ffmpeg -i $1 -filter_complex \
"[0:a]avectorscope=s=640x518,pad=1280:720[vs]; \
[0:a]showspectrum=mode=separate:color=intensity:scale=cbrt:s=640x518[ss]; \
[0:a]showwaves=s=1280x202:mode=line[sw]; \
[vs][ss]overlay=w[bg]; \
[bg][sw]overlay=0:H-h,drawtext=fontfile=/usr/share/fonts/truetype/fonts-japanese-gothic.ttf:fontcolor=white:x=10:y=10:text=$text[out]" \
-map "[out]" -map 0:a -c:v libx264 -preset fast -crf 18 -c:a copy $text.mkv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment