Page 1 of 1

Specifying CABAC Reference Frames - Intel QSV vs. NVEnc

Posted: Fri Feb 01, 2019 3:15 am
by jsb777
Question: When using Intel QSV (H.264), I've observed that a desired number of reference frames for CABAC can be specified by using "ref=<#>" as an extra option. However, when using NVEnc (H.264), this option isn't recognized, and the CABAC reference frame value is always equal to 1 frame.




Steps to reproduce problem: Specifying "ref=<#>" with NVEnc will be treated as an "Unknown avcodec option"




HandBrake version: 1.2.0




Operating system and version: Windows 10 Professional, Version 1803




HandBrake Activity Log:

Code: Select all

HandBrake 1.2.0 (2018121700)
OS: Microsoft Windows NT 10.0.17763.0
Ram: 16323 MB, 
GPU Information:
  NVIDIA GeForce GT 710 - 25.21.14.1771
Screen: 1920x1080
...
[21:49:15] job configuration:
[21:49:15]  * source
[21:49:15]    + <input file>.mkv
[21:49:15]    + title 1, chapter(s) 1 to 10
[21:49:15]    + container: matroska,webm
[21:49:15]    + data rate: 5302 kbps
[21:49:15] mask dilate thread started for segment 2
[21:49:15]  * destination
[21:49:15]    + <output file>.mkv
[21:49:15]    + container: Matroska (libavformat)
[21:49:15]      + chapter markers
[21:49:15]  * video track
[21:49:15]    + decoder: mpeg2video
[21:49:15]    + filters
[21:49:15] mask dilate thread started for segment 3
[21:49:15]      + Comb Detect (mode=3:spatial-metric=2:motion-thresh=1:spatial-thresh=1:filter-mode=2:block-thresh=40:block-width=16:block-height=16)
[21:49:15]      + Decomb (mode=39)
[21:49:15]      + Framerate Shaper (mode=0)
[21:49:15]        + frame rate: same as source (around 29.970 fps)
[21:49:15] mask dilate thread started for segment 4
[21:49:15]      + Crop and Scale (width=720:height=478:crop-top=2:crop-bottom=0:crop-left=0:crop-right=0)
[21:49:15]        + source: 720 * 480, crop (2/0/0/0): 720 * 478, scale: 720 * 478
[21:49:15]    + Output geometry
[21:49:15]      + storage dimensions: 720 x 478
[21:49:15]      + pixel aspect ratio: 8 : 9
[21:49:15]      + display dimensions: 640 x 478
[21:49:15]    + encoder: H.264 (NVEnc)
[21:49:15]      + preset:  slow
[21:49:15]      + options: ref=4
[21:49:15] mask filter thread started for segment 6
[21:49:15]      + profile: auto
[21:49:15]      + level:   auto
[21:49:15]      + quality: 22.00 (CQ)
[21:49:15]      + color profile: 6-1-6
[21:49:15]  * subtitle track 1, English [VOBSUB] (track 0, id 0x2, Picture) -> Passthrough
[21:49:15]  * audio track 1
[21:49:15]    + decoder: English (AC3) (2.0 ch) (track 1, id 0x1)
[21:49:15]      + bitrate: 192 kbps, samplerate: 48000 Hz
[21:49:15]    + mixdown: Stereo
[21:49:15]    + dither: none
[21:49:15] mask dilate thread started for segment 6
[21:49:15]    + encoder: AAC (libavcodec)
[21:49:15]      + bitrate: 160 kbps, samplerate: 48000 Hz
[21:49:15] mask dilate thread started for segment 7
[21:49:15] yadif thread started for segment 0
[21:49:15] yadif thread started for segment 1
[21:49:15] yadif thread started for segment 2
[21:49:15] yadif thread started for segment 3
[21:49:15] yadif thread started for segment 4
[21:49:15] mask erode thread started for segment 4
[21:49:15] yadif thread started for segment 6
[21:49:15] yadif thread started for segment 7
[21:49:15] sync: expecting 174231 video frames
[21:49:15] encavcodecInit: H.264 (Nvidia NVENC)
[21:49:15] encavcodec: encoding at rc=constqp QP 22.00
[21:49:15] encavcodec: encoding with stored aspect 8/9
[21:49:15] encavcodecInit: Unknown avcodec option ref
[21:49:15] sync: first pts video is 0
[21:49:15] sync: "Chapter 1" (1) at frame 1 time 0
[21:49:15] sync: first pts audio 0x1 is 0
[21:49:15] sync: first pts subtitle 0x2 is 84060
[21:49:55] sync: "Chapter 2" (2) at frame 18715 time 56198142
[21:50:29] sync: "Chapter 3" (3) at frame 34705 time 104216112
[21:51:05] sync: "Chapter 4" (4) at frame 52493 time 157633476
[21:51:40] sync: "Chapter 5" (5) at frame 69578 time 208939731
[21:52:15] sync: "Chapter 6" (6) at frame 86953 time 261116856
[21:52:55] sync: "Chapter 7" (7) at frame 106509 time 319843524
[21:53:37] sync: "Chapter 8" (8) at frame 127039 time 381495114
[21:54:06] sync: "Chapter 9" (9) at frame 141295 time 424305882
[21:54:51] sync: "Chapter 10" (10) at frame 162506 time 488002515
[21:55:15] reader: done. 1 scr changes
[21:55:15] work: average encoding speed for job is 484.669891 fps
[21:55:15] comb detect: heavy 57741 | light 7452 | uncombed 109039 | total 174232
[21:55:15] decomb: deinterlaced 57741 | blended 7452 | unfiltered 109039 | total 174232
[21:55:15] vfr: lost time: 0 (0 frames)
[21:55:15] vfr: gained time: 0 (0 frames) (0 not accounted for)
[21:55:15] ac3-decoder done: 181673 frames, 0 decoder errors
[21:55:15] mpeg2video-decoder done: 174232 frames, 0 decoder errors
[21:55:15] sync: got 174232 frames, 174231 expected
[21:55:15] sync: framerate min 29.970 fps, max 29.970 fps, avg 29.970 fps
[21:55:15] mux: track 0, 174232 frames, 1437491656 bytes, 1978.12 kbps, fifo 4096
[21:55:15] mux: track 1, 272510 frames, 117181870 bytes, 161.25 kbps, fifo 8192
[21:55:15] mux: track 2, 1716 frames, 4842356 bytes, 6.66 kbps, fifo 64
[21:55:15] libhb: work result = 0
Thanks for any feedback. I appreciate your time and consideration.

Re: Specifying CABAC Reference Frames - Intel QSV vs. NVEnc

Posted: Fri Feb 01, 2019 3:34 am
by Deleted User 13735
It would be slower to encode with more ref frames.
Nvenc is optimized for speed, above quality I'm afraid.