I am using the following line in Python to compress videos into h265
(in Google Colab).
!ffmpeg -v error -nostats -hwaccel_output_format cuda -i "$input_folder/{filename}" -metadata comment="HEVC{cq}" -c:v hevc_nvenc -preset:v slow -rc vbr -cq 30 -qmin 30 -qmax 30 -b:v 0 2>"$output_folder/logs/{filename} (30).txt" -profile:v main10 -c:a copy "$output_folder/{filename.rpartition('.')[0]} ({cq}).$output_file_type"
I came across a guide that mentions that using some x265-params
would result in better results. Though, using different parameters does not impact output file size nor quality. It is as if I am not using the parameters. Here are some examples of me using the parameters:
!ffmpeg -v error -nostats -hwaccel_output_format cuda -i "$input_folder/{filename}" -metadata comment="HEVC{cq}" -c:v hevc_nvenc -preset:v slow -rc vbr -cq 30 -qmin 30 -qmax 30 -b:v 0 2>"$output_folder/logs/{filename} (30).txt" -profile:v main10 -x265-params bframes=8:psy-rd=1:aq-strength=0.6:deblock=1,1:aq-mode=3 -c:a copy "$output_folder/{filename.rpartition('.')[0]} ({cq}).$output_file_type"
!ffmpeg -v error -nostats -hwaccel_output_format cuda -i "$input_folder/{filename}" -metadata comment="HEVC{cq}" -c:v hevc_nvenc -preset:v slow -rc vbr -cq 30 -qmin 30 -qmax 30 -b:v 0 2>"$output_folder/logs/{filename} (30).txt" -profile:v main10 -x265-params limit-sao:bframes=8:psy-rd=1:aq-mode=3 -c:a copy "$output_folder/{filename.rpartition('.')[0]} ({cq}).$output_file_type"
!ffmpeg -v error -nostats -hwaccel_output_format cuda -i "$input_folder/{filename}" -metadata comment="HEVC{cq}" -c:v hevc_nvenc -preset:v slow -rc vbr -cq 30 -qmin 30 -qmax 30 -b:v 0 2>"$output_folder/logs/{filename} (30).txt" -profile:v main10 -x265-params bframes=8:psy-rd=1:aq-mode=3 -c:a copy "$output_folder/{filename.rpartition('.')[0]} ({cq}).$output_file_type"
Would appreciate any information regarding this issue.
x265-params
parameters ignored onhevc_nvenc
? I actually tried using the CPU on Google Colab (libx265 encoder) but after around 2 hours the the process of encoding was still going for a small file of 500mb size. Not sure if this is supposed to take more than 2 hours.x265-params
is relevant only with-c:v libx265
, a software H.265 encoder,hevc_nvenc
is a nVidia GPU-based H.265 encoder.