Tweak video compression params
This commit is contained in:
parent
6b23065119
commit
8bc573bfad
|
@ -33,9 +33,9 @@ if [[ $use_gpu == "" || $2 == "" || $output_name == "" ]]; then
|
|||
fi
|
||||
|
||||
# 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
|
||||
use_crf=27
|
||||
use_crf=25
|
||||
fi
|
||||
|
||||
compress-video-with-crf $use_gpu $use_crf "$filename" "$output_name"
|
||||
|
|
|
@ -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.
|
||||
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
|
||||
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
|
||||
printf "\n${GREEN}${BOLD}Finished encoding '$filename.$extension' (CRF $crf) | output name '$output'${NORMAL}\n\n"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user