Handbrake: Enable/fix QSV decoding for all QSV-supported codecs.

Created on 26 Aug 2017  路  43Comments  路  Source: HandBrake/HandBrake

Originally titled, Handbrake Nightly 2017082601 does not decode in QSV when encoder is set to H265 QSV

Please describe the problem or feature request in detail:

I have a Kaby Lake & a Skylake computer, which both decode & encode H265 in QSV. However, Handbrake apparently has the decoding of HEVC shut off, even when switches are set to on when encoding HEVC with QSV. Since current & future Intel processors will be capable of this decoding, please unblock the switch to turn this decoding on.

What are the steps to reproduce this problem:

Turn QSV decoding on, and it doesn't work per the logs.

What version of HandBrake you are running:

Nightly 2017082601

What operating system and version and you running (e.g. OSX 10.11, Windows 7, Ubuntu 14):

Windows 10

Was there any error message or error dialog, if so please detail or provide screenshots:

See
"Video": {
"Encoder": 512,
"Level": "auto",
"TwoPass": false,
"Turbo": false,
"ColorMatrixCode": 0,
"Options": "",
"Preset": "balanced",
"Profile": "auto",
"Quality": 29.0,
"HWDecode": false,
"QSV": {
"Decode": true,
"AsyncDepth": 0
}
Then:
decoder hevc, not QSV on another line.
Which should look like: + decoder: hevc_qsv, as it does when going from HEVC to AVC using QSV.

Please provide the full activity log for the encode or scan attempt. You may attach the log as a file, post a pastebin URL to the log, or place the log inline below:

```HandBrake Nightly 20170824075320-f70d349-master (2017082601) - 64bit
OS: Microsoft Windows NT 10.0.15063.0 - 64bit
CPU: Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
Ram: 65189 MB,
GPU Information:
Intel(R) HD Graphics 630 - 22.20.16.4749
Screen: 1600x900
Temp Dir: C:\Users\Me\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake Nightly
Data Dir: C:\Users\Me\AppData\Roaming\HandBrake Team\HandBrake\1.1.0.0


Starting Encode ...

[14:25:48] hb_init: starting libhb thread
[14:25:48] 1 job(s) to process
[14:25:48] json job:
{
"Audio": {
"AudioList": [
{
"Bitrate": 64,
"DRC": 0.0,
"Encoder": 67108864,
"Gain": 1.0,
"Mixdown": 4,
"NormalizeMixLevel": false,
"Samplerate": 0,
"Track": 0,
"DitherMethod": 0
}
],
"CopyMask": [
1073807360,
1073743872,
1074003968,
1073750016,
1090519040,
1074790400,
1074266112,
1107296256
],
"FallbackEncoder": 2048
},
"Destination": {
"ChapterList": [
{
"Name": "Chapter 1"
},
{
"Name": "Chapter 2"
},
{
"Name": "Chapter 3"
},
{
"Name": "Chapter 4"
},
{
"Name": "Chapter 5"
},
{
"Name": "Chapter 6"
},
{
"Name": "Chapter 7"
},
{
"Name": "Chapter 8"
},
{
"Name": "Chapter 9"
}
],
"ChapterMarkers": true,
"AlignAVStart": false,
"File": "C:\Temp1\1080p X265 {preset}.mkv",
"Mp4Options": {
"IpodAtom": false,
"Mp4Optimize": false
},
"Mux": 2097152
},
"Filters": {
"FilterList": [
{
"ID": 11,
"Settings": {
"crop-bottom": "0",
"crop-left": "0",
"crop-right": "0",
"crop-top": "0",
"height": "1080",
"width": "1920"
}
},
{
"ID": 6,
"Settings": {
"mode": "1"
}
}
]
},
"PAR": {
"Num": 1,
"Den": 1
},
"Metadata": {},
"SequenceID": 0,
"Source": {
"Angle": 1,
"Range": {
"Type": "chapter",
"Start": 1,
"End": 9
},
"Title": 1,
"Path": "C:\Temp1\Z\1080p X265.mkv"
},
"Subtitle": {
"Search": {
"Burn": false,
"Default": false,
"Enable": false,
"Forced": false
},
"SubtitleList": [
{
"Burn": false,
"Default": true,
"Forced": false,
"ID": 1,
"Offset": 0,
"Track": 0
}
]
},
"Video": {
"Encoder": 512,
"Level": "auto",
"TwoPass": false,
"Turbo": false,
"ColorMatrixCode": 0,
"Options": "",
"Preset": "balanced",
"Profile": "auto",
"Quality": 29.0,
"HWDecode": false,
"QSV": {
"Decode": true,
"AsyncDepth": 0
}
}
}
[14:25:48] CPU: Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
[14:25:48] - Intel microarchitecture Kaby Lake
[14:25:48] - logical processor count: 8
[14:25:48] Intel Quick Sync Video support: yes
[14:25:48] - Intel Media SDK hardware: API 1.24 (minimum: 1.3)
[14:25:48] - H.264 encoder: yes
[14:25:48] - preferred implementation: hardware (any)
[14:25:48] - capabilities (hardware): breftype icq+la+i+downs vsinfo opt1 opt2+mbbrc+extbrc+trellis+ib_adapt+nmpslice
[14:25:48] - H.265 encoder: yes (8bit: yes, 10bit: yes)
[14:25:48] - preferred implementation: hardware (any)
[14:25:48] - capabilities (hardware): bpyramid vsinfo opt1
[14:25:48] hb_scan: path=C:\Temp1\Z\1080p X265.mkv, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:323: failed opening UDF image C:\Temp1\Z\1080p X265.mkv
src/libbluray/disc/disc.c:424: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:424: error opening file BDMV\BACKUP\index.bdmv
[14:25:48] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.3
libdvdread: Encrypted DVD support unavailable.
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[14:25:48] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from 'C:\Temp1\Z\1080p X265.mkv':
Duration: 01:01:37.15, start: 0.000000, bitrate: N/A
Chapter #0:0: start 0.000000, end 5.547000
Metadata:
title : Chapter 1
Chapter #0:1: start 5.547000, end 435.852000
Metadata:
title : Chapter 2
Chapter #0:2: start 435.852000, end 536.536000
Metadata:
title : Chapter 3
Chapter #0:3: start 536.536000, end 1094.552000
Metadata:
title : Chapter 4
Chapter #0:4: start 1094.552000, end 1726.600000
Metadata:
title : Chapter 5
Chapter #0:5: start 1726.600000, end 2375.623000
Metadata:
title : Chapter 6
Chapter #0:6: start 2375.623000, end 3000.080000
Metadata:
title : Chapter 7
Chapter #0:7: start 3000.080000, end 3632.587000
Metadata:
title : Chapter 8
Chapter #0:8: start 3632.587000, end 3696.735000
Metadata:
title : Chapter 9
Stream #0:0(eng): Audio: aac (HE-AAC)
48000 Hz, 5.1, fltp (default)
Metadata:
title : Surround
Stream #0:1(eng): Subtitle: hdmv_pgs_subtitle (default)
Stream #0:2(eng): Video: hevc (Main 10)
yuv420p10le, tv, 1920x1080, PAR 1:1 DAR 16:9
23.98 fps, 1k tbn (default)
[14:25:48] scan: decoding previews for title 1
[14:25:48] scan: audio 0x0: aac, rate=48000Hz, bitrate=1 English (AAC) (5.1 ch)
[14:25:50] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[14:25:50] libhb: scan thread found 1 valid title(s)
[14:25:50] starting job
[14:25:50] work: compression level not specified, track 1 setting compression level 10.00
[14:25:50] work: track 1, dithering not supported by codec
[14:25:50] job configuration:
[14:25:50] * source
[14:25:50] + C:\Temp1\Z\1080p X265.mkv
[14:25:50] + title 1, chapter(s) 1 to 9
[14:25:50] + container: matroska,webm
[14:25:50] * destination
[14:25:50] + C:\Temp1\1080p X265 {preset}.mkv
[14:25:50] + container: Matroska (libavformat)
[14:25:50] + chapter markers
[14:25:50] * video track
[14:25:50] + decoder: hevc
[14:25:50] + filters
[14:25:50] + Framerate Shaper (mode=1)
[14:25:50] + frame rate: 23.976 fps -> constant 23.976 fps
[14:25:50] + Crop and Scale (width=1920:height=1080:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[14:25:50] + source: 1920 * 1080, crop (0/0/0/0): 1920 * 1080, scale: 1920 * 1080
[14:25:50] + Output geometry
[14:25:50] + storage dimensions: 1920 x 1080
[14:25:50] + pixel aspect ratio: 1 : 1
[14:25:50] + display dimensions: 1920 x 1080
[14:25:50] + encoder: H.265 (Intel Media SDK)
[14:25:50] + preset: balanced
[14:25:50] + profile: auto
[14:25:50] + level: auto
[14:25:50] + quality: 29.00 (QP)
[14:25:50] * subtitle track 1, English [PGS] (track 0, id 0x1, Picture) -> Passthrough, Default
[14:25:50] * audio track 1
[14:25:50] + decoder: English (AAC) (5.1 ch) (track 1, id 0x0)
[14:25:50] + samplerate: 48000 Hz
[14:25:50] + mixdown: Stereo
[14:25:50] + gain: 1dB
[14:25:50] + encoder: Opus (libopus)
[14:25:50] + bitrate: 64 kbps, samplerate: 48000 Hz
[14:25:50] + compression level: 10.00
[14:25:50] sync: expecting 88643 video frames
[14:25:51] encqsvInit: using encode-only path
[14:25:51] encqsvInit: H.265/HEVC Main profile @ level (null)
[14:25:51] encqsvInit: TargetUsage 4 AsyncDepth 5
[14:25:51] encqsvInit: GopRefDist 4 GopPicSize 32 NumRefFrame 3
[14:25:51] encqsvInit: BFramesMax 3 BRefType pyramid
[14:25:51] encqsvInit: RateControlMethod CQP with QPI 29 QPP 31 QPB 33
[14:25:51] sync: first pts video is 0
[14:25:51] sync: "Chapter 1" (1) at frame 1 time 0
[14:25:51] sync: first pts audio 0x0 is 0
[14:25:53] qsv_enc_init: using 'hardware (1)' implementation, API: 1.24
[14:25:55] sync: "Chapter 2" (2) at frame 134 time 499248
[14:25:57] sync: first pts subtitle 0x1 is 960660
[14:28:57] sync: "Chapter 3" (3) at frame 10451 time 39226687
[14:29:47] sync: "Chapter 4" (4) at frame 12867 time 48295747
[14:34:29] sync: "Chapter 5" (5) at frame 26246 time 98517168
[14:43:09] sync: "Chapter 6" (6) at frame 41401 time 155405250

Encode Stopped

[14:43:36] work: average encoding speed for job is 39.917831 fps
[14:43:36] vfr: 42477 frames output, 0 dropped and 0 duped for CFR/PFR
[14:43:36] vfr: lost time: 0 (0 frames)
[14:43:36] vfr: gained time: 0 (0 frames) (0 not accounted for)
[14:43:36] aac-decoder done: 41602 frames, 0 decoder errors
[14:43:36] hevc-decoder done: 42533 frames, 0 decoder errors
[14:43:36] sync: got 42491 frames, 88643 expected
[14:43:36] sync: framerate min 23.981 fps, max 23.981 fps, avg 23.976 fps
[14:43:37] mux: track 0, 42460 frames, 254818300 bytes, 1150.27 kbps, fifo 4096
[14:43:37] mux: track 1, 88610 frames, 12721619 bytes, 57.43 kbps, fifo 8192
[14:43:37] mux: track 2, 526 frames, 6088243 bytes, 27.48 kbps, fifo 64
[14:43:37] libhb: work result = 1

Encode Completed ...

Encode Stopped

```

Bug Upstream Issue

All 43 comments

have some glue where to fix and should check it during next week

are you aware that you do 10bit to 8bits transcode ?

SkyLake should not support hevc 10bits but starting from Kaby Lake

@maximd33

[14:25:51] encqsvInit: H.265/HEVC Main profile @ level (null)

null?

@sr55 ah, a good point - it is a separate issue but I will fix it as well

I have both Skylake & Kaby Lake processors, separately, in 2 computers. This was a Kaby Lake 8 bit QSV encode.

I shall be happy to test your fix. Thank you.

encode is 8bits - correct,
I am more about input file and decode: any option you can dump and share mediainfo details from your input file or the file itself?

I don't have the input file now. I can use a different file with the same characteristics, IE 10bit H265. I am presently running an encode of this example for the log to give you.

This is the MediaInfo of the new file.

General
Unique ID : 233294612142445392710623673785342163614 (0xAF82E86EAF9CFCEFAC40FB269062FA9E)
Complete name : C:\Temp1\1080p 10bit 8CH x265 HEVC.mkv
Format : Matroska
Format version : Version 4 / Version 2
File size : 1.92 GiB
Duration : 1 h 28 min
Overall bit rate : 3 107 kb/s
Movie name : 10bit.8CH.x265.HEVC
Encoded date : UTC 2017-08-30 05:15:46
Writing application : mkvmerge v15.0.0 ('Duel with the Devil') 64-bit
Writing library : libebml v1.3.5 + libmatroska v1.4.5

Video
ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main 10@L4@Main
Codec ID : V_MPEGH/ISO/HEVC
Duration : 1 h 28 min
Width : 1 920 pixels
Height : 1 040 pixels
Display aspect ratio : 1.85:1
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 10 bits
Default : Yes
Forced : No

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : HE-AAC / LC
Codec ID : A_AAC
Duration : 1 h 28 min
Channel(s) : 7 channels
Channel(s)_Original : 8 channels
Channel positions : Front: L C R, Side: L R, Back: L R, LFE
Sampling rate : 48.0 kHz / 24.0 kHz
Frame rate : 23.438 FPS (1024 spf)
Compression mode : Lossy
Delay relative to video : 31 ms
Default : Yes
Forced : No

Text
ID : 3
Format : UTF-8
Codec ID : S_TEXT/UTF8
Codec ID/Info : UTF-8 Plain Text
Language : English
Default : Yes
Forced : No

Menu
00:00:00.000 : :00:00:00.000
00:03:54.400 : :00:03:54.359
00:06:59.000 : :00:06:58.918
00:10:08.600 : :00:10:08.441
00:12:58.800 : :00:12:58.653
00:15:08.800 : :00:15:08.658
00:17:45.000 : :00:17:44.981
00:20:42.800 : :00:20:42.783
00:23:45.400 : :00:23:45.257
00:25:44.800 : :00:25:44.668
00:29:26.400 : :00:29:26.264
00:33:55.800 : :00:33:55.659
00:38:24.200 : :00:38:24.177
00:42:10.200 : :00:42:10.194
00:46:12.200 : :00:46:12.061
00:52:18.000 : :00:52:17.801
00:55:03.000 : :00:55:02.841
00:57:37.800 : :00:57:37.621
01:00:57.600 : :01:00:57.445
01:04:30.200 : :01:04:30.116
01:08:25.000 : :01:08:24.934
01:11:42.200 : :01:11:42.089
01:15:44.400 : :01:15:44.373
01:19:03.400 : :01:19:03.322

Here's the log I spoke of.

HandBrake Nightly 20170909150001-f626271-master (2017091001) - 64bit
OS: Microsoft Windows NT 10.0.15063.0 - 64bit
CPU: Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
Ram: 65189 MB,
GPU Information:
Intel(R) HD Graphics 630 - 22.20.16.4771
Screen: 1600x900
Temp Dir: C:\Users\Me\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake Nightly
Data Dir: C:\Users\Me\AppData\Roaming\HandBrake Team\HandBrake\1.1.0.0


Starting Encode ...

[11:22:41] hb_init: starting libhb thread
[11:22:41] 1 job(s) to process
[11:22:41] json job:
{
"Audio": {
"AudioList": [
{
"Bitrate": 64,
"DRC": 0.0,
"Encoder": 67108864,
"Gain": 1.0,
"Mixdown": 5,
"NormalizeMixLevel": false,
"Samplerate": 0,
"Track": 0,
"DitherMethod": 0
}
],
"CopyMask": [
1073807360,
1073743872,
1074003968,
1073750016,
1090519040,
1074790400,
1074266112,
1107296256
],
"FallbackEncoder": 2048
},
"Destination": {
"ChapterList": [
{
"Name": "00:00:00.000"
},
{
"Name": "00:03:54.359"
},
{
"Name": "00:06:58.918"
},
{
"Name": "00:10:08.441"
},
{
"Name": "00:12:58.653"
},
{
"Name": "00:15:08.658"
},
{
"Name": "00:17:44.981"
},
{
"Name": "00:20:42.783"
},
{
"Name": "00:23:45.257"
},
{
"Name": "00:25:44.668"
},
{
"Name": "00:29:26.264"
},
{
"Name": "00:33:55.659"
},
{
"Name": "00:38:24.177"
},
{
"Name": "00:42:10.194"
},
{
"Name": "00:46:12.061"
},
{
"Name": "00:52:17.801"
},
{
"Name": "00:55:02.841"
},
{
"Name": "00:57:37.621"
},
{
"Name": "01:00:57.445"
},
{
"Name": "01:04:30.116"
},
{
"Name": "01:08:24.934"
},
{
"Name": "01:11:42.089"
},
{
"Name": "01:15:44.373"
},
{
"Name": "01:19:03.322"
}
],
"ChapterMarkers": true,
"AlignAVStart": false,
"File": "C:\Temp1\1080p 10bit 8CH x265 HEVC {preset}.mkv",
"Mp4Options": {
"IpodAtom": false,
"Mp4Optimize": false
},
"Mux": 2097152
},
"Filters": {
"FilterList": [
{
"ID": 11,
"Settings": {
"crop-bottom": "0",
"crop-left": "0",
"crop-right": "0",
"crop-top": "0",
"height": "1040",
"width": "1920"
}
},
{
"ID": 6,
"Settings": {
"mode": "1"
}
}
]
},
"PAR": {
"Num": 1,
"Den": 1
},
"Metadata": {},
"SequenceID": 0,
"Source": {
"Angle": 1,
"Range": {
"Type": "chapter",
"Start": 1,
"End": 24
},
"Title": 1,
"Path": "C:\Temp1\1080p 10bit 8CH x265 HEVC.mkv"
},
"Subtitle": {
"Search": {
"Burn": false,
"Default": false,
"Enable": false,
"Forced": false
},
"SubtitleList": [
{
"Burn": false,
"Default": true,
"Forced": false,
"ID": 1,
"Offset": 0,
"Track": 0
}
]
},
"Video": {
"Encoder": 512,
"Level": "auto",
"TwoPass": false,
"Turbo": false,
"ColorMatrixCode": 0,
"Options": "",
"Preset": "balanced",
"Profile": "auto",
"Quality": 29.0,
"HWDecode": false,
"QSV": {
"Decode": true,
"AsyncDepth": 0
}
}
}
[11:22:41] CPU: Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
[11:22:41] - Intel microarchitecture Kaby Lake
[11:22:41] - logical processor count: 8
[11:22:41] Intel Quick Sync Video support: yes
[11:22:41] - Intel Media SDK hardware: API 1.24 (minimum: 1.3)
[11:22:41] - H.264 encoder: yes
[11:22:41] - preferred implementation: hardware (any)
[11:22:41] - capabilities (hardware): breftype icq+la+i+downs vsinfo opt1 opt2+mbbrc+extbrc+trellis+ib_adapt+nmpslice
[11:22:41] - H.265 encoder: yes (8bit: yes, 10bit: yes)
[11:22:41] - preferred implementation: hardware (any)
[11:22:41] - capabilities (hardware): bpyramid vsinfo opt1
[11:22:41] hb_scan: path=C:\Temp1\1080p 10bit 8CH x265 HEVC.mkv, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:323: failed opening UDF image C:\Temp1\1080p 10bit 8CH x265 HEVC.mkv
src/libbluray/disc/disc.c:424: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:424: error opening file BDMV\BACKUP\index.bdmv
[11:22:41] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.3
libdvdread: Encrypted DVD support unavailable.
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[11:22:41] dvd: not a dvd - trying as a stream/file instead
[matroska,webm @ 0000011e456b4d80] Read error at pos. 2066115623 (0x7b266c27)
Input #0, matroska,webm, from 'C:\Temp1\1080p 10bit 8CH x265 HEVC.mkv':
Metadata:
title : 1080p.10bit.8CH.x265.HEVC
Duration: 01:28:40.35, start: 0.000000, bitrate: N/A
Chapter #0:0: start 0.000000, end 234.400000
Metadata:
title : 00:00:00.000
Chapter #0:1: start 234.400000, end 419.000000
Metadata:
title : 00:03:54.359
Chapter #0:2: start 419.000000, end 608.600000
Metadata:
title : 00:06:58.918
Chapter #0:3: start 608.600000, end 778.800000
Metadata:
title : 00:10:08.441
Chapter #0:4: start 778.800000, end 908.800000
Metadata:
title : 00:12:58.653
Chapter #0:5: start 908.800000, end 1065.000000
Metadata:
title : 00:15:08.658
Chapter #0:6: start 1065.000000, end 1242.800000
Metadata:
title : 00:17:44.981
Chapter #0:7: start 1242.800000, end 1425.400000
Metadata:
title : 00:20:42.783
Chapter #0:8: start 1425.400000, end 1544.800000
Metadata:
title : 00:23:45.257
Chapter #0:9: start 1544.800000, end 1766.400000
Metadata:
title : 00:25:44.668
Chapter #0:10: start 1766.400000, end 2035.800000
Metadata:
title : 00:29:26.264
Chapter #0:11: start 2035.800000, end 2304.200000
Metadata:
title : 00:33:55.659
Chapter #0:12: start 2304.200000, end 2530.200000
Metadata:
title : 00:38:24.177
Chapter #0:13: start 2530.200000, end 2772.200000
Metadata:
title : 00:42:10.194
Chapter #0:14: start 2772.200000, end 3138.000000
Metadata:
title : 00:46:12.061
Chapter #0:15: start 3138.000000, end 3303.000000
Metadata:
title : 00:52:17.801
Chapter #0:16: start 3303.000000, end 3457.800000
Metadata:
title : 00:55:02.841
Chapter #0:17: start 3457.800000, end 3657.600000
Metadata:
title : 00:57:37.621
Chapter #0:18: start 3657.600000, end 3870.200000
Metadata:
title : 01:00:57.445
Chapter #0:19: start 3870.200000, end 4105.000000
Metadata:
title : 01:04:30.116
Chapter #0:20: start 4105.000000, end 4302.200000
Metadata:
title : 01:08:24.934
Chapter #0:21: start 4302.200000, end 4544.400000
Metadata:
title : 01:11:42.089
Chapter #0:22: start 4544.400000, end 4743.400000
Metadata:
title : 01:15:44.373
Chapter #0:23: start 4743.400000, end 5320.400000
Metadata:
title : 01:19:03.322
Stream #0:0: Video: hevc (Main 10)
yuv420p10le, tv, 1920x1040, PAR 1:1 DAR 24:13
23.98 fps, 1k tbn (default)
Stream #0:1: Audio: aac (HE-AAC)
48000 Hz, 7.1(wide), fltp (default)
Stream #0:2(eng): Subtitle: srt (default)
[11:22:41] scan: decoding previews for title 1
[matroska,webm @ 0000011e419bd3e0] Read error at pos. 2066115623 (0x7b266c27)
[11:22:42] scan: audio 0x1: aac, rate=48000Hz, bitrate=1 Unknown (AAC) (7.1 ch)
[matroska,webm @ 0000011e419bd3e0] Read error at pos. 2066038103 (0x7b253d57)
[11:22:42] scan: 10 previews, 1920x1040, 23.976 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[11:22:42] libhb: scan thread found 1 valid title(s)
[11:22:42] starting job
[11:22:42] work: compression level not specified, track 1 setting compression level 10.00
[11:22:42] work: track 1, dithering not supported by codec
[11:22:42] job configuration:
[11:22:42] * source
[11:22:42] + C:\Temp1\1080p 10bit 8CH x265 HEVC.mkv
[11:22:42] + title 1, chapter(s) 1 to 24
[11:22:42] + container: matroska,webm
[11:22:42] * destination
[11:22:42] + C:\Temp1\1080p 10bit 8CH x265 HEVC {preset}.mkv
[11:22:42] + container: Matroska (libavformat)
[11:22:42] + chapter markers
[11:22:42] * video track
[11:22:42] + decoder: hevc
[11:22:42] + filters
[11:22:42] + Framerate Shaper (mode=1)
[11:22:42] + frame rate: 23.976 fps -> constant 23.976 fps
[11:22:42] + Crop and Scale (width=1920:height=1040:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[11:22:42] + source: 1920 * 1040, crop (0/0/0/0): 1920 * 1040, scale: 1920 * 1040
[11:22:42] + Output geometry
[11:22:42] + storage dimensions: 1920 x 1040
[11:22:42] + pixel aspect ratio: 1 : 1
[11:22:42] + display dimensions: 1920 x 1040
[11:22:42] + encoder: H.265 (Intel Media SDK)
[11:22:42] + preset: balanced
[11:22:42] + profile: auto
[11:22:42] + level: auto
[11:22:42] + quality: 29.00 (QP)
[11:22:42] * subtitle track 1, English [UTF-8] (track 0, id 0x2, Text) -> Passthrough, Default
[11:22:42] * audio track 1
[11:22:42] + decoder: Unknown (AAC) (7.1 ch) (track 1, id 0x1)
[11:22:42] + samplerate: 48000 Hz
[11:22:42] + mixdown: Dolby Surround
[11:22:42] + gain: 1dB
[11:22:42] + encoder: Opus (libopus)
[11:22:42] + bitrate: 64 kbps, samplerate: 48000 Hz
[11:22:42] + compression level: 10.00
[matroska,webm @ 0000011e43fc6860] Read error at pos. 2066115623 (0x7b266c27)
[11:22:42] sync: expecting 127560 video frames
[11:22:42] encqsvInit: using encode-only path
[11:22:42] encqsvInit: H.265/HEVC Main profile @ level (null)
[11:22:42] encqsvInit: TargetUsage 4 AsyncDepth 5
[11:22:42] encqsvInit: GopRefDist 4 GopPicSize 32 NumRefFrame 3
[11:22:42] encqsvInit: BFramesMax 3 BRefType pyramid
[11:22:42] encqsvInit: RateControlMethod CQP with QPI 29 QPP 31 QPB 33
[11:22:42] sync: first pts video is 0
[11:22:42] sync: "00:00:00.000" (1) at frame 1 time 0
[11:22:42] sync: first pts audio 0x1 is 2790
[11:22:42] qsv_enc_init: using 'hardware (1)' implementation, API: 1.24
[11:22:46] sync: first pts subtitle 0x2 is 1382310
[11:23:37] sync: "00:03:54.359" (2) at frame 5624 time 21107336
[11:24:21] sync: "00:06:58.918" (3) at frame 10047 time 37710172
[11:25:08] sync: "00:10:08.441" (4) at frame 14593 time 54774720
[11:25:48] sync: "00:12:58.653" (5) at frame 18676 time 70101281
[11:26:20] sync: "00:15:08.658" (6) at frame 21791 time 81794212
[11:26:58] sync: "00:17:44.981" (7) at frame 25539 time 95863267
[11:27:40] sync: "00:20:42.783" (8) at frame 29802 time 111865503
[11:28:15] reader: done. 1 scr changes
[11:28:16] work: average encoding speed for job is 98.754272 fps
[11:28:16] vfr: 32930 frames output, 0 dropped and 1 duped for CFR/PFR
[11:28:16] vfr: lost time: 0 (0 frames)
[11:28:16] vfr: gained time: 0 (0 frames) (0 not accounted for)
[11:28:16] aac-decoder done: 32195 frames, 0 decoder errors
[11:28:16] hevc-decoder done: 32929 frames, 0 decoder errors
[11:28:16] sync: got 32929 frames, 127560 expected
[11:28:16] sync: framerate min 11.905 fps, max 23.981 fps, avg 23.975 fps
[11:28:16] mux: track 0, 32930 frames, 279960737 bytes, 1630.35 kbps, fifo 4096
[11:28:16] mux: track 1, 68683 frames, 10654294 bytes, 62.05 kbps, fifo 8192
[11:28:16] mux: track 2, 464 frames, 24604 bytes, 0.14 kbps, fifo 64
[11:28:16] libhb: work result = 0

Encode Completed ...

thank you for the details: it is clearly HEVC 10bit decode related
which I wanted to validate for quite some time already,
it is important to fix it and will look on it shortly.

8bit HEVC sources are also no QSV decode. It's coincidence that my prior encode attempt was 10bit.

@ZaphodX77 I've checked this already,
let me ask you : when you refer to 8bits content, are you really sure that you did not disabled QSV decode at Tools -> Preferences -> Video -> Disable QuickSync Decoding ?

feel free to share Activity log details for this case.

It is not disabled for QSV. The other codecs setting is.

You're probably right about the 8bit being OK.

@ZaphodX77 thank you for the confirmation

8bit did not work until I enabled the other codecs setting as well as for QSV encodes. I think these hidden switches should be moved to the Codec settings panel for clarity.

Thinking about what we can do before release. Should we have an option to disable QSV decoding when using a QSV encoder, on by default? @sr55 @maximd33

There is already an option to disable QSV decoding in preferences.

My intent in starting this inquiry was to achieve QSV decoding & encoding simultaneously. It currently will fallback or freeze when QSV cannot decode a file. As I've said, having these switches on a page separate from the QSV & Non-QSV encoding settings tab is a bit confusing, and note my comment that the QSV decoding for non-QSV encodes must be set for the QSV decoding to work with the QSV decoding for QSV encodes switch also set. That's probably a bug.

I stand ready to assist in testing any builds for you. I'm receiving notifications from this thread. Thank you.

There is already an option to disable QSV decoding in preferences.

Right, I guess I was confused by the options, and concerned about the number of times we have to tell people to disable QSV decoding when encoding with QSV.

screen shot 2017-12-10 at 12 30 54 pm

Options in the screenshot above:

  • Disable QuickSync Decoding
  • Use QSV Decoding for non QSV encoders.

The first is pretty obvious. The second, I'm not entirely certain, mostly because I'm not certain whether QSV decoding is on by default. Perhaps a combo/select box with the following options would be more clear.

QSV Decoding:

  • Always enabled
  • Enabled only for non-QSV encoders
  • Disabled

It would seem the second option is the most stable for release.

Edit: Tweak to make even more clear.

A good tweak would be to move that panel from preferences & put it on the encoding tab for video codec selection because sometimes QSV decoding does not work because of the input file. Takes it out of hiding, and makes the setting more obvious as a result. And yes, I think that having "Always enabled" as default would be best, because it will show if the QSV decoding process is not being used when this one switch is toggled. Anyone with QSV capability should want QSV decoding on when encoding, if QSV decoding works. It's faster, and saves system resources & energy.

  1. it's not moving from preferences. It shouldn't be something users frequently have to adjust. There are issues to solve but they need to get solved rather than moving this to the main UI.
  2. There is no reason why you'd ever want to use QSV decoding only for non-QSV encoders.
  3. By Default, QSV decoding is enabled. If the checkbox is checked, then it's disabled, thus the 2nd option is grey'd out thus irrelevant.
  4. Regardless of what you set any options to, QSV decoding path is only used for codecs we support. There is no "Always".

I may flip the logic to be more "natural". i.e

"Enable QSV Decoding"
"Enable QSV Decoding when using non QSV encoders"

Either way, the issue at hand here is we don't support the full set of decoding options available.

There is no reason why you'd ever want to use QSV decoding only for non-QSV encoders.

Unless I'm mistaken, we seem to have issues with QSV decode+encode simultaneously. Is QSV decode useless when encoding with, say, x264/5? I admit I'm not fully up to speed on these things.

QSV decoding path is only used for codecs we support. There is no "Always".

Fair point! Strike "Always".

I'm mostly interested in how we can make the options more clear and the defaults more functional in the short term. Disabling QSV decoding seems to be a common fix; I was hoping we could find a combination that keeps it enabled for stable paths and disables it where it might prevent this common issue.

Encoder doesn't seem to matter. It just doesn't work in some instances regardless of encoder.

Ah, then perhaps I'm down a rabbit hole that isn't too useful. Anyway, perhaps you will consider clarifying those checkboxes; the second could at least be reworded.

@ZaphodX77 Scott's right that QSV should be a preference, and mostly invisible to the user. Exactly the kind of thing we really don't want on the main tabs. The only reason this is all in discussion is due to bugs; once those are resolved it should just work and stay out of everyone's way.

Thank you for that assurance that it is going to be fixed instead of disabled.

Thank you for that assurance that it is going to be fixed instead of disabled.

Indeed, the goal is to support what QSV supports, within reason.

Sorry if I hijacked this thread a bit; seems I was confusing some of your initial request with an issue that's reported periodically, where QSV decoding needs to be disabled to make an encode work at all. 馃槇

@ZaphodX77 can you pls re-cap when your settings which does not work,
so I can re-view it more carefully?
I was under impression that the case can be closed.

@maximd33 This case Is for two things:

  1. Enable QSV decoders for all supported QSV decoders when available. I.e vp8/9. NIot tested 10bit files myself. Not sure if there are issues there
  2. There is still some crash/lockup/artifcating issues with qsv decoder. I don't have any sources for these problems yet unfortunately.

@sr55 thanks
VPx - would it be nice to have or a must ?

nice to have.

The QSV decoding does not decode input HEVC 10bit at all. It decodes HEVC 8bit sporadically.

Whenever there is a problem with decoding by QSV otherwise, for any input, there is something "wrong" with the input file. As you may remember, Handbrake had a muxing problem some time back that I pointed out, and there could be a legacy of such files being around. It could also be from some generalized corruption that I don't know the details of. Whenever there is such a file, it is a rare exception, and I just switch to software decoding for that file.

Is HEVC decoding to be fixed for 1.1.0?

More likely post 1.1

@ZaphodX77

The QSV decoding does not decode input HEVC 10bit at all. It decodes HEVC 8bit sporadically.

I would be interesting to see and try again some cases locally, any samples to see?

Easily reproduced by encoding an x265 10bit clip with HandBrake then feeding it back in, Software hevc is used when the source is 10bit.

I don't however have any sources that break 8bit decoding.

thanks @sr55 https://github.com/HandBrake/HandBrake/pull/1066 should address 10b HEVC story

@agalin89 @maximd33

Would be a good one to close out if time permits. Couple of points to note:

1. There is a problem with 10bit hevc decode. Seems to be dropping lots of frames:
Can provide samples if needed.

log.txt

[22:51:02] + decoder: hevc_qsv
...
[22:51:09] work: average encoding speed for job is 28.994951 fps
[22:51:09] comb detect: heavy 0 | light 4 | uncombed 221 | total 225
[22:51:09] decomb: deinterlaced 0 | blended 4 | unfiltered 221 | total 225
[22:51:09] aac-decoder done: 9417 frames, 0 decoder errors
[22:51:09] hevc_qsv-decoder done: 200 frames, 0 decoder errors
[22:51:09] sync: got 225 frames, 5023 expected
[22:51:09] sync: framerate min 1.000 fps, max 25.000 fps, avg 1.125 fps

2. Do we support decoding for everything QSV does? I.e VP9?

3. It looks like the code to drop crop/scale doesn't account for anamorphic

[22:54:34] + Output geometry
[22:54:34] + storage dimensions: 720 x 428
[22:54:34] + pixel aspect ratio: 64 : 45
[22:54:34] + display dimensions: 1024 x 428
...
[22:54:34] Skipping crop/scale filter

Output was non-anamorphic 720x428

Thanks

@sr55 agree, it should be solved.

1. There is a problem with 10bit hevc decode. Seems to be dropping lots of frames:

2. Do we support decoding for everything QSV does? I.e VP9?
HEVC/h264 are first goals,
VP9 should be in the list after we will make filters fully validated.
would we care about VC1?

3. It looks like the code to drop crop/scale doesn't account for anamorphic
needs to be investigated with "Hevc-10-1.m4v" available to try

  1. No joy on the update. Looks like it's fine in 1.3.1 and fails in the nightly build so it appears to be a recent change. Sample shared on iRC

  2. VC1 is pretty dead these days so I wouldn't waste time on it.

  3. Provided.

Thanks

Issue has been investigated.

In JSON configuration provided you are using filters. It means that QSV output frames are coming out to system memory and QSV works in "encode-only" mode.

I tested the same configuration on released binaries of FFMPEG.

FFMPEG 4.2.2 release has the same issue.
Latest master nightly build of FFMPEG works fine. @sr55 Seems we need to update FFMPEG in contrib to the next release when it comes.

Command line to reproduce the issue:
ffmpeg.exe -c:v hevc_qsv -load_plugin hevc_hw -i Hevc-10.m4v -c:v libx265 output.mp4

More investigations:
If you disable filters in your JSON configuration QSV switches to "full encode mode" and produces output frames to video memory directly and it works perfectly.

Would be good if we can identify the necessary upstream patches.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

a7dfj8aerj picture a7dfj8aerj  路  3Comments

YammYcoding picture YammYcoding  路  4Comments

toam-plus picture toam-plus  路  3Comments

28598519a picture 28598519a  路  4Comments

n2bisex4u picture n2bisex4u  路  3Comments