Update vid compression scripts
This commit is contained in:
@@ -23,7 +23,7 @@ else
|
||||
NORMAL=""
|
||||
fi
|
||||
|
||||
if [[ $1 == "" ]]; then
|
||||
if [[ $1 == "" || $2 == "" ]]; then
|
||||
printf "${BOLD}${RED}Usage: $0 <use-gpu (1|0)> <crf value> <filename> <optional output name>\n\nIf you want to encode a range of CRF values then use -1 as the crf value.${NORMAL}\n"
|
||||
exit 1
|
||||
fi
|
||||
@@ -49,7 +49,14 @@ function encode() {
|
||||
|
||||
if [[ $use_gpu -eq 1 ]]; then
|
||||
# File will be slightly larger than CPU encoding, but it's much faster to transcode and doesn't max out the CPU cores.
|
||||
ffmpeg -y -vsync 0 -hwaccel cuvid -c:v h264_cuvid -i "$filename.$extension" -c:a copy -c:v h264_nvenc -profile:v high -rc:v vbr_hq -cq:v $crf -b:v 5M -maxrate 5M -max_muxing_queue_size 9999 "$output"
|
||||
|
||||
#ffmpeg version N-103152-gef54590f83-20210806
|
||||
# This version of ffmpeg results in larger files than version 4.3.1 command below.
|
||||
#ffmpeg -y -stats -loglevel level+error -vsync 0 -hwaccel_output_format cuda -c:v h264_cuvid -i "$filename.$extension" -c:a copy -c:v h264_nvenc -profile:v high -rc:v vbr -cq:v $crf -b:v 5M -maxrate 5M -max_muxing_queue_size 9999 "$output"
|
||||
|
||||
#ffmpeg version 4.3.1-2020-11-08
|
||||
ffmpeg -y -stats -loglevel level+error -vsync 0 -hwaccel cuvid -c:v h264_cuvid -i "$filename.$extension" -c:a copy -c:v h264_nvenc -profile:v high -rc:v vbr_hq -cq:v $crf -b:v 5M -maxrate 5M -max_muxing_queue_size 9999 "$output"
|
||||
|
||||
else
|
||||
ffmpeg -i "$filename.$extension" -c:v libx264 -crf $crf -preset veryfast -profile:v baseline -level 3.0 -strict -2 "$output"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user