|
| 1 | +#!/usr/bin/env bash |
| 2 | +#////////////////////////////////////////////////////////////// |
| 3 | +#// ____ // |
| 4 | +#// | __ ) ___ _ __ ___ _ _ _ __ ___ _ __ _ __ ___ // |
| 5 | +#// | _ \ / _ \ '_ \/ __| | | | '_ \ / _ \ '__| '_ \ / __| // |
| 6 | +#// | |_) | __/ | | \__ \ |_| | |_) | __/ | | |_) | (__ // |
| 7 | +#// |____/ \___|_| |_|___/\__,_| .__/ \___|_| | .__/ \___| // |
| 8 | +#// |_| |_| // |
| 9 | +#////////////////////////////////////////////////////////////// |
| 10 | +#// // |
| 11 | +#// Script, 2021 // |
| 12 | +#// Created: 30, September, 2021 // |
| 13 | +#// Modified: 30, September, 2021 // |
| 14 | +#// file: - // |
| 15 | +#// - // |
| 16 | +#// Source: https://gist.github.com/rafi/365926 // |
| 17 | +#// https://github.com/acaudwell/Gource/issues/137 // |
| 18 | +#// OS: ALL // |
| 19 | +#// CPU: ALL // |
| 20 | +#// // |
| 21 | +#////////////////////////////////////////////////////////////// |
| 22 | + |
| 23 | +# 720p: 1280x720x24 |
| 24 | +# 1080p: 1920x1080x24 |
| 25 | +# 2K: 2560x1440x24 |
| 26 | +# 4K: 3840x2160x24 |
| 27 | +# 5ĸ: 4800x2700x24 # Not tested |
| 28 | +# 8K: 7680x4320x24 # 30fps (On nvidia ampere) |
| 29 | + |
| 30 | +# -2560x1440 # If not --fullscreen # --date-format "%Y-%m-%d" --elasticity 0.1 --max-user-speed 500 |
| 31 | +# FFMPEG -pix_fmt yuv420p yuvj420p rgb0 |
| 32 | + |
| 33 | +if (($# == 1)); then |
| 34 | +git_url=$(git config --get remote.origin.url) |
| 35 | +xvfb-run -a -s "-screen 0 3840x2160x24" \ |
| 36 | + gource \ |
| 37 | + --stop-at-end \ |
| 38 | + --fullscreen \ |
| 39 | + --multi-sampling \ |
| 40 | + --seconds-per-day 0.1 \ |
| 41 | + --highlight-users \ |
| 42 | + --max-files 0 \ |
| 43 | + --auto-skip-seconds 0.1 \ |
| 44 | + --background-colour 000000 \ |
| 45 | + --bloom-multiplier 0.8 \ |
| 46 | + --key \ |
| 47 | + --filename-time 2 \ |
| 48 | + --file-idle-time 0 \ |
| 49 | + --output-framerate 60 \ |
| 50 | + --hide mouse \ |
| 51 | + --file-extension-fallback \ |
| 52 | + --path . \ |
| 53 | + --output-ppm-stream - \ |
| 54 | + --title "$git_url" \ |
| 55 | + | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - \ |
| 56 | + -vcodec hevc_nvenc -pix_fmt rgb0 \ |
| 57 | + -bf:v 3 -rc-lookahead:v 32 -refs:v 16 -b_ref_mode:v middle \ |
| 58 | + -preset:v p7 -tune:v hq \ |
| 59 | + -rc:v vbr -cq:v 10 -b:v 0 \ |
| 60 | + -minrate:v 1M -maxrate:v 800M -bufsize:v 800M "$1" |
| 61 | +else |
| 62 | + echo "Usage: ${0##*/} <ouput file>" |
| 63 | + exit 1 |
| 64 | +fi |
0 commit comments