Skip to content

Instantly share code, notes, and snippets.

@ctrlcctrlv
Created January 27, 2022 10:00
Show Gist options
  • Select an option

  • Save ctrlcctrlv/40d4f25f54358241373ae2fff2910af3 to your computer and use it in GitHub Desktop.

Select an option

Save ctrlcctrlv/40d4f25f54358241373ae2fff2910af3 to your computer and use it in GitHub Desktop.
Generate Hellworld Dispatch episode
#!/bin/bash
# Generate Hellworld Dispatch episode
EP=$1
# Height of the video frames we tell ffmpeg to generate. We cut off bottom half to make mountains.
WAVESHEIGHT=512
# lol if u don't have an NVIDIA card remove prime-run and the nvidia wankery
NVIDIA_ARGS='-vsync 0 -hwaccel cuda -hwaccel_output_format cuda'
NVIDIA_RUNNER=prime-run
$NVIDIA_RUNNER ffmpeg $NVIDIA_ARGS -y -i ep$EP.flac -loop 1 -i ep$EP-title.png -filter_complex \
"[0:a]showwaves=s=1920x${WAVESHEIGHT}:mode=cline:colors=#a1c398[waves]; \
[1:v]scale=1920:1080[bg]; \
[bg][waves]overlay=shortest=1:y="$((1080-($WAVESHEIGHT/2)))":format=auto,format=yuv420p" \
-map 0:a -c:v h264_nvenc -preset fast -b:v 1M -c:a aac -b:a 192k ep$EP.mkv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment