NVidia NVENC encoder with Handbrake CLI

Discussion of the HandBrake command line interface (CLI)
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
AndyA
Posts: 12
Joined: Mon Apr 10, 2017 5:45 pm

NVidia NVENC encoder with Handbrake CLI

Post by AndyA » Sun Feb 10, 2019 7:14 pm

Description of problem or question:

The CLI documentation doesn't list the Nvidia NVEnc option strings for h264/h265. It does show up in the GUI and the difference in encode times between h264 and h264 NVEnc with similar settings is dramatic with my GTX 980 using the GUI.

I looked through some source code and found things like this:
https://github.com/HandBrake/HandBrake/ ... b/common.c

The codecs are referenced as:
"H.264 (NVEnc)", "nvenc_h264"
"H.265 (NVEnc)", "nvenc_h265"

However when I used nvenc_h264 with the --encoder option and got this -
ERROR: Invalid video encoder (nvenc_h264)

Steps to reproduce the problem (If Applicable):

Run handbrake CLI with one of the NVEnc encoders on a Windows 10 machine with a support NVidia video card.

HandBrake version (e.g., 1.0.0):

1.2.0

Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):

Windows 10 1803
NVidia GTX 980 Driver 397.93

HandBrake Activity Log ***required*** (see How-to get an activity log)

[13:24:45] hb_init: starting libhb thread
[13:24:45] thread 2fa5240 started ("libhb")
HandBrake 1.0.3 (2017022500) - MinGW x86_64 - https://handbrake.fr
12 CPUs detected
Opening D:\Movies\MyMovie...
[13:24:45] CPU: Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz
[13:24:45] - Intel microarchitecture Broadwell
[13:24:45] - logical processor count: 12
[13:24:45] Intel Quick Sync Video support: no
[13:24:45] hb_scan: path=D:\Movies\MyMovie), title_index=0

Scanning title 1 of 1, 0.00 %

...

Scanning title 2 of 2, preview 10, 100.00 %[13:24:48] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 140/140/0/0, aspect 16:9, PAR 1:1
[13:24:48] scan: supported video decoders: avcodec qsv
[13:24:48] stream: 5 good frames, 0 errors (0%)
[13:24:48] libhb: scan thread found 2 valid title(s)
Searching for main feature title...
+ Title (0) index 1 has length 6728sec
+ Title (1) index 153 has length 6728sec
Found main feature title 153
+ Using preset: CLI Default
+ title 153:
+ Main Feature
+ playlist: 00357.MPLS
+ duration: 01:52:08
+ size: 1920x1080, pixel aspect: 1/1, display aspect: 1.78, 23.976 fps
+ autocrop: 140/140/0/0
+ support opencl: no
+ chapters:
+ 1: cells 0->0, 0 blocks, duration 00:02:35

...

+ 36: cells 0->0, 0 blocks, duration 00:24:47
+ audio tracks:
+ 1, English (DTS) (5.1 ch) (iso639-2: eng), 48000Hz, 1536000bps
+ 2, English (DTS-HD MA) (5.1 ch) (iso639-2: eng)
+ 3, English (AC3) (5.1 ch) (iso639-2: eng), 48000Hz, 640000bps
+ 4, Francais (DTS) (5.1 ch) (iso639-2: fra), 48000Hz, 1536000bps
+ 5, Francais (DTS-HD MA) (5.1 ch) (iso639-2: fra)
+ 6, Francais (AC3) (5.1 ch) (iso639-2: fra), 48000Hz, 640000bps
+ 7, español (AC3) (5.1 ch) (iso639-2: spa), 48000Hz, 640000bps
+ subtitle tracks:
+ 1, English (iso639-2: eng) (Bitmap)(PGS)
+ 2, English (iso639-2: eng) (Bitmap)(PGS)
+ 3, Francais (iso639-2: fra) (Bitmap)(PGS)
+ 4, español (iso639-2: spa) (Bitmap)(PGS)
+ 5, Francais (iso639-2: fra) (Bitmap)(PGS)
ERROR: Invalid video encoder (nvenc_h264)
Failed to initialize job
HandBrake has exited.
Last edited by AndyA on Sun Feb 10, 2019 11:18 pm, edited 2 times in total.

mduell
Veteran User
Posts: 6329
Joined: Sat Apr 21, 2007 8:54 pm

Re: NVidia NVENC encoder with Handbrake CLI

Post by mduell » Sun Feb 10, 2019 10:15 pm

An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.

Woodstock
Veteran User
Posts: 2925
Joined: Tue Aug 27, 2013 6:39 am

Re: NVidia NVENC encoder with Handbrake CLI

Post by Woodstock » Sun Feb 10, 2019 10:23 pm

The NVENC encoders aren't valid if handbrake doesn't detect the hardware; Your log would show whether or not the hardware is "there" for the software.

AndyA
Posts: 12
Joined: Mon Apr 10, 2017 5:45 pm

Re: NVidia NVENC encoder with Handbrake CLI

Post by AndyA » Sun Feb 10, 2019 11:10 pm

Woodstock the nvenc encoder options are available in the GUI and the documentation says they won't be available if the video card doesn't support it.

https://handbrake.fr/docs/en/latest/tec ... nvenc.html

Not only was it a lot faster using nvenc in the GUI I also saw the GPU usage in the Windows 10 task manager.
Last edited by AndyA on Sun Feb 10, 2019 11:22 pm, edited 3 times in total.

AndyA
Posts: 12
Joined: Mon Apr 10, 2017 5:45 pm

Re: NVidia NVENC encoder with Handbrake CLI

Post by AndyA » Sun Feb 10, 2019 11:15 pm

Mduell that line is the only thing relevant from the log.

mduell
Veteran User
Posts: 6329
Joined: Sat Apr 21, 2007 8:54 pm

Re: NVidia NVENC encoder with Handbrake CLI

Post by mduell » Sun Feb 10, 2019 11:21 pm

HandBrake version (e.g., 1.0.0):

1.2.0

Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):

Windows 10 1803
NVidia GTX 980 Driver 397.93

HandBrake Activity Log ***required*** (see How-to get an activity log)

[13:24:45] hb_init: starting libhb thread
[13:24:45] thread 2fa5240 started ("libhb")
HandBrake 1.0.3 (2017022500) - MinGW x86_64 - https://handbrake.fr
This is exactly why logs are required, and you can get faster and more relevant help by providing them.

You're using the 1.0.3 CLI, which does not support NVENC. Upgrade to the 1.2.0 CLI for NVENC.

AndyA
Posts: 12
Joined: Mon Apr 10, 2017 5:45 pm

Re: NVidia NVENC encoder with Handbrake CLI

Post by AndyA » Sun Feb 10, 2019 11:38 pm

mduell, fair enough! Darnit, what happened was I had downloaded the latest handbrake CLI but put it in a different spot and my script still referenced the old and I didn't realize it. 1.2.0 finds nvenc_h264!

I still might have some trouble with it working, I'm looking at it now.

AndyA
Posts: 12
Joined: Mon Apr 10, 2017 5:45 pm

Re: NVidia NVENC encoder with Handbrake CLI

Post by AndyA » Sun Feb 10, 2019 11:53 pm

Now that I'm using the right CLI version I'm getting this error. First log is the GUI 1.2.0 (works), second is the CLI 1.2.0 (failed).


GUI Log

HandBrake 1.2.0 (2018121700)
OS: Microsoft Windows NT 10.0.17134.0
Ram: 65432 MB,
GPU Information:
NVIDIA GeForce GTX 980 - 24.21.13.9793
Screen: 1920x1200
Temp Dir: C:\Users\andya\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake
Data Dir: C:\Users\andya\AppData\Roaming\HandBrake

-------------------------------------------


# Starting Encode ...

[18:46:27] hb_init: starting libhb thread
[18:46:27] 1 job(s) to process
[18:46:27] json job:
{
"Audio": {
"AudioList": [
{
"Bitrate": 160,
"DRC": 0.0,
"Encoder": "av_aac",
"Gain": 0.0,
"Mixdown": 6,
"NormalizeMixLevel": false,
"Samplerate": 0,
"Track": 0,
"DitherMethod": 0
},
{
"DRC": 0.0,
"Encoder": "copy:ac3",
"Gain": 0.0,
"Mixdown": -1,
"NormalizeMixLevel": false,
"Samplerate": 0,
"Track": 0,
"DitherMethod": 0
}
],
"CopyMask": [
"copy:aac",
"copy:ac3",
"copy:dtshd",
"copy:dts",
"copy:eac3",
"copy:flac",
"copy:mp3",
"copy:truehd"
],
"FallbackEncoder": "ac3"
},
"Destination": {
"ChapterList": [
{
"Name": "Chapter 1"
},

...

],
"ChapterMarkers": true,
"AlignAVStart": false,
"File": "C:\\Users\\andya\\Desktop\\test.mp4",
"Mp4Options": {
"IpodAtom": false,
"Mp4Optimize": false
},
"Mux": "mp4"
},
"Filters": {
"FilterList": [
{
"ID": 4,
"Settings": {
"mode": "7"
}
},
{
"ID": 3,
"Settings": {
"block-height": "16",
"block-thresh": "40",
"block-width": "16",
"filter-mode": "2",
"mode": "3",
"motion-thresh": "1",
"spatial-metric": "2",
"spatial-thresh": "1"
}
},
{
"ID": 11,
"Settings": {
"crop-bottom": "144",
"crop-left": "0",
"crop-right": "0",
"crop-top": "142",
"height": "794",
"width": "1920"
}
},
{
"ID": 6,
"Settings": {
"mode": "2",
"rate": "27000000/900000"
}
}
]
},
"PAR": {
"Num": 1,
"Den": 1
},
"Metadata": {},
"SequenceID": 0,
"Source": {
"Angle": 1,
"Range": {
"Type": "chapter",
"Start": 1,
"End": 1
},
"Title": 1,
"Path": "D:\\Movies\\MyMovie"
},
"Subtitle": {
"Search": {
"Burn": true,
"Default": false,
"Enable": true,
"Forced": true
},
"SubtitleList": []
},
"Video": {
"Encoder": "nvenc_h264",
"Level": "auto",
"TwoPass": false,
"Turbo": false,
"ColorMatrixCode": 0,
"Options": "",
"Preset": "slow",
"Profile": "high",
"Quality": 18.0,
"QSV": {
"Decode": false,
"AsyncDepth": 0
}
}
}
[18:46:27] CPU: Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz
[18:46:27] - Intel microarchitecture Broadwell
[18:46:27] - logical processor count: 12
[18:46:27] Intel Quick Sync Video support: no
[18:46:27] hb_scan: path=D:\Movies\MyMovie, title_index=1
[18:46:27] scan: BD has 19 title(s)
[18:46:27] bd: scanning title 1
[18:46:27] bd: playlist 00000.MPLS
[18:46:27] bd: duration is 03:00:25 (10825689 ms)
[18:46:27] bd: video id=0x1011, stream type=VC-1, format 1080p
[18:46:27] bd: aspect = 16:9
[18:46:27] bd: audio id=0x1100, lang=English (AC3), 3cc=eng

...

[18:46:27] bd: title 1 has 47 chapters
[18:46:27] scan: decoding previews for title 1
[18:46:27] scan: title angle(s) 1
[18:46:27] scan: audio 0x1100: ac3, rate=48000Hz, bitrate=640000 English (AC3) (5.1 ch)
[18:46:27] scan: audio 0x761101: ac3, rate=48000Hz, bitrate=640000 English (AC3) (5.1 ch)
[18:46:27] scan: audio 0x1102: ac3, rate=48000Hz, bitrate=640000 Francais (AC3) (5.1 ch)
[18:46:27] scan: audio 0x1103: ac3, rate=48000Hz, bitrate=640000 Deutsch (AC3) (5.1 ch)
[18:46:27] scan: audio 0x1104: ac3, rate=48000Hz, bitrate=640000 italiano (AC3) (5.1 ch)
[18:46:27] scan: audio 0x1105: ac3, rate=48000Hz, bitrate=640000 español (AC3) (5.1 ch)
[18:46:27] scan: audio 0x1106: ac3, rate=48000Hz, bitrate=192000 English (AC3) (1.0 ch)
[18:46:27] scan: audio 0x721101: truehd, rate=48000Hz, bitrate=128000 English (TrueHD) (5.1 ch)
[18:46:28] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 142/144/0/0, aspect 16:9, PAR 1:1
[18:46:28] stream: 7 good frames, 0 errors (0%)
[18:46:28] libhb: scan thread found 1 valid title(s)
[18:46:28] starting job
[18:46:28] decomb filter thread started for segment 0

...

[18:46:28] mask filter thread started for segment 3
[18:46:28] job configuration:
[18:46:28] * source
[18:46:28] + D:\Movies\MyMovie
[18:46:28] mask filter thread started for segment 4
[18:46:28] + title 1, chapter(s) 1 to 1
[18:46:28] * destination
[18:46:28] + C:\Users\andya\Desktop\test.mp4
[18:46:28] + container: MPEG-4 (libavformat)
[18:46:28] * video track
[18:46:28] + decoder: vc1
[18:46:28] + bitrate 200 kbps
[18:46:28] + filters
[18:46:28] + 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)
[18:46:28] mask filter thread started for segment 5
[18:46:28] + Decomb (mode=39)
[18:46:28] + Framerate Shaper (mode=2:rate=27000000/900000)
[18:46:28] + frame rate: 23.976 fps -> peak rate limited to 30.000 fps
[18:46:28] + Crop and Scale (width=1920:height=794:crop-top=142:crop-bottom=144:crop-left=0:crop-right=0)
[18:46:28] mask filter thread started for segment 6
[18:46:28] + source: 1920 * 1080, crop (142/144/0/0): 1920 * 794, scale: 1920 * 794
[18:46:28] + Output geometry
[18:46:28] + storage dimensions: 1920 x 794
[18:46:28] + pixel aspect ratio: 1 : 1
[18:46:28] + display dimensions: 1920 x 794
[18:46:28] * Foreign Audio Search: Render/Burn-in, Forced Only
[18:46:28] + subtitle, English [PGS] (track 1, id 0x1201, Picture)
[18:46:28] mask filter thread started for segment 7

...

[18:46:28] sync: expecting 6798 video frames
[18:46:32] reader: end of chapter 1 (media 1) reached at media chapter 2
[18:46:32] reader: done. 1 scr changes
[18:46:33] work: average encoding speed for job is 0.000000 fps
[18:46:33] comb detect: heavy 0 | light 0 | uncombed 0 | total 0
[18:46:33] decomb: deinterlaced 0 | blended 0 | unfiltered 0 | total 0
[18:46:33] vfr: 0 frames output, 0 dropped and 0 duped for CFR/PFR
[18:46:33] vfr: lost time: 0 (0 frames)
[18:46:33] vfr: gained time: 0 (0 frames) (0 not accounted for)
[18:46:33] stream: 6800 good frames, 0 errors (0%)
[18:46:33] vc1-decoder done: 0 frames, 0 decoder errors
[18:46:33] sync: got 0 frames, 6798 expected
[18:46:33] Subtitle track 1 (id 0x1201) 'English [PGS]': 22 hits (0 forced)
[18:46:33] No candidate detected during subtitle scan
[18:46:33] starting job
[18:46:33] decomb filter thread started for segment 0

...

[18:46:33] work: only 1 chapter, disabling chapter markers
[18:46:33] job configuration:
[18:46:33] * source
[18:46:33] + D:\Movies\MyMovie
[18:46:33] mask filter thread started for segment 2
[18:46:33] + title 1, chapter(s) 1 to 1
[18:46:33] * destination
[18:46:33] + C:\Users\andya\Desktop\test.mp4
[18:46:33] + container: MPEG-4 (libavformat)
[18:46:33] * video track
[18:46:33] + decoder: vc1
[18:46:33] mask filter thread started for segment 3
[18:46:33] + bitrate 200 kbps
[18:46:33] + filters
[18:46:33] + 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)
[18:46:33] mask filter thread started for segment 4
[18:46:33] + Decomb (mode=39)
[18:46:33] + Framerate Shaper (mode=2:rate=27000000/900000)
[18:46:33] + frame rate: 23.976 fps -> peak rate limited to 30.000 fps
[18:46:33] + Crop and Scale (width=1920:height=794:crop-top=142:crop-bottom=144:crop-left=0:crop-right=0)
[18:46:33] + source: 1920 * 1080, crop (142/144/0/0): 1920 * 794, scale: 1920 * 794
[18:46:33] + Output geometry
[18:46:33] + storage dimensions: 1920 x 794
[18:46:33] + pixel aspect ratio: 1 : 1
[18:46:33] mask filter thread started for segment 5
[18:46:33] + display dimensions: 1920 x 794
[18:46:33] + encoder: H.264 (NVEnc)
[18:46:33] + preset: slow
[18:46:33] + profile: high
[18:46:33] mask filter thread started for segment 6
[18:46:33] + level: auto
[18:46:33] + quality: 18.00 (CQ)
[18:46:33] + color profile: 1-1-1
[18:46:33] * audio track 1
[18:46:33] + decoder: English (AC3) (5.1 ch) (track 1, id 0x1100)
[18:46:33] + bitrate: 640 kbps, samplerate: 48000 Hz
[18:46:33] mask filter thread started for segment 7
[18:46:33] + mixdown: Dolby Pro Logic II
[18:46:33] + dither: none
[18:46:33] + encoder: AAC (libavcodec)
[18:46:33] + bitrate: 160 kbps, samplerate: 48000 Hz
[18:46:33] * audio track 2
[18:46:33] + decoder: English (AC3) (5.1 ch) (track 1, id 0x1100)
[18:46:33] + bitrate: 640 kbps, samplerate: 48000 Hz
[18:46:33] + AC3 Passthru
[18:46:33] mask filter thread started for segment 8

...

[18:46:33] yadif thread started for segment 11
[18:46:33] sync: expecting 6798 video frames
[18:46:33] encavcodecInit: H.264 (Nvidia NVENC)
[18:46:33] encavcodec: encoding at rc=constqp QP 18.00
[18:46:33] encavcodec: encoding with stored aspect 1/1
[18:46:33] sync: first pts video is 0
[18:46:33] sync: "Chapter 1" (1) at frame 1 time 0
[18:46:33] sync: first pts audio 0x1100 is 0
[18:46:33] sync: first pts audio 0x1100 is 0
[18:47:57] reader: end of chapter 1 (media 1) reached at media chapter 2
[18:47:57] reader: done. 1 scr changes
[18:47:57] work: average encoding speed for job is 80.234436 fps
[18:47:58] comb detect: heavy 14 | light 46 | uncombed 6738 | total 6798
[18:47:58] decomb: deinterlaced 14 | blended 46 | unfiltered 6738 | total 6798
[18:47:58] vfr: 6798 frames output, 0 dropped and 0 duped for CFR/PFR
[18:47:58] vfr: lost time: 0 (0 frames)
[18:47:58] vfr: gained time: 0 (0 frames) (0 not accounted for)
[18:47:58] stream: 6800 good frames, 0 errors (0%)
[18:47:58] ac3-decoder done: 8839 frames, 0 decoder errors
[18:47:58] ac3-decoder done: 8839 frames, 0 decoder errors
[18:47:58] vc1-decoder done: 6798 frames, 0 decoder errors
[18:47:58] sync: got 6798 frames, 6798 expected
[18:47:58] sync: framerate min 23.981 fps, max 23.981 fps, avg 23.976 fps
[aac @ 000001d872466740] Qavg: 4502.812
[18:47:58] mux: track 0, 6798 frames, 363249721 bytes, 10249.23 kbps, fifo 512
[18:47:58] mux: track 1, 13259 frames, 5323418 bytes, 150.20 kbps, fifo 1024
[18:47:58] mux: track 2, 8839 frames, 22627840 bytes, 638.45 kbps, fifo 1024
[18:47:58] libhb: work result = 0

# Encode Completed ...



CLI Log



& "C:\Program Files\HandBrakeCLI.exe" --aencoder copy --audio-copy-mask dts,dtshd,eac3,aac,ac3 --audio-fallback ac3 --mixdown 5point1 --ab 768 --
normalize-mix 1 --output "D:\Movies-MKV\Movies\MyMovie - copyaudio.mkv" --markers --format av_mkv --input "D:\Movies\MyMovie" --title 1 --encoder nvenc_h26
4 --quality 18 --encoder-preset slow --encoder-profile high --encoder-level auto --vfr
[18:50:32] hb_init: starting libhb thread
[18:50:32] thread 433e070 started ("libhb")
HandBrake 1.2.0 (2018121700) - MinGW x86_64 - https://handbrake.fr
12 CPUs detected
Opening D:\Movies\MyMovie...
[18:50:32] CPU: Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz
[18:50:32] - Intel microarchitecture Broadwell
[18:50:32] - logical processor count: 12
[18:50:32] Intel Quick Sync Video support: no
[18:50:32] hb_scan: path=D:\Movies\MyMovie, title_index=1
[18:50:32] scan: BD has 19 title(s)
[18:50:32] bd: scanning title 1
[18:50:32] bd: playlist 00000.MPLS
[18:50:32] bd: duration is 03:00:25 (10825689 ms)
[18:50:32] bd: video id=0x1011, stream type=VC-1, format 1080p
[18:50:32] bd: aspect = 16:9
[18:50:32] bd: audio id=0x1100, lang=English (AC3), 3cc=eng

...

[18:50:32] bd: chap 1 packet=960, 283574 ms

...

[18:50:32] bd: title 1 has 47 chapters
[18:50:32] scan: decoding previews for title 1
[18:50:32] scan: title angle(s) 1
[18:50:32] scan: audio 0x1100: ac3, rate=48000Hz, bitrate=640000 English (AC3) (5.1 ch)
[18:50:32] scan: audio 0x761101: ac3, rate=48000Hz, bitrate=640000 English (AC3) (5.1 ch)
[18:50:32] scan: audio 0x1102: ac3, rate=48000Hz, bitrate=640000 Francais (AC3) (5.1 ch)
[18:50:32] scan: audio 0x1103: ac3, rate=48000Hz, bitrate=640000 Deutsch (AC3) (5.1 ch)
[18:50:32] scan: audio 0x1104: ac3, rate=48000Hz, bitrate=640000 italiano (AC3) (5.1 ch)
[18:50:32] scan: audio 0x1105: ac3, rate=48000Hz, bitrate=640000 español (AC3) (5.1 ch)
[18:50:32] scan: audio 0x1106: ac3, rate=48000Hz, bitrate=192000 English (AC3) (1.0 ch)
[18:50:32] scan: audio 0x721101: truehd, rate=48000Hz, bitrate=128000 English (TrueHD) (5.1 ch)
Scanning title 1 of 1, preview 8, 80.00 %[18:50:32] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 142/144/0/0, aspect 16:9, PAR 1:1
[18:50:32] stream: 7 good frames, 0 errors (0%)
[18:50:32] libhb: scan thread found 1 valid title(s)
+ Using preset: CLI Default
+ title 1:
+ playlist: 00000.MPLS
+ duration: 03:00:25
+ size: 1920x1080, pixel aspect: 1/1, display aspect: 1.78, 23.976 fps
+ autocrop: 142/144/0/0
+ chapters:
+ 1: cells 0->0, 0 blocks, duration 00:04:44

...

+ audio tracks:
+ 1, English (AC3) (5.1 ch) (iso639-2: eng), 48000Hz, 640000bps
+ 2, English (AC3) (5.1 ch) (iso639-2: eng), 48000Hz, 640000bps
+ 3, English (TrueHD) (5.1 ch) (iso639-2: eng)
+ 4, Francais (AC3) (5.1 ch) (iso639-2: fra), 48000Hz, 640000bps
+ 5, Deutsch (AC3) (5.1 ch) (iso639-2: deu), 48000Hz, 640000bps
+ 6, italiano (AC3) (5.1 ch) (iso639-2: ita), 48000Hz, 640000bps
+ 7, espa├▒ol (AC3) (5.1 ch) (iso639-2: spa), 48000Hz, 640000bps
+ 8, English (AC3) (1.0 ch) (iso639-2: eng), 48000Hz, 192000bps
+ subtitle tracks:
+ 1, 日本語 [PGS]
+ 2, English [PGS]
+ 3, 日本語 [PGS]
+ 4, Francais [PGS]
+ 5, Deutsch [PGS]
+ 6, italiano [PGS]
+ 7, italiano [PGS]
+ 8, espa├▒ol [PGS]
+ 9, Nederlands [PGS]
+ 10, 한국어 [PGS]
+ 11, espa├▒ol [PGS]
+ 12, Portugues [PGS]
+ 13, dansk [PGS]
+ 14, suomi [PGS]
+ 15, norsk [PGS]
+ 16, polski [PGS]
+ 17, Portugues [PGS]
+ 18, svenska [PGS]
+ 19, 한국어 [PGS]
[18:50:33] 1 job(s) to process
[18:50:33] json job:
{
"Audio": {
"AudioList": [
{
"Bitrate": 0,
"DRC": 0.0,
"Encoder": "copy:ac3",
"Mixdown": "none",
"PresetEncoder": "copy",
"Quality": -3.0,
"Samplerate": 0,
"Track": 0
}
],
"CopyMask": [
"copy:dts",
"copy:dtshd",
"copy:eac3",
"copy:aac",
"copy:ac3"
],
"FallbackEncoder": "ac3"
},
"Destination": {
"AlignAVStart": false,
"ChapterList": [
{
"Name": "Chapter 1"
},

...


],
"ChapterMarkers": true,
"File": "D:\\Movies-MKV\\Movies\\MyMovie - copyaudio.mkv",
"InlineParameterSets": false,
"Mp4Options": {
"IpodAtom": false,
"Mp4Optimize": false
},
"Mux": "mkv"
},
"Filters": {
"FilterList": [
{
"ID": 6,
"Settings": {
"mode": 0
}
},
{
"ID": 11,
"Settings": {
"crop-bottom": 144,
"crop-left": 0,
"crop-right": 0,
"crop-top": 142,
"height": 794,
"width": 1920
}
}
]
},
"Metadata": {},
"PAR": {
"Den": 1,
"Num": 1
},
"SequenceID": 0,
"Source": {
"Angle": 0,
"Path": "D:\\Movies\\MyMovie",
"Range": {
"End": 47,
"Start": 1,
"Type": "chapter"
},
"Title": 1
},
"Subtitle": {
"Search": {
"Burn": true,
"Default": false,
"Enable": false,
"Forced": false
},
"SubtitleList": []
},
"Video": {
"ColorMatrix": 1,
"ColorPrimaries": 1,
"ColorTransfer": 1,
"Encoder": "nvenc_h264",
"Level": "auto",
"Preset": "slow",
"Profile": "high",
"QSV": {
"AsyncDepth": 4,
"Decode": false
},
"Quality": 18.0,
"Turbo": false,
"TwoPass": false
}
}
[18:50:33] starting job
[18:50:33] job configuration:
[18:50:33] * source
[18:50:33] + D:\Movies\MyMovie
[18:50:33] + title 1, chapter(s) 1 to 47
[18:50:33] * destination
[18:50:33] + D:\Movies-MKV\Movies\MyMovie - copyaudio.mkv
[18:50:33] + container: Matroska (libavformat)
[18:50:33] + chapter markers
[18:50:33] * video track
[18:50:33] + decoder: vc1
[18:50:33] + bitrate 200 kbps
[18:50:33] + filters
[18:50:33] + Framerate Shaper (mode=0)
[18:50:33] + frame rate: same as source (around 23.976 fps)
[18:50:33] + Crop and Scale (width=1920:height=794:crop-top=142:crop-bottom=144:crop-left=0:crop-right=0)
[18:50:33] + source: 1920 * 1080, crop (142/144/0/0): 1920 * 794, scale: 1920 * 794
[18:50:33] + Output geometry
[18:50:33] + storage dimensions: 1920 x 794
[18:50:33] + pixel aspect ratio: 1 : 1
[18:50:33] + display dimensions: 1920 x 794
[18:50:33] + encoder: H.264 (NVEnc)
[18:50:33] + preset: slow
[18:50:33] + profile: high
[18:50:33] + level: auto
[18:50:33] + quality: 18.00 (CQ)
[18:50:33] + color profile: 1-1-1
[18:50:33] * audio track 1
[18:50:33] + decoder: English (AC3) (5.1 ch) (track 1, id 0x1100)
[18:50:33] + bitrate: 640 kbps, samplerate: 48000 Hz
[18:50:33] + AC3 Passthru
[18:50:33] sync: expecting 259556 video frames
[18:50:33] encavcodecInit: H.264 (Nvidia NVENC)
[18:50:33] encavcodec: encoding at rc=constqp QP 18.00
[18:50:33] encavcodec: encoding with stored aspect 1/1
Encoding: task 1 of 1, 0.00 %[h264_nvenc @ 0000000006f37240] Failed creating CUDA context for NVENC: 0x3e7
[h264_nvenc @ 0000000006f37240] No NVENC capable devices found
[18:50:33] encavcodecInit: avcodec_open failed
ERROR: Failure to initialise thread 'FFMPEG encoder (libavcodec)'
[18:50:33] vfr: lost time: 0 (0 frames)
[18:50:33] vfr: gained time: 0 (0 frames) (0 not accounted for)
[18:50:33] ac3-decoder done: 0 frames, 0 decoder errors
[18:50:33] vc1-decoder done: 0 frames, 0 decoder errors
[18:50:33] sync: got 0 frames, 259556 expected
Encoding: task 1 of 1, 0.00 %[18:50:33] libhb: work result = 3

Encode failed (error 3).

HandBrake has exited.

Woodstock
Veteran User
Posts: 2925
Joined: Tue Aug 27, 2013 6:39 am

Re: NVidia NVENC encoder with Handbrake CLI

Post by Woodstock » Mon Feb 11, 2019 1:39 am

Code: Select all

[18:50:33] encavcodecInit: H.264 (Nvidia NVENC)
[18:50:33] encavcodec: encoding at rc=constqp QP 18.00
[18:50:33] encavcodec: encoding with stored aspect 1/1
Encoding: task 1 of 1, 0.00 %[h264_nvenc @ 0000000006f37240] Failed creating CUDA context for NVENC: 0x3e7
[h264_nvenc @ 0000000006f37240] No NVENC capable devices found
[18:50:33] encavcodecInit: avcodec_open failed
ERROR: Failure to initialise thread 'FFMPEG encoder (libavcodec)'
The CLI was not able to find your encoder. Are these encodes done on the same computer?

AndyA
Posts: 12
Joined: Mon Apr 10, 2017 5:45 pm

Re: NVidia NVENC encoder with Handbrake CLI

Post by AndyA » Mon Feb 11, 2019 2:40 am

Woodstock, yea both outputs are from the same machine. Both run as non-elevated process.

AndyA
Posts: 12
Joined: Mon Apr 10, 2017 5:45 pm

Re: NVidia NVENC encoder with Handbrake CLI

Post by AndyA » Fri Feb 15, 2019 12:08 am

Phew... Just went through hell lol. I started googling the CLI error and noticed some talk about the nvidia driver so I checked and noticed my drivers were out of date so I updated them... Afterward, my computer wouldn't boot! ugh... Long story short and after a complete rebuild (and up to date nvidia drivers) the CLI is now using NVenc GPU encoder! I'm getting 103 FPS average with high settings! (see below)

--quality 18
--encoder-preset slow
--encoder-profile high
--encoder-level auto

Post Reply