![Nordvpn linux mint](https://cdn1.cdnme.se/5447227/9-3/screenshot_2_64e62946ddf2b36521902657.jpg)
The H264_Nvenc bitrate was about 19% higher than the libx264 encode, but it had a slightly better VMAF score. I had to do quite some digging around the internet to figure out how to properly use it, but finally found a working formula.Ī command like below will record in constant quality, and the CQ value 26 will produce about the same but slightly better quality, measured with VMAF, as a libx264 encode with the following options: -vcodec libx264 -level 4.1 -profile:v high -tune film -preset medium -crf 23. H264_nvenc is able to encode in constant quality, at least from Pascal onwards.
![h264_nvenc ffmpeg h264_nvenc ffmpeg](https://3.bp.blogspot.com/-TBN39tsiSlk/XbdiMa18BKI/AAAAAAAAJhQ/ZerxCdEinl0QNImLjORU75IF-Agf-0cMwCLcBGAsYHQ/s1600/20190211tGmz7Rhg007.png)
Is it possible to achieve near same overall quality (for low bitrate) using h264_nvenc encoder? So I tried: ffmpeg -hwaccel nvdec -y -hide_banner -i input.mp4 -vf scale=-2:480 -movflags faststart -pix_fmt yuv420p -c:v h264_nvenc -b:v 200k -maxrate 2M -bufsize 1M -rc-lookahead:v 30 -rc:v vbr_hq -preset slow -profile:v high -level 5.1 -an h264_nvenc.mp4īut this gives me an output with worse overall quality, and in complex parts, things gets worse:
![h264_nvenc ffmpeg h264_nvenc ffmpeg](https://img-blog.csdnimg.cn/01be02ca699b4c70bb9064d57ed6bc29.png)
This output quality is acceptable for my needs:īut I would like to enjoy hardware acceleration, it is way much faster.
![h264_nvenc ffmpeg h264_nvenc ffmpeg](https://itjo.jp/wp/wp-content/uploads/2017/03/ffmpeg-done1-250x211.png)
I'm compressing some videos for archiving, and I came to this configuration which gives me a nice overall quality on a small size: ffmpeg -threads 4 -y -hide_banner -i input.mp4 -vf scale=-2:480 -c:v libx264 -b:v 200k -preset slow -tune animation -movflags faststart -pix_fmt yuv420p -an -f mp4 -pass 1 NULįfmpeg -threads 4 -y -hide_banner -i input.mp4 -vf scale=-2:480 -c:v libx264 -b:v 200k -preset slow -tune animation -movflags faststart -pix_fmt yuv420p -pass 2 2-pass-x264.mp4
![Nordvpn linux mint](https://cdn1.cdnme.se/5447227/9-3/screenshot_2_64e62946ddf2b36521902657.jpg)