Skip to content

Commit 7004095

Browse files
committed
Improve NVENC
Signed-off-by: Bensuperpc <[email protected]>
1 parent 220fa68 commit 7004095

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

video/gource-nvenc.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
if (( $# == 1 )); then
2323
#gource --multi-sampling --output-framerate 60 --seconds-per-day 2.0 --auto-skip-seconds 0.1 ./ -1920x1080 -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec hevc_nvenc -preset slow -b:v 64M -maxrate 96M -bufsize 384M $1
2424
gource --multi-sampling --output-framerate 60 --seconds-per-day 1.0 \
25-
--auto-skip-seconds 0.2 ./ -1920x1080 -o - | ffmpeg -y -r 60 \
26-
-f image2pipe -vcodec ppm -i - -vcodec hevc_nvenc -preset:v p7 -tune:v hq -rc:v vbr -cq:v 18 -b:v 0 "$1"
25+
--auto-skip-seconds 0.2 ./ -2560x1440 -o - | ffmpeg -y -r 60 \
26+
-f image2pipe -vcodec ppm -i - -vcodec hevc_nvenc -preset:v p7 -tune:v hq -rc:v vbr -cq:v 18 -b:v 0 -minrate:v 5M -maxrate:v 30M -bufsize:v 120M "$1"
2727
else
2828
echo "Usage: ${0##*/} <ouput file>"
2929
exit 1

video/h265-nvenc.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,23 @@
1010
#// //
1111
#// Script, 2020 //
1212
#// Created: 21, November, 2020 //
13-
#// Modified: 24, July, 2021 //
13+
#// Modified: 26, September, 2021 //
1414
#// file: - //
1515
#// - //
1616
#// Source: https://superuser.com/questions/1236275/how-can-i-use-crf-encoding-with-nvenc-in-ffmpeg/1236387#1236387 //
17+
#// https://superuser.com/questions/1633516/convert-ffmpeg-encoding-from-libx264-to-h264-nvenc/1650962#1650962
1718
#// OS: ALL //
1819
#// CPU: ALL //
1920
#// //
2021
#//////////////////////////////////////////////////////////////
2122

2223
if (( $# == 2 )); then
2324
# Old CUDA version
24-
#ffmpeg -strict 2 -hwaccel auto -i "$1" -c:v hevc_nvenc -preset slow -rc vbr_hq -cq 18 -qmin 16 -qmax 20 -profile:v main10 -b:v 0K -c:a copy -map 0 "$2"
25-
ffmpeg -strict 2 -i "$1" -c:v hevc_nvenc -preset:v p7 -tune:v hq -rc:v vbr -cq:v 18 -b:v 0 -c:a copy -map 0 "$2"
25+
#ffmpeg -threads 0 -strict 2 -hwaccel auto -i "$1" -c:v hevc_nvenc -preset slow -rc vbr_hq -cq 18 -qmin 16 -qmax 20 -profile:v main10 -b:v 0K -c:a copy -map 0 "$2"
26+
#-threads 4 -hwaccel cuvid -c:v h264_cuvid
27+
ffmpeg -strict 2 \
28+
-i "$1" \
29+
-c:v hevc_nvenc -gpu:v 0 \
30+
-preset:v p7 -tune:v hq -rc:v vbr -cq:v 16 -b:v 0 -minrate:v 5M -maxrate:v 30M -bufsize:v 120M \
31+
-c:a copy -map 0 "$2"
2632
fi

0 commit comments

Comments
 (0)