Skip to content

Instantly share code, notes, and snippets.

@jaxxibae
Last active March 28, 2020 18:58
Show Gist options
  • Save jaxxibae/9e7e08d0b09581db378b6b74b0ed2f0e to your computer and use it in GitHub Desktop.
Save jaxxibae/9e7e08d0b09581db378b6b74b0ed2f0e to your computer and use it in GitHub Desktop.
Gource + FFmpeg configuration
#!/bin/bash
TITLE="Switchblade development (13/05/2018 - 13/07/2019)"
OUTPUT="1920x1080"
FRAMES_PER_SECOND="60"
ICON_LOCATION="./icon.png"
BACKGROUND_COLOR="000000"
SECONDS_PER_DAY="7"
FONT_SIZE="22"
printf "Opening Gource and recording visualization...\n\n"
gource -s .001 -${OUTPUT} -auto-skip-seconds .001 --multi-sampling --stop-at-end --key --highlight-users --hide mouse,progress --seconds-per-day ${SECONDS_PER_DAY} --file-idle-time 0 --max-files 0 --background ${BACKGROUND_COLOR} --font-size ${FONT_SIZE} --logo ${ICON_LOCATION} --title "${TITLE}" --output-ppm-stream gource.ppm --output-framerate ${FRAMES_PER_SECOND}
printf "Recording finished. Encoding file as mp4...\n\n"
ffmpeg -y -r ${FRAMES_PER_SECOND} -f image2pipe -vcodec ppm -i gource.ppm -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 gource.x264.mp4
printf "Encoding finished. Removing original gource.ppm file...\n\n"
rm -rf gource.ppm
printf "Done! File gource.x264.mp4 generated successfully.\n\n"
printf "File specifications:\nTitle: ${TITLE}\nResolution: ${OUTPUT}\nFrames Per Second: ${FRAMES_PER_SECOND}fps"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment