Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between libx264 and h264_nvenc?

I am trying to encode some videos but when I use the libx264 they don't work but change the codec to h264_nvenc and they play.

If I change the profile to baseline when using the libx264 the videos play.

what is the difference? I could use the h264_nvenc but I want to use the libx264 for the better quality for storage.

My code

bin\ffmpeg -i "Input-File" -c:v h264_nvenc -bf 3 -b_strategy 2 -temporal-aq 1 -rc-lookahead 20 -profile:v high -preset slow -rc vbr_hq -rc:v vbr_hq -qmin 0 -cq:v 19 -b:v 900k -maxrate:v 5000k -bufsize 2000K -c:a aac -ar 48000 -b:a 128k "Output-File.mp4"
like image 355
Jonathan Morrall Avatar asked Dec 10 '22 02:12

Jonathan Morrall


1 Answers

h264_nvenc uses the NVidia hardware assisted H.264 video encoder. libx264 is a software (CPU) based H.264 encoder.

I would guess that libx264 delivers better quality than h264_nvenc for the same bitrate.

h264_nvenc is probably faster and uses less power. h264_nvenc is only available on NVIDIA hardware.

like image 86
Markus Schumann Avatar answered Dec 28 '22 10:12

Markus Schumann