I'm trying to convert my h264 video into hevc file and maximize my graphics card to encode.
The original h264 file size is 99.2MB
For the CPU command, I use
ffmpeg -hwaccel cuda -i input.mp4 -c:v libx265 test1.mp4
test1.mp4 is 76.1MB
For the GPU command, I use
ffmpeg -hwaccel cuda -i input.mp4 -c:v hevc_nvenc test2.mp4
test2.mp4 is 540MB
But I found the bitrate for test1.mp4 is 262kb/s and for test2.mp4 is 1864kb/s, my original is 342kb/s
Why the bitrate for default nvenc encoder is much larger than libx265 encoder?
What's the command for nvenc encoder to imitate libx265 default behavior?
+ Reply to Thread
Results 1 to 8 of 8
-
-
Different encoders have different defaults. And different encoders have different abilities. So you can't expect different encoders to deliver the same file size (bitrate) by default. If you adjust the settings to get the same size the quality will not be the same. And even if you adjust the settings so that the encoders deliver the same size/quality for a particular video, they may not deliver the same size/quality with a different video.
I don't use nvnec so I can't give you specific recommendations for it. But if you want the same bitrate (and hence size) you can always use bitrate based encoding and specify the same bitrate. -
You could try something like this and adjust the compression (and quality) with the -cq xx parameter:
Code:ffmpeg.exe -i input.mp4 -c:v h264_nvenc -preset:v bd -profile:v high -level 41 -2pass 1 -maxrate 40000k -bufsize 30000k -b:v 0k -cq 22 -refs:v 0 -bf 3 -rc vbr_hq -b_adapt 1 -rc-lookahead 32 -nonref_p 1 -b_ref_mode 2 -pix_fmt yuv420p "output.mp4"
Ooops, I just noted that you want x265 rather than x264. I have little experience with x265 settings, so I can't really help.... -
did as instructed. no good.
[h264_nvenc @ 000001a6ae8f58c0] The selected preset is deprecated. Use p1 to p7 + -tune or fast/medium/slow.
[h264_nvenc @ 000001a6ae8f58c0] Specified rc mode is deprecated.
[h264_nvenc @ 000001a6ae8f58c0] Use -rc constqp/cbr/vbr, -tune and -multipass instead.
[h264_nvenc @ 000001a6ae8f58c0] InitializeEncoder failed: invalid param (8): Presets P1 to P7 are not supported with older 2 Pass RC Modes(CBR_HQ, VBR_HQ) and cbr lowdelay.
Enable NV_ENC_RC_PARAMS::multiPass flag for two pass encoding a
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[aac @ 000001a6ae8f7c80] Qavg: 30008.844
[aac @ 000001a6ae8f7c80] 2 frames left in the queue on closing
Conversion failed!
[Attachment 61440 - Click to enlarge] -
ffmpeg -y -hwaccel cuda -i "input.mp4" -c:v hevc_nvenc -b:v 250k -c:a aac -b:a 96k "output.mp4"
ffmpeg -y -hwaccel cuda -i "input.mp4" -c:v hevc_nvenc -preset p6 -b:v 0 -cq 24 -qmin 22 -qmax 26 -c:a copy output.mp4
-c:s specifies to copy the subtitle
-b:v must be set to 0 for -cq to work
-cq x specifies the quality you're aiming for, not quite crf but treat it similarly
-qmin and -qmax may be used to give extra headroom for lower and higher bitrates if needed for less or more complex scenes respectively but can be left outLast edited by blud7; 25th Oct 2021 at 08:52.
-
My question is why convert the original h264 file to h265, you will gain nothing.
-
Similar Threads
-
ffmpeg how modify the contrast with nvidia “hevc_nvenc” codec
By marco000 in forum Video ConversionReplies: 15Last Post: 12th Jun 2021, 12:34 -
crf wit hevc_nvenc in ffmpeg?
By mathias_freire in forum Video ConversionReplies: 5Last Post: 4th Dec 2020, 01:55 -
FFMPEG - hevc_nvenc & h264_nvenc lossless presets not truly lossless?
By AnomalyDetected in forum Video ConversionReplies: 5Last Post: 27th Oct 2019, 02:24 -
Ffmpeg — Specific of libx265
By Drag in forum EditingReplies: 2Last Post: 13th Oct 2018, 07:30 -
XviD4PSP 7.0.390 Daily and past versions problem cannot open libx265 encode
By brandonba in forum Newbie / General discussionsReplies: 0Last Post: 12th Jun 2017, 15:03