From 304c7c3c0ed42e37c09bcf6eaca88f2b510746be Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Thu, 30 Sep 2021 10:15:51 +0200 Subject: [PATCH] Add gource-nvenc-screenless scripts Signed-off-by: Bensuperpc --- Commands.md | 9 +++++ video/gource-nvenc-screenless.sh | 64 ++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 video/gource-nvenc-screenless.sh diff --git a/Commands.md b/Commands.md index aae31af..8ac7714 100644 --- a/Commands.md +++ b/Commands.md @@ -145,6 +145,7 @@ For encoding, creating, recording or downloading videos - [`screen-capture`](#screen-capture) - [`screen-capture-webcam`](#screen-capture-webcam) - [`gource-nvenc`](#gource-nvenc) + - [`gource-nvenc-screenless`](#gource-nvenc-screenless) - [`gource-h265`](#gource-h265) - [`h265-nvenc`](#h265-nvenc) - [`merge-audio-video`](#merge-audio-video) @@ -822,6 +823,14 @@ Generate video with all commit and repository evolution (with nvenc) $ gource-nvenc ``` +### gource-nvenc-screenless + +Generate video with all commit and repository evolution in CLI, without screen (with nvenc and xvfb-run) + +```bash +$ gource-nvenc-screenless +``` + ### gource-h265 Generate video with all commit and repository evolution (with H265) diff --git a/video/gource-nvenc-screenless.sh b/video/gource-nvenc-screenless.sh new file mode 100644 index 0000000..e390726 --- /dev/null +++ b/video/gource-nvenc-screenless.sh @@ -0,0 +1,64 @@ +#!/usr/bin/env bash +#////////////////////////////////////////////////////////////// +#// ____ // +#// | __ ) ___ _ __ ___ _ _ _ __ ___ _ __ _ __ ___ // +#// | _ \ / _ \ '_ \/ __| | | | '_ \ / _ \ '__| '_ \ / __| // +#// | |_) | __/ | | \__ \ |_| | |_) | __/ | | |_) | (__ // +#// |____/ \___|_| |_|___/\__,_| .__/ \___|_| | .__/ \___| // +#// |_| |_| // +#////////////////////////////////////////////////////////////// +#// // +#// Script, 2021 // +#// Created: 30, September, 2021 // +#// Modified: 30, September, 2021 // +#// file: - // +#// - // +#// Source: https://gist.github.com/rafi/365926 // +#// https://github.com/acaudwell/Gource/issues/137 // +#// OS: ALL // +#// CPU: ALL // +#// // +#////////////////////////////////////////////////////////////// + +# 720p: 1280x720x24 +# 1080p: 1920x1080x24 +# 2K: 2560x1440x24 +# 4K: 3840x2160x24 +# 5ΔΈ: 4800x2700x24 # Not tested +# 8K: 7680x4320x24 # 30fps (On nvidia ampere) + +# -2560x1440 # If not --fullscreen # --date-format "%Y-%m-%d" --elasticity 0.1 --max-user-speed 500 +# FFMPEG -pix_fmt yuv420p yuvj420p rgb0 + +if (($# == 1)); then +git_url=$(git config --get remote.origin.url) +xvfb-run -a -s "-screen 0 3840x2160x24" \ + gource \ + --stop-at-end \ + --fullscreen \ + --multi-sampling \ + --seconds-per-day 0.1 \ + --highlight-users \ + --max-files 0 \ + --auto-skip-seconds 0.1 \ + --background-colour 000000 \ + --bloom-multiplier 0.8 \ + --key \ + --filename-time 2 \ + --file-idle-time 0 \ + --output-framerate 60 \ + --hide mouse \ + --file-extension-fallback \ + --path . \ + --output-ppm-stream - \ + --title "$git_url" \ + | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - \ + -vcodec hevc_nvenc -pix_fmt rgb0 \ + -bf:v 3 -rc-lookahead:v 32 -refs:v 16 -b_ref_mode:v middle \ + -preset:v p7 -tune:v hq \ + -rc:v vbr -cq:v 10 -b:v 0 \ + -minrate:v 1M -maxrate:v 800M -bufsize:v 800M "$1" +else + echo "Usage: ${0##*/} " + exit 1 +fi