Tweak video compression params

This commit is contained in:
Michael Campagnaro 2022-06-23 17:15:30 -04:00
parent 6b23065119
commit 8bc573bfad
2 changed files with 3 additions and 3 deletions

View File

@ -33,9 +33,9 @@ if [[ $use_gpu == "" || $2 == "" || $output_name == "" ]]; then
fi fi
# Found the following to work best with vids containing text (e.g. programming vid): 25 for CPU encoding and 27 for GPU. # Found the following to work best with vids containing text (e.g. programming vid): 25 for CPU encoding and 27 for GPU.
use_crf=25 use_crf=21
if [[ $use_gpu -eq 1 ]]; then if [[ $use_gpu -eq 1 ]]; then
use_crf=27 use_crf=25
fi fi
compress-video-with-crf $use_gpu $use_crf "$filename" "$output_name" compress-video-with-crf $use_gpu $use_crf "$filename" "$output_name"

View File

@ -54,7 +54,7 @@ function encode() {
# File will be slightly larger than CPU encoding, but it's much faster to transcode and doesn't max out the CPU cores. # 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 -stats -loglevel level+error $timing_args -vsync 0 -hwaccel cuda -hwaccel_output_format cuda -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 -y -stats -loglevel level+error $timing_args -vsync 0 -hwaccel cuda -hwaccel_output_format cuda -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 else
ffmpeg $timing_args -i "$filename.$extension" -c:v libx264 -crf $crf -preset veryfast -profile:v baseline -level 3.0 -strict -2 "$output" ffmpeg -y -stats -loglevel level+error $timing_args -i "$filename.$extension" -c:v libx264 -crf $crf -preset veryfast -profile:v high -level 3.0 -strict -2 "$output"
fi fi
printf "\n${GREEN}${BOLD}Finished encoding '$filename.$extension' (CRF $crf) | output name '$output'${NORMAL}\n\n" printf "\n${GREEN}${BOLD}Finished encoding '$filename.$extension' (CRF $crf) | output name '$output'${NORMAL}\n\n"
} }