NVENC Quality setting ignored
Added by Michael Weber over 2 years ago
Hello all,
I managed to setup TVheadend with NVENC. I played with the Quality settings (Expert Settings) but this does not affect the recording at all.
In the screenshot you see the quality set to 51 (should be really bad and low filesize) but the quality is fine and Filesize for 20 minutes is ~300MB.
mediainfo original.mkv
General
Unique ID : 157434602280667228123365558247627022546 (0x7670CD2DE44C9B06B3A9D4348511E0D2)
Complete name : original.mkv
Format : Matroska
Format version : Version 4
File size : 306 MiB
Duration : 20 min 45 s
Overall bit rate mode : Variable
Overall bit rate : 2 061 kb/s
Writing application : Lavf59.26.100
Writing library : Lavf59.26.100
ErrorDetectionType : Per level 1
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L3
Format settings : CABAC / 1 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 1 frame
Codec ID : V_MPEG4/ISO/AVC
Duration : 20 min 43 s
Bit rate mode : Variable
Maximum bit rate : 6 000 kb/s
Width : 720 pixels
Height : 576 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 FPS
Standard : PAL
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Default : No
Forced : No
Audio
ID : 2
Format : AAC Main
Format/Info : Advanced Audio Codec
Codec ID : A_AAC-1
Duration : 20 min 45 s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Delay relative to video : -1 s 632 ms
Language : German
Default : No
Forced : No
I think the quality is not working at all. Quality settings passed with -crf are not working for nvenc with my ffmpeg version.
Please find below a original file (recorded with tvheadend and the codec from the screenshot and some command to see the filesize and the ffmpeg command to use low quality with nvenc
root@app01:/var/lib/hts# /opt/ffmpeg/ffmpeg/ffmpeg --version
ffmpeg version N-107315-gc8d839df73 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 10 (Debian 10.2.1-6)
# ls -lah original.mkv
-rw-r--r-- 1 root root 306M 25. Jul 14:07 original.mkv
# ffmpeg -i original.mkv -c:v h264_nvenc -crf 51 -c:a copy /var/lib/hts/crf51.mkv
#ls -lah crf51.mkv
-rw-r--r-- 1 root root 310M 25. Jul 14:12 crf51.mkv
# /opt/ffmpeg/ffmpeg/ffmpeg -i original.mkv -c:v h264_nvenc -cq 51 -c:a copy /var/lib/hts/cq51.mkv
# ls -lah cq51.mkv
-rw-r--r-- 1 root root 25M 25. Jul 14:16 cq51.mkv
Is there a way to switch to -cq parameter for the quality in nvenc?
Best Regards and thank you for your support!
quality.png (35.1 KB) quality.png |