Jump to content

HEVC / x265 quicksync / hardware transcoding not working?


Devdroid

Recommended Posts

Guest asrequested

So you're testing changing to a lower bitrate? The encoding is done by your hardware.

Link to comment
Share on other sites

aahmyu

So you're testing changing to a lower bitrate? The encoding is done by your hardware.

Ok i just tested on my Shield. Original quality play directly lowering quality will trigger transcode which uses 100% cpu on my server. which is not the result i want.

Link to comment
Share on other sites

Guest asrequested

Presently, the way the server handles transcoding, is to do it as fast as it can. That's probably what you're seeing. Unfortunately, for HEVC decoding, the crruent ffmpeg build isn't supporting that with quick sync.

Edited by Doofus
Link to comment
Share on other sites

  • 1 month later...
Devdroid

Any updates on this? Or does FFMPEG still not support QSV x265 encoding?

 

 

 

Reason I'm asking is that x265 QSV hardware encoding seems to be working with handbrake nightly (and isn't handbrake just a GUI for FFMPEG?): 

 

post-305863-0-01381500-1528547284_thumb.png

Edited by Devdroid
Link to comment
Share on other sites

Devdroid

Update on what exactly?

 

Update on the topic of the thread: the status of HEVC/x265 QSV transcoding with Emby Server for Windows. 

Edited by Devdroid
Link to comment
Share on other sites

It's already supported if supported by your hardware.

 

If you're having difficulty, we've updated ffmpeg for the next release so you can always reevaluate then. Thanks.

Link to comment
Share on other sites

Guest asrequested

Are you wanting to transcode TO h265? This thread is talking about transcoding FROM h265.

Edited by Doofus
Link to comment
Share on other sites

Devdroid

Are you wanting to transcode TO h265? This thread is talking about transcoding FROM h265.

 

....I uploaded the wrong picture. It does however work fine with both x264->x265 or from x265->x264 with Handbrake nightly and QSV enabled. Seems to be working fine with any sample I throw at it. 

 

You can test for yourself here: https://handbrake.fr/nightly.php

 

I can't get it to work with Emby Server though. It'll just throw the hevc_qsv error as discussed earlier in this thread. 

 

 

It's already supported if supported by your hardware.

 

If you're having difficulty, we've updated ffmpeg for the next release so you can always reevaluate then. Thanks.

 

Is x265->x264 via QSV really supported? I tried with several of the HEVC samples in this thread, and none of them worked. As far as I can tell, it didn't work for anyone else either? 

 

All I get when I try is the same error everyone else is receiving when trying to do HEVC transcoding: 

Press [q] to stop, [?] for help
[hevc_qsv @ 00000261b7691920] Could not load the requested plugin '15dd936825ad475ea34e35f3f54217a6': specified object was not found (-9)
[hevc_qsv @ 00000261b7691920] Error loading plugins
[hevc_qsv @ 00000261b7691920] Error initializing an MFX session
Error while decoding stream #0:0: Function not implemented

I did try the latest beta also, but that didn't work either (using Intel HD 620 with latest drivers). 

Edited by Devdroid
Link to comment
Share on other sites

We aren't using handbrake so that's irrelevant.  

 

Test conversion using ffmpeg which is what both Emby and Plex use.

Link to comment
Share on other sites

aahmyu

I'm not sure if Plex is using a different ffmpeg version but HW HEVC transcoding is working fine on it. I tested today.

Link to comment
Share on other sites

Devdroid

I'm not sure if Plex is using a different ffmpeg version but HW HEVC transcoding is working fine on it. I tested today.

 

Interesting. It didn't work a few months back when I tried it, neither beta nor stable.  

 

What version are you using? 

Edited by Devdroid
Link to comment
Share on other sites

Devdroid

We aren't using handbrake so that's irrelevant.  

 

Test conversion using ffmpeg which is what both Emby and Plex use.

 

I tried myFFMPEG with the latest build of FFMPEG from here: https://ffmpeg.zeranoe.com/builds/

 

post-305863-0-14313300-1528584715_thumb.png

 

That also does seem to work fine as far as I can tell when converting from x265->x264 with QSV enabled. 

 

The app (myFFMPEG) did throw a warning though about constant bitrate factor when enabling QSV, claiming that it doesn't work with that enabled. 

Edited by Devdroid
Link to comment
Share on other sites

aahmyu

I'm using the beta version of Plex.

I think it was broken a few months ago both on Emby and Plex. But Plex fixed it somehow.

Edited by aahmyu
Link to comment
Share on other sites

I'm not sure if Plex is using a different ffmpeg version but HW HEVC transcoding is working fine on it. I tested today.

Plex does automatic fallback so you may not know what it's doing.  The Now Playing screen is not always correct but usually pretty accurate.  If you look at Now Playing you will see (hw) listed twice if it's doing both decoding (hw) and encoding (hw).  If you only see (hw) listed once it's only for the encode.  If you do see it listed twice then you also need to look at the logs.

 NowPlaying-300x168.png

Link to comment
Share on other sites

aahmyu

Plex does automatic fallback so you may not know what it's doing. The Now Playing screen is not always correct but usually pretty accurate. If you look at Now Playing you will see (hw) listed twice if it's doing both decoding (hw) and encoding (hw). If you only see (hw) listed once it's only for the encode. If you do see it listed twice then you also need to look at the logs.

NowPlaying-300x168.png

To be honest I don't trust the app info screen, so I was checking the cpu/gpu usage to make sure it was using the gpu. So while Emby was using 100% cpu Plex was using around 55% cpu and gpu on the same HEVC file.

Link to comment
Share on other sites

aahmyu

Well, he did say to check your logs. That would be clear information.

Yeah but task manager is accurate too and easier to check. Anyways this is from plex logs. Not sure if it's the right part though.

 

Variants>

<Variant id="14c6ccc1-acfa-4eb0-94f9-543a5ba9b793" targetBitrate="3964" context="streaming" sourceVideoCodec="hevc" sourceAudioCodec="aac" videoDecision="transcode" audioDecision="transcode" subtitleDecision="burn" protocol="hls" container="mpegts" videoCodec="h264" audioCodec="aac" audioChannels="6" transcodeHwRequested="1" transcodeHwDecoding="dxva2" transcodeHwEncoding="qsv" transcodeHwDecodingTitle="Windows (DXVA2)" transcodeHwEncodingTitle="Intel (QuickSync)" transcodeHwFullPipeline="0">

<Media audioProfile="he-aac" id="19914" videoProfile="main" audioChannels="6" audioCodec="aac" bitrate="3775" container="mpegts" duration="7070439" height="534" protocol="hls" videoCodec="h264" videoFrameRate="24p"

Link to comment
Share on other sites

aahmyu

So there you go. Its converting to h264, and using DXVA2

Which is bad? It also says qsv and Intel quick sync. And most importantly it works.

Link to comment
Share on other sites

Guest asrequested

Which is bad? It also says qsv and Intel quick sync. And most importantly it works.

 

No, not bad. I just played an HEVC video from my beta server, which is running on an i7 6700k. HEVC decoding, disabled. Here is the result.

Input #0, matroska,webm, from 'file:D:\Library\The X files\Season 1\The X-Files S01E01 Pilot (1080 x265 Joy).mkv':
  Metadata:
    CREATION_TIME   : 
    ENCODER         : Lavf55.12.0
  Duration: 00:48:11.74, start: 0.000000, bitrate: 1095 kb/s
    Stream #0:0: Video: hevc (Main), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
    Stream #0:1(eng): Audio: aac (HE-AAC), 48000 Hz, 5.1, fltp (default)
    Metadata:
      title           : Surround
      LANGUAGE        : eng
    Stream #0:2(eng): Subtitle: ass
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_qsv))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[segment @ 0000017594b040c0] Opening 'C:\Users\Peter\AppData\Roaming\Emby-Server\programdata\transcoding-temp\f447dd78032bc3edcfba86afbd025d900.ts' for writing
Output #0, segment, to 'C:\Users\Peter\AppData\Roaming\Emby-Server\programdata\transcoding-temp\f447dd78032bc3edcfba86afbd025d90%d.ts':
  Metadata:
    encoder         : Lavf58.12.100
    Stream #0:0: Video: h264 (h264_qsv), nv12, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 5475 kb/s, 23.98 fps, 90k tbn, 23.98 tbc (default)
    Metadata:
      encoder         : Lavc58.18.100 h264_qsv
    Side data:
      cpb: bitrate max/min/avg: 5475304/0/5475304 buffer size: 10950608 vbv_delay: -1
    Stream #0:1: Audio: aac (HE-AAC), 48000 Hz, 5.1, fltp (default)
Link to comment
Share on other sites

aahmyu

 

No, not bad. I just played an HEVC video from my beta server, which is running on an i7 6700k. HEVC decoding, disabled. Here is the result.

Input #0, matroska,webm, from 'file:D:\Library\The X files\Season 1\The X-Files S01E01 Pilot (1080 x265 Joy).mkv':
  Metadata:
    CREATION_TIME   : 
    ENCODER         : Lavf55.12.0
  Duration: 00:48:11.74, start: 0.000000, bitrate: 1095 kb/s
    Stream #0:0: Video: hevc (Main), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
    Stream #0:1(eng): Audio: aac (HE-AAC), 48000 Hz, 5.1, fltp (default)
    Metadata:
      title           : Surround
      LANGUAGE        : eng
    Stream #0:2(eng): Subtitle: ass
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_qsv))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[segment @ 0000017594b040c0] Opening 'C:\Users\Peter\AppData\Roaming\Emby-Server\programdata\transcoding-temp\f447dd78032bc3edcfba86afbd025d900.ts' for writing
Output #0, segment, to 'C:\Users\Peter\AppData\Roaming\Emby-Server\programdata\transcoding-temp\f447dd78032bc3edcfba86afbd025d90%d.ts':
  Metadata:
    encoder         : Lavf58.12.100
    Stream #0:0: Video: h264 (h264_qsv), nv12, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 5475 kb/s, 23.98 fps, 90k tbn, 23.98 tbc (default)
    Metadata:
      encoder         : Lavc58.18.100 h264_qsv
    Side data:
      cpb: bitrate max/min/avg: 5475304/0/5475304 buffer size: 10950608 vbv_delay: -1
    Stream #0:1: Audio: aac (HE-AAC), 48000 Hz, 5.1, fltp (default)

Ok i just tried something. I Opened a Hevc movie on Both Plex and Emby Windows Apps. Both of them works fine no transcoding.  I Lowered the quality to 480p to trigger transcode. so In Plex it worked fine and gpu is being usied like 50% while in Emby it was using a 100% cpu.

checked logs and there is this error in Emby:

Stream mapping:
  Stream #0:0 -> #0:0 (hevc (hevc_qsv) -> h264 (h264_qsv))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[hevc_qsv @ 000001e8a0fb8840] Could not load the requested plugin '15dd936825ad475ea34e35f3f54217a6': specified object was not found (-9)
[hevc_qsv @ 000001e8a0fb8840] Error loading plugins
[hevc_qsv @ 000001e8a0fb8840] Error initializing an MFX session
Error while decoding stream #0:0: Function not implemented
[hevc_qsv @ 000001e8a0fb8840] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 000001e8a0fb8840] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 000001e8a0fb8840] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 000001e8a0fb8840] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 000001e8a0fb8840] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 000001e8a0fb8840] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 000001e8a0fb8840] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 000001e8a0fb8840] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 000001e8a0fb8840] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 000001e8a0fb8840] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 000001e8a0fb8840] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 000001e8a0fb8840] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 000001e8a0fb8840] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[hevc_qsv @ 000001e8a0fb8840] Error initializing the MFX video decoder: invalid video parameters (-15)

While in Plex no errors at all. Hope this helps.

Edited by aahmyu
Link to comment
Share on other sites

Yeah but task manager is accurate too and easier to check. Anyways this is from plex logs. Not sure if it's the right part though.

 

Variants>

<Variant id="14c6ccc1-acfa-4eb0-94f9-543a5ba9b793" targetBitrate="3964" context="streaming" sourceVideoCodec="hevc" sourceAudioCodec="aac" videoDecision="transcode" audioDecision="transcode" subtitleDecision="burn" protocol="hls" container="mpegts" videoCodec="h264" audioCodec="aac" audioChannels="6" transcodeHwRequested="1" transcodeHwDecoding="dxva2" transcodeHwEncoding="qsv" transcodeHwDecodingTitle="Windows (DXVA2)" transcodeHwEncodingTitle="Intel (QuickSync)" transcodeHwFullPipeline="0">

<Media audioProfile="he-aac" id="19914" videoProfile="main" audioChannels="6" audioCodec="aac" bitrate="3775" container="mpegts" duration="7070439" height="534" protocol="hls" videoCodec="h264" videoFrameRate="24p"

This only what's being requested.  What are the following lines being returned from the transcoder that show what it actually chooses to do?  If not sure feel free to post the log file and I'll take a look for you.  Feel free to PM as well.

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...