Jump to content

Intel Deep-Link / Hyper-Encode


rbjtech

Recommended Posts

rbjtech

Hi All,

So I've been stalling the decision on what codec to use to replace all my h264 - I've come to the decision to just use hevc/h265, rather than AV1, as it seems to be a much slower takeup than I thought it would be and hardware decode support is still lacking.  I'd rather convert to a well supported but older codec than opt for a potentially risky codec that may be beaten by h266.

So the next question is on the hardware to do the h264>h265 conversions - I'll be using the qsv_hevc encoder on my 12700K, but I'm also interested in pairing it with an A380 using intels 'deeplink' technology, allowing parallel encodes (dgpu + igpu) - reporting a 65% reduction in encoding time.

@VirulentPip

I seem to recall you having an A380 - did you ever explore 'hyper-encode' in Handbrake for hevc encoding ? 

The A380 cards are now reasonably inexpensive - low enough to justify an experiment - but if anybody has this hardware combo and has previously experimented with hevc/hyper-encode/handbrake - please let me know the results !

Thanks.

Link to comment
Share on other sites

jaycedk

I have a 11th Gen Intel® Core™ i5-1145G7 @ 2.60GHz with TigerLake-LP GT2 [Iris Xe Graphics]

I transcode everything into hevc/h265 and depending on file, goes from 110 fps to 350 fps using Tdarr.

Its risky because I don't know the outcome, so sometimes i retranscode if I'm not happy about the end result.

I do use a drop dir and output dir, so I don't loose the original file.  

 

Link to comment
Share on other sites

jaycedk

Ups just noticed you have a better iGPU than me :)

Disreguard my commend, since you have already been using one better that mine.

And wanted to know about A380. 

Link to comment
Share on other sites

rbjtech

@jaycedklol no worries - yea the performance is good already, but it can be even better with a parallel dGPU.

 

Link to comment
Share on other sites

jaycedk

Well that could be sweet in they could share the load.

I just don't think a A380 would fit in my nuc 😂🤣

Link to comment
Share on other sites

VirulentPip

Yeah I used it.. 
 



Just tried again.. Still direct play errors on Emby via Nvidia Shield Pro with anything encoded using Deep Link Hyper Encoding on Handbrake. 

Edit - Not that it even seems to work properly. With it off the A380 is hitting 100%. With it on it's like 30-35% with the UHD 770 at around 70% and fps is the same. Maybe I didn't realise this before as wasn't using for long till realised the playback issues. 

Edited by VirulentPip
  • Thanks 1
Link to comment
Share on other sites

justinrh

Are you converting H.264 files that were already converted from something?  Do you expect any noticeable degradation?  Will the audio be passed thru?

Edited by justinrh
Link to comment
Share on other sites

rbjtech
10 hours ago, VirulentPip said:

Yeah I used it.. 
 



Just tried again.. Still direct play errors on Emby via Nvidia Shield Pro with anything encoded using Deep Link Hyper Encoding on Handbrake. 

Edit - Not that it even seems to work properly. With it off the A380 is hitting 100%. With it on it's like 30-35% with the UHD 770 at around 70% and fps is the same. Maybe I didn't realise this before as wasn't using for long till realised the playback issues. 

Thanks - you reminded me of the issue you found. 👍

Hmm - so if fps is the same, then it sounds like the threads are not well optomised.

tbh, there is very little out there on Hyper-Encode - and I'm surprised it has not been talked about - but perhaps that's because the intel figures are marketing/lab fiction and the real throughput is nowhere near the 65% increase they say.

Could I ask you to try again with the latest drivers ?  Maybe they have fixed it ?

Thanks !

Link to comment
Share on other sites

rbjtech
8 hours ago, justinrh said:

Are you converting H.264 files that were already converted from something?  Do you expect any noticeable degradation?  Will the audio be passed thru?

Yes but only with a bitrate above 8-10Mbit/sec - anything less than this will likely be noticable, so will remain on h264.   But as with all conversion, it's try it and see.   I'm only converting what I consider 'archive' material - anything in the last year or so has already been converted to hevc from source.   Audio will just be copied in whatever format(s) it is now.

Link to comment
Share on other sites

VirulentPip
23 minutes ago, rbjtech said:

Could I ask you to try again with the latest drivers ?  Maybe they have fixed it ?

Using latest drivers (27/07/23) and latest stable Handbrake build - 1.6.1 ... No speed increase and direct play issue still present if using it. Not sure if Handbrake specific issue or not, but yeah doesn't work as intended. 

  • Thanks 1
Link to comment
Share on other sites

VirulentPip

Okay with some researching, turns out you need to have QSV Decode and Low Power settings on for HyperEncode to engage properly. Went from avg fps 232 to 308 (this while Emby throttle enabled transcoding with the UHD 770) With HE engaged the output file size changed too, from 660MB to 692MB.

However still doesn't explain the direct play errors on the Shield (Both ATV Beta and Android Beta).. Plays fine on Emby Theatre on PC. 


 

ffmpeg-transcode-9310c7ca-b4fc-4a2d-8fd9-15b2a8ce12d8_1.txt ffmpeg-transcode-00da5e21-4021-4936-bc1d-22dfe5b8dee5_1.txt

  • Like 1
Link to comment
Share on other sites

rbjtech

ok - so some progress.  Yea the deep-link whitepaper says to use those settings in handbrake ... 🙄

Can you PM me the resulting hevc file - or a small extract of it if that's ok ?

 

  • Like 1
Link to comment
Share on other sites

RanmaCanada

If you're encoding, this is the command line in staxrip that apparently gave the best results.  I personally use it myself as well and it's been fantastic.

--avhw --codec hevc --quality best --profile main10 --bframes 14(or 16) --b-pyramid --adapt-ltr --open-gop --async-depth 4 --no-repeat-pps --no-tskip --sao none --fixed-func --cqp 30:32:33 --qp-offset 2:4:8

https://forum.doom9.org/showthread.php?t=172618&page=32 is where it's from.  Yes it's a year or so old, but as we know, encoding commands don't really improve.

 

Link to comment
Share on other sites

VirulentPip
11 hours ago, RanmaCanada said:

If you're encoding, this is the command line in staxrip that apparently gave the best results.  I personally use it myself as well and it's been fantastic.

--avhw --codec hevc --quality best --profile main10 --bframes 14(or 16) --b-pyramid --adapt-ltr --open-gop --async-depth 4 --no-repeat-pps --no-tskip --sao none --fixed-func --cqp 30:32:33 --qp-offset 2:4:8

https://forum.doom9.org/showthread.php?t=172618&page=32 is where it's from.  Yes it's a year or so old, but as we know, encoding commands don't really improve.

 

I'll give this a go thanks, used to use Staxrip for some time. Does this Hyper-Encoding work on it?

Link to comment
Share on other sites

RanmaCanada
9 hours ago, VirulentPip said:

I'll give this a go thanks, used to use Staxrip for some time. Does this Hyper-Encoding work on it?

It should as I use this in staxrip on my encoding laptop.  Still waiting for the Arc A380 low profile to be released.

Link to comment
Share on other sites

rbjtech
9 hours ago, VirulentPip said:

I'll give this a go thanks, used to use Staxrip for some time. Does this Hyper-Encoding work on it?

I'm not sure if Handbrake use a 'special' ffmpeg or whether you just need to use the 'low-power' encode modes on the main ffmpeg branch to enable HE.

I'll get one soon and report back .. 

Thanks all. 👍

Link to comment
Share on other sites

VirulentPip

There's an option for it, but getting it to work is another matter 😅

I also seem to have some weird shizz going on with my UHD 770 it's slow as heck compared to the A380 (A lot slower than expected). I've put it on the Straxrip doom9 page but thought would share here too.

 

A380.png

UHD 770 slow.png

Link to comment
Share on other sites

rbjtech

I use ffmpeg still - and get about 140-150fps on a 1080p encode, but that's with main only, no main10 (as I never bother with HDR on 1080p) and it's better compability for older devices that can't decode main10.

ffmpeg.exe -init_hw_device "qsv=dev1:hw,child_device=0,qsv_use_dx11=1" -f matroska,webm -c:v:0 h264_qsv -threads:v:0 1 -hwaccel:v:0 qsv -hwaccel_device:v:0 dev1 -hwaccel_output_format:v:0 qsv -i "m:\TV Series\Tulsa King (2022) [tvdbID=413215]\Season 1\Tulsa King (2022) - s01e01 - Go West, Old Man - WEBDL-1080p.mkv" -map 0 -profile:v main -c:a copy -c:v hevc_qsv -global_quality 19 -preset fast -look_ahead 1 "o:\temp\temp.mkv"

Took a quick look at StaxRip from Github - but the download(7z) contains a virus according to Defender - so I'm steering clear of that ..

But 300fps on your A380 looks mighty impressive ..

Link to comment
Share on other sites

RanmaCanada

Have you tried updating the qsvenc in staxrip?  https://github.com/rigaya/QSVEnc is where the newest builds are.  I would also check to see what your decoder is.  I can't seem to get vapoursynth/avisynth to work with quicksync so I've had to use quicksync hardware.  My speeds on my i3-1115g4 are faster than yours, and it should not be that way.

  • Thanks 1
Link to comment
Share on other sites

rbjtech
9 hours ago, RanmaCanada said:

Have you tried updating the qsvenc in staxrip?  https://github.com/rigaya/QSVEnc is where the newest builds are.  I would also check to see what your decoder is.  I can't seem to get vapoursynth/avisynth to work with quicksync so I've had to use quicksync hardware.  My speeds on my i3-1115g4 are faster than yours, and it should not be that way.

In Handbrake I get much faster but until now it's been 'fast enough'.  Let me check out qsvenc - thanks 👍

Link to comment
Share on other sites

VirulentPip
12 hours ago, RanmaCanada said:

Have you tried updating the qsvenc in staxrip?  https://github.com/rigaya/QSVEnc is where the newest builds are.  I would also check to see what your decoder is.  I can't seem to get vapoursynth/avisynth to work with quicksync so I've had to use quicksync hardware.  My speeds on my i3-1115g4 are faster than yours, and it should not be that way.

Running latest QSVEnc 7.47.. But I think the issue is my drivers being too new. I'll try rollback to 31.0.101.4575 from 31.0.101.4577 to see if solves issues.

Link to comment
Share on other sites

rbjtech
On 02/08/2023 at 21:47, RanmaCanada said:

If you're encoding, this is the command line in staxrip that apparently gave the best results.  I personally use it myself as well and it's been fantastic.

--avhw --codec hevc --quality best --profile main10 --bframes 14(or 16) --b-pyramid --adapt-ltr --open-gop --async-depth 4 --no-repeat-pps --no-tskip --sao none --fixed-func --cqp 30:32:33 --qp-offset 2:4:8

https://forum.doom9.org/showthread.php?t=172618&page=32 is where it's from.  Yes it's a year or so old, but as we know, encoding commands don't really improve.

 

 

C:\qsvenc>qsvencc64 --avhw --codec hevc --quality best --profile main10 --bframes 14 --b-pyramid --adapt-ltr --open-gop --async-depth 4 --no-repeat-pps --no-tskip --sao none --fixed-func --cqp 30:32:33 --qp-offset 2:4:8 -i "M:\TV Series\The Flash (2014) [tvdbID=279121]\Season 9\The Flash (2014) - s09e03 - Rogues of War - HDTV-1080p - x264 - AAC 2.0.mkv" -o "o:\temp\test.mkv"
--------------------------------------------------------------------------------
o:\temp\test.mkv
--------------------------------------------------------------------------------
cop.SingleSeiNalUnit value changed off -> auto by driver
cop3.DirectBiasAdjustment value changed off -> auto by driver
cop3.GlobalMotionBiasAdjustment value changed off -> auto by driver
QSVEncC (x64) 7.47 (r3112) by rigaya, Jul 24 2023 13:00:51 (VC 1935/Win)
OS             Windows 11 x64 (22621) [UTF-8]
CPU Info       12th Gen Intel Core i7-12700K [4.92GHz] (8P+4E,12C/20T) <AlderlakeS>
GPU Info       Intel UHD Graphics 770 (32EU) 300-1500MHz [125W] (30.0.101.1273)
Media SDK      QuickSyncVideo (hardware encoder) FF, 1st GPU, API v2.06
Async Depth    4 frames
Hyper Mode     off
Buffer Memory  d3d11, 50 work buffer
Input Info     avqsv: H.264/AVC, 1920x960, 24000/1001 fps
VPP            ColorFmtConvertion: nv12 -> p010
AVSync         cfr
Output         HEVC(yuv420 10bit) main10 @ Level 4 (high tier)
               1920x960p 1:1 23.976fps (24000/1001fps)
               avwriter: hevc => matroska
Target usage   1 - best
Encode Mode    Constant QP (CQP)
CQP Value      I:30  P:32  B:33
QP Limit       min: 22, max: 63
Ref frames     5 frames
Bframes        14 frames, B-pyramid: on
Max GOP Length 240 frames
Ext. Features  WeightP WeightB GPB QPOffset AdaptiveLTR ctu:64 sao:none
[10.2%] 6314 frames: 338.64 fps, 2164 kb/s, remain 0:02:44, GPU 27%, VD 99%, est out size 663.6MB

wow - so I'm getting ~338 fps on the UHD770 with the settings you provided @RanmaCanada👍

~365 with main (not main10) .. even better.

I'll check the quality shortly ..

@VirulentPip- I'm getting the same ~75fps with your settings - so it's not your hardware that is the issue.

Edited by rbjtech
Link to comment
Share on other sites

rbjtech

Too many options in qsvenc lol !  

So resulting file is just too small vs the original with the above settings - I'm seeing a 2Gb file being reduced to 300Mb.   To me the quality is not there any more - and it's hardly surprising with such a huge reduction in file size.  I know hevc is good but it's not that good ...

The 'secret sauce' speedwise in the config appears to be the --fixed-func - without that it's comparable to ffmpeg in general speed.

I'm just playing with --icq 18 - which has restored to about 50% of the filesize (still more than I expected) and quality is now back (as is the bitrate) - as a bonus its now hitting 430-470 fps ... 😲

Anyway - didn't plan to make this into an encoder settings thread - as it's all subjective - but needless to say @ nearly 500fps - I probably have no need for the hyper-encode tbh - although it's nice to see this encoder explicitely have a flag to set it .. (--hyper-mode on)..

C:\qsvenc>qsvencc64 --avhw --codec hevc --icq 18  --profile main --fixed-func --audio-copy --chapter-copy --sub-copy -i "M:\TV Series\The Flash (2014) [tvdbID=279121]\Season 9\The Flash (2014) - s09e03 - Rogues of War - HDTV-1080p - x264 - AAC 2.0.mkv" -o "o:\temp\test-ff.mkv"

This is the syntax I'm using on a 2Mb h264/AAC file - resulting file is 1.2Mb 

@VirulentPipMaybe worth trying with that flag on ? 😎

  • Thanks 1
Link to comment
Share on other sites

VirulentPip
39 minutes ago, rbjtech said:

Maybe worth trying with that flag on ?

That's exactly what I was missing! Thanks.

Hyper-Encode on via settings throws up errors though unfortunately. 

MFXENCODE:   Failed to get required buffer size for MFXENCODE: undeveloped feature.
Failed to initialize encoder. : invalid video parameters.

One step forward, two steps back haha. 

image.png.a51a7a02de6cdbfd1be7ae24b76f6f6f.png

Link to comment
Share on other sites

rbjtech
30 minutes ago, VirulentPip said:

That's exactly what I was missing! Thanks.

Hyper-Encode on via settings throws up errors though unfortunately. 

MFXENCODE:   Failed to get required buffer size for MFXENCODE: undeveloped feature.
Failed to initialize encoder. : invalid video parameters.

One step forward, two steps back haha. 

image.png.a51a7a02de6cdbfd1be7ae24b76f6f6f.png

Odd - as when I use it - it just says not supported (as I have no A380 alongside..)

What version of qsvenc are you using ?

C:\qsvenc>c:\qsvenc\qsvencc64.exe --avhw --codec hevc --icq 18  --hyper-mode on --profile main --fixed-func --audio-copy --chapter-copy --sub-copy -i "M:\Films\2 Fast 2 Furious (2003) [tmdbId=584]\2 Fast 2 Furious (2003) - WEBDL-1080p.mkv" -o "o:\temp\temp.mkv"
--------------------------------------------------------------------------------
o:\temp\temp.mkv
--------------------------------------------------------------------------------
avqsv: --sub-copy is set, but no subtitle stream found.
HyperMode is not supported on current platform, disabled.
cop.SingleSeiNalUnit value changed off -> auto by driver
cop3.DirectBiasAdjustment value changed off -> auto by driver
cop3.GlobalMotionBiasAdjustment value changed off -> auto by driver
QSVEncC (x64) 7.47 (r3112) by rigaya, Jul 24 2023 13:00:51 (VC 1935/Win)
OS             Windows 11 x64 (22621) [UTF-8]
CPU Info       12th Gen Intel Core i7-12700K [4.92GHz] (8P+4E,12C/20T) <AlderlakeS>
GPU Info       Intel UHD Graphics 770 (32EU) 300-1500MHz [125W] (30.0.101.1273)
Media SDK      QuickSyncVideo (hardware encoder) FF, 1st...............................................

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...