Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest version breaks Intel QSV h265 10-bit #185

Open
hb0nes opened this issue Aug 5, 2021 · 17 comments
Open

Latest version breaks Intel QSV h265 10-bit #185

hb0nes opened this issue Aug 5, 2021 · 17 comments

Comments

@hb0nes
Copy link

hb0nes commented Aug 5, 2021

Latest Docker version v1.24 broke my Intel QSV h265 10-bit conversion with error -15.
My CPU is i7-11700k.

Relevant log snippet

[14:25:23] hb_display_init: using VA driver 'iHD'
libva info: VA-API version 1.12.0
libva info: User environment variable requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_12
libva info: va_openDriver() returns 0
ERROR: encqsvInit: MFXVideoENCODE_Init failed (-15)
[14:25:23] encqsvInit: using encode-only (LowPower) path
[14:25:23] encqsvInit: H.265/HEVC Main 10 profile @ level (null)
[14:25:23] encqsvInit: TargetUsage 4 AsyncDepth 6
[14:25:23] encqsvInit: GopRefDist 3 GopPicSize 24 NumRefFrame 0
[14:25:23] encqsvInit: BFramesMax 2 BRefType off
[14:25:23] encqsvInit: RateControlMethod ICQ ICQQuality 20
ERROR: Failure to initialise thread 'Quick Sync Video encoder (Intel Media SDK)'
[14:25:23] comb detect: heavy 0 | light 0 | uncombed 0 | total 0
[14:25:23] decomb: deinterlaced 0 | blended 0 | unfiltered 0 | total 0
[14:25:23] vfr: lost time: 0 (0 frames)
[14:25:23] vfr: gained time: 0 (0 frames) (0 not accounted for)
[14:25:23] eac3-decoder done: 0 frames, 0 decoder errors
[14:25:23] h264-decoder done: 0 frames, 0 decoder errors
[14:25:23] sync: got 0 frames, 128668 expected
[14:25:24] Finished work at: Thu Aug  5 14:25:24 2021

[14:25:24] libhb: work result = 3

Encode failed (error 3).

PS I should mention, reverting back to the version before that (v1.23.2) resolved my issue, so will stay on that one until it's fixed.

@jlesage
Copy link
Owner

jlesage commented Aug 9, 2021

Can you try with the debug version (by adding -debug to the docker tag) to get more details from the log ?

@jlesage
Copy link
Owner

jlesage commented Aug 9, 2021

Also, is it just the h265 10-bit QSV encoder that doesn't work ?

@philipp309
Copy link

It seems I have the same problem. I tried to convert with Intel QSV H265-10bit, after scanning the subtitles the Docker container crashes every time.

I have an Intel i5-10400 running Unraid 6.9.2
I recorded the following log-snippets with the container v1.24.0-debug:

Encode log snippet:

[08:21:31] sync: expecting 206178 video frames
[08:21:31] hb_display_init: using VA driver 'iHD'
libva info: VA-API version 1.12.0
libva info: User environment variable requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_12
libva info: va_openDriver() returns 0
[08:21:31] encqsvInit: using encode-only path
[08:21:31] encqsvInit: H.265/HEVC Main 10 profile @ level (null)
[08:21:31] encqsvInit: TargetUsage 4 AsyncDepth 4
[08:21:31] encqsvInit: GopRefDist 3 GopPicSize 24 NumRefFrame 6
[08:21:31] encqsvInit: BFramesMax 2 BRefType off
[08:21:31] encqsvInit: RateControlMethod ICQ ICQQuality 20
[08:21:31] sync: first pts audio 0x6 is 0
[08:21:31] sync: first pts audio 0x6 is 0
[08:21:31] sync: first pts audio 0x1 is 0
[08:21:32] sync: first pts video is 0
[08:21:32] sync: "Chapter 1" (1) at frame 1 time 0
[08:21:32] qsv_enc_init: using 'hardware (1) via VAAPI' implementation, API: 1.35

Docker container log snippet:

10/08/2021 08:14:24 created selwin: 0x40002d
10/08/2021 08:14:24 called initialize_xfixes()
10/08/2021 08:19:15 idle keyboard: turning X autorepeat back on.

[services.d] stopping services
[services.d] stopping app...
[services.d] stopping x11vnc...
caught signal: 15
10/08/2021 08:21:33 deleted 40 tile_row polling images.
[services.d] stopping openbox...
[services.d] stopping statusmonitor...
[services.d] stopping logmonitor...
[services.d] stopping autovideoconverter...
[services.d] stopping xvfb...
[services.d] stopping nginx...
[services.d] stopping certsmonitor...
[services.d] stopping s6-fdholderd...
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

From the encode log I can't see any problem at all, because the container crashes. From the container log I see "caught signal 15".

@jlesage
Copy link
Owner

jlesage commented Aug 21, 2021

@philipp309, this crash should be fixed with the latest Docker image.

@hb0nes, can you also try the latest Docker image ?

@moothedoctor
Copy link

Just signed up to let you know with the latest tag plus -debug attached (1.24.1) I was unable to encode with h265 QSV

Using an Intel i5-11600K, Unraid 6.9.2

[01:39:54] sync: expecting 37117 video frames
[01:39:54] hb_display_init: using VA driver 'iHD'
libva info: VA-API version 1.12.0
libva info: User environment variable requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_12
libva info: va_openDriver() returns 0
[01:39:54] encqsvInit: MFXVideoENCODE_Init failed (-15)
[01:39:54] encqsvInit: using encode-only (LowPower) path
[01:39:54] encqsvInit: H.265/HEVC (null) profile @ level (null)
[01:39:54] encqsvInit: TargetUsage 4 AsyncDepth 6
[01:39:54] encqsvInit: GopRefDist 3 GopPicSize 24 NumRefFrame 1
[01:39:54] encqsvInit: BFramesMax 2 BRefType off
[01:39:54] encqsvInit: RateControlMethod ICQ ICQQuality 23
[01:39:54] Failure to initialise thread 'Quick Sync Video encoder (Intel Media SDK)'
[01:39:54] comb detect: heavy 0 | light 0 | uncombed 0 | total 0
[01:39:54] decomb: deinterlaced 0 | blended 0 | unfiltered 0 | total 0
[01:39:54] vfr: 0 frames output, 0 dropped and 0 duped for CFR/PFR
[01:39:54] vfr: lost time: 0 (0 frames)
[01:39:54] vfr: gained time: 0 (0 frames) (0 not accounted for)
[01:39:54] aac-decoder done: 0 frames, 0 decoder errors
[01:39:54] h264-decoder done: 0 frames, 0 decoder errors
[01:39:54] sync: got 0 frames, 37117 expected
[01:39:54] Finished work at: Sun Aug 22 01:39:54 2021

[01:39:54] libhb: work result = 3

I'm still able to use h264 QSV however, I've currently reverted back to 1.23.2 which works.

@etreml
Copy link

etreml commented Sep 7, 2021

Same problem here on a Synology DS918+ (Intel Celeron J3455)
H265 QSV (no 10 bit, just the simple h265) stops with an error.
Version 1.23.2 does it fine.

@philipp309
Copy link

@philipp309, this crash should be fixed with the latest Docker image.

@hb0nes, can you also try the latest Docker image ?

Thank you, this crash is fixed - it was due to the foreign audio scan pass.

Now when I encode a video with H265 10bit QSV with the container, the output file is factor 2-3 as big as the original file and the video is green/red .

If I do the same in a Windows 10 VM with the latest Handbrake 1.4.1, everything works as expected.

@jlesage
Copy link
Owner

jlesage commented Oct 18, 2021

@philipp309, do you have the same issue with the recent docker image integrating HandBrake 1.4.2 ?

@jlesage
Copy link
Owner

jlesage commented Oct 18, 2021

@moothedoctor, can you try again with the latest docker image ? If you still have issue with x265 QSV encoding, could you again provide the conversion log with the debug version of the image ? I will open an issue on HandBrake's Github with this information.

@moothedoctor
Copy link

@moothedoctor, can you try again with the latest docker image ? If you still have issue with x265 QSV encoding, could you again provide the conversion log with the debug version of the image ? I will open an issue on HandBrake's Github with this information.

[09:18:17] sync: expecting 89332 video frames
[09:18:17] hb_display_init: using VA driver 'iHD'
libva info: VA-API version 1.12.0
libva info: User environment variable requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_12
libva info: va_openDriver() returns 0
[09:18:17] encqsvInit: MFXVideoENCODE_Init failed (-15)
[09:18:17] encqsvInit: using encode-only (LowPower) path
[09:18:17] encqsvInit: H.265/HEVC (null) profile @ level (null)
[09:18:17] encqsvInit: TargetUsage 4 AsyncDepth 6
[09:18:17] encqsvInit: GopRefDist 3 GopPicSize 30 NumRefFrame 1
[09:18:17] encqsvInit: BFramesMax 2 BRefType off
[09:18:17] encqsvInit: RateControlMethod ICQ ICQQuality 23
[09:18:17] Failure to initialise thread 'Quick Sync Video encoder (Intel Media SDK)'
[09:18:17] comb detect: heavy 0 | light 0 | uncombed 0 | total 0
[09:18:17] decomb: deinterlaced 0 | blended 0 | unfiltered 0 | total 0
[09:18:17] vfr: 0 frames output, 0 dropped and 0 duped for CFR/PFR
[09:18:17] vfr: lost time: 0 (0 frames)
[09:18:17] vfr: gained time: 0 (0 frames) (0 not accounted for)
[09:18:17] aac-decoder done: 0 frames, 0 decoder errors
[09:18:17] h264-decoder done: 0 frames, 0 decoder errors
[09:18:17] sync: got 0 frames, 89332 expected
[09:18:18] Finished work at: Tue Oct 19 09:18:18 2021

[09:18:18] libhb: work result = 3

That's using 1.24.2-debug, unfortunately same problems immediately says encode failed.

@Irisheyes47
Copy link

Same problem here, running latest image on an i5-11500. vainfo gives me all the relevant profiles but can only use QSV for h264. H265 and h265 10bit all fail.

Log snippet:

[09:11:46] hb_display_init: using VA driver 'iHD'
libva info: VA-API version 1.12.0
libva info: User environment variable requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_12
libva info: va_openDriver() returns 0
[09:11:46] encqsvInit: MFXVideoENCODE_Init failed (-15)
[09:11:46] encqsvInit: using encode-only (LowPower) path
[09:11:46] encqsvInit: H.265/HEVC (null) profile @ level (null)
[09:11:46] encqsvInit: TargetUsage 7 AsyncDepth 6
[09:11:46] encqsvInit: GopRefDist 3 GopPicSize 25 NumRefFrame 1
[09:11:46] encqsvInit: BFramesMax 2 BRefType off
[09:11:46] encqsvInit: RateControlMethod ICQ ICQQuality 22
[09:11:46] Failure to initialise thread 'Quick Sync Video encoder (Intel Media SDK)'
[09:11:46] aac-decoder done: 0 frames, 0 decoder errors
[09:11:46] h264_qsv-decoder done: 0 frames, 0 decoder errors
[09:11:46] sync: got 0 frames, 264254 expected
[09:11:46] Finished work at: Mon Nov 22 09:11:46 2021

@Irisheyes47
Copy link

Should also note that I haven't been able to verify on the previous version mentioned above, I can't find a way of pulling it.

@rucknapucknavitz
Copy link

rucknapucknavitz commented Nov 26, 2021

Should also note that I haven't been able to verify on the previous version mentioned above, I can't find a way of pulling it.

@Irisheyes47 Change your image line, like so, to the version you want to test: image: jlesage/handbrake:v1.23.2

I’m having the same issues as everyone else, but QSV encoding works across all 264 and 265 in the above version.

@Irisheyes47
Copy link

Thanks for that @rucknapucknavitz, appreciated.

@Irisheyes47
Copy link

Irisheyes47 commented Nov 28, 2021

Still struggling though, handbrake freezes when I attempt a QSV encode on v1.23.2, and either x264 or x265. Intel drivers are installed on the host and vainfo returns a multitude of formats. The latest version works fine on QSV/x264 but not of course on x265.

In a nutshell, I cannot get QSV to work at all on v1.23.2.

Snippet from Activity log:

[15:20:50] gtkgui: HandBrake 1.3.3 (2021031300) - Linux x86_64 - https://handbrake.fr
[15:20:50] hb_display_init: attempting VA driver 'iHD'
libva info: VA-API version 1.10.0
libva info: User environment variable requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_10
libva info: va_openDriver() returns 0
Cannot load libnvidia-encode.so.1
[15:20:50] hb_init: starting libhb thread
[15:20:50] hb_init: starting libhb thread
[15:20:50] hb_init: starting libhb thread

@Irisheyes47
Copy link

From Handbrake (HandBrake/HandBrake#4201), a fairly simple workaround from @heldiho53.

Adding lowpower=0 to VideoOptionExtra in the presets.json file makes the gui work. Just create a custom profile and add that option to the preset file. A good "so far" solution until something is implemented.

I can confirm that it works, and I now have Intel QSV working perfectly. I did have to restart the container.

@jlesage , I implemented this on your testbuild. I'll cross-post to the other issue.

@jlnsrk
Copy link

jlnsrk commented Oct 24, 2022

I

From Handbrake (HandBrake/HandBrake#4201), a fairly simple workaround from @heldiho53.

Adding lowpower=0 to VideoOptionExtra in the presets.json file makes the gui work. Just create a custom profile and add that option to the preset file. A good "so far" solution until something is implemented.

I can confirm that it works, and I now have Intel QSV working perfectly. I did have to restart the container.

Thanks this really helped me out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants