Jump to content

How to activate hardware transcoding?


ariznaf

Recommended Posts

I have installed Emby 3.1.2 in my QNAP TS-451+ running QTS 4.2.2

 

I have tried to activate hardware accelerated transcoding

 

I have tried to use the "Inter Quick sync" option (as my NAS has an Intel processor and GPU) with no success, when I activate it, the film simply does not play (accessing emby through web interface).

 

If I use VA API option, the video plays.

 

But the acceleration does not seem to be in effect, as the CPU load is quite big (70%) with no difference when I deactivate HW transcoding.

 

What am I doing wrong?

 

Is another different version of ffmeg needed?

 

I have read something about it.

But a ffmpeg (static libs) distribution seems to come with the QPKG as the ffmpeg directory points under the qpkg directory of emby.

 

Thank you for your help

Link to comment
Share on other sites

Hi, VA API will be your best bet. Not all videos will show a major improvement. Try to test a large number of videos before drawing any conclusions. Thanks.

Link to comment
Share on other sites

Hi Luke, thanks a lot for your answer.

 

I have been doing some tests.

 

When I made the question, I had installed Emby QNAP_Stephan distribution from the QNAP forum: https://forum.qnap.com/viewtopic.php?f=320&t=109476

 

It seem to integrate a ffmpeg distribution, as there is a custom ffmpeg path that points inside the package distribution.

With that distro, I could activate VA API and see the videos, but it did not work when I activate Intel QSync.

 

Then I have installed the Emby distro from QNAP Club.

I have installed ffmpeg package from QNAP club too and configure it as the ffmep library to use with the custom path.

 

Here it is the opposite way: I can activate Intel QSync but not VA API.

 

 

How may I know if the HW acceleration engine is being used by Emby?

 

Using it, does not seem to have any impact in the CPU load.

 

Most of my files are in mkv or mp4 containers, coded using H.264 1080P or 720p or 480p

Link to comment
Share on other sites

  • 2 weeks later...

@@Gabbe222.

​No, sorry, I did not get it to work and received no answer, here or in the QNAP forum.

 

I have tried the two versions of the community QNAP ports of EMBY, the one in the QNAP forum and the one downloaded from QNAP club.

 

Now I have reverted to the EMBY 3.0 version distributed officially in the QNAP app store, hoping they will upgrade the app soon.

 

It has no option for hardware transcoding.

 

My experience with QNAP has mixed feeling, the hardware i good, but they promise more than they really offer.

 

Most of their apps have important limitations that make them quite useless.

  • Like 1
Link to comment
Share on other sites

Gabbe222

then its setteld, im buyin regular nas for storage and intel NUC for server.. I thought i could get 2in1 but after 2 weeks of reading online it dosnt seem so.

Link to comment
Share on other sites

I'm a bit off with QNAP due to their software not working as expected.

 

But how is the NUC going to be better than the NAS?

 

We are talking of hardware transcoding here, not hardware decoding.

 

If the playing device is a capable one, you don't need hardware decoding.

I can play a movie in my PC using Emby with not need of hardware decoding in the NAS, as the NAS only serves de files, and the PC decodes and adapts the video to the resoluction of the screen.

 

The NAS itself, plays correctly the movies connected to the TV via HDMI using HDStation and Emby, and it plays them smoothly and with no CPU load, so I gess hardware decoding works correctly in the NAS (even with 3.0 of Emby).

 

You only need hardware transcoding (decoding/encoding) in the NAS if you are using less capable devices, not able by themself of doing hardware decoding (like PlayStation devices, some android phones...) or to save bandwith if you want to play a movie via internet in your phone device connected to you home using a 4G connection, for example.

 

I would prefer emby and QNAP being able of doing hardware transcoding for the times I would need it, but it is not a must have for me.

 

May be your NUC can do the transcoding and get the  movies from the NAS, but you will need one more device up and running, consuming power and with a need of maintanance.

Edited by ariznaf
Link to comment
Share on other sites

sedony23

Hi there,

 

After fiddling around for a couple of days, I finally got hardware accelerated transcoding to work on my QNAP TS-253A. For a "how to" see my post on the QNAP forum:

 

https://forum.qnap.com/viewtopic.php?f=134&t=129879&p=596148#p596148

 

However, if we could get a static ffmpeg build with VA-API enabled, we could also run Emby as a qpkg package. Does anyone know if such a build exists and where to find it? Or could somebody compile such a build? I failed compiling a completely static build on QNAP Linux Station (ubuntu).

 

Best

 

Daniel

Link to comment
Share on other sites

I will try the new versión of emby and that ffmep static lobraries... but how do you instalo that lobraries in qnap without a qnap package?

Link to comment
Share on other sites

Let me update my tries...

 

I have installed the ffmpeg library from the link you have provided, Luke.

 

I have installed it in my system disk under the .qpkg directory (/share/CACHEDEV1_DATA/.qpkg/ffmpegStatic) no sure if it is the best place to install an external library.

 

Then I have configured Emby to use ffmpeg from that directory.

 

I have selected VA-API as hardware transcoding engine.

 

When I play a film using a web browser from emby, the CPU load scales to 91-97%. Emby says it is transcoding 1.5MBps 480p, and when I stop the playbackup cpu load goes down to 4%.

 

When i select nothing as the hardware acceleration engine, the CPU load is about the same: 94%.

 

I have tried Intel quick sync as the HW ACC engine with the same results.

 

I have even tried another ffmpeg 3.3.2  built installing the ffmpeg package from QNAP club (http://qnapclub.eu/index.php?act=detail&qpkg_id=379) with identical results.

 

What may be going on?

 

Why does it not work if it seems that this static libraries implement HW ACC transcoding?

Link to comment
Share on other sites

I will try the new versión of emby and that ffmep static lobraries... but how do you instalo that lobraries in qnap without a qnap package?

 

I will have to discuss with Stephan from QNAP. Thanks !

Link to comment
Share on other sites

  • 1 month later...
GibsonXXI

The Emby releases from the forum (by QNAP_Stephane) and the ones from QNAPClub are one and the same thing. QNAPClub are hosting QNAP_Stephane's packages, so you'll probably gain very little using one over the other. The packages posted in the forum may be updated slightly quicker than they appear on QNAPClub, that's about it.

 

QNAP_Stephane also has an FFMpeg static build addon, and he uses John Van Sickle's builds to make that addon. Again, downloading from the forum will get you a slightly newer release (3.2.4 vs 3.2.0 on QNAPClub). However Stephane's version includes ffprobe, but does not correctly symlink the library in the system path as he has done with ffmpeg (/usr/bin/ffmpeg -> /share/CACHEDEV1_DATA/.qpkg/ffmpeg). Might be irrelevent anyway, as I could not get Emby to 'recognise' the ffmpeg install when pointing it at the symlink, even after manually creating a symlink for ffprobe in the same folder via SSH (/usr/bin/ffmpeg and /usr/bin/ffprobe) so I just pointed Emby at the native ffmpeg addon install folder (/share/CACHEDEV1_DATA/.qpkg/ffmpeg) and that seemed to work.

Link to comment
Share on other sites

  • 1 month later...
viceversa

Also struggling to get HW transcoding to work via VA API with qnap ts-451+ 4.3.3, Emby 3.2.16.0 (qnapclub) and static ffmpeg 3.3.0 (qnapclub).  I've called out the path for the static ffmpeg installation which is being recognized but the problem I'm having is:
 

fmpeg version 3.3-static http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.1 (Debian 5.4.1-8) 20170304
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-5 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
[AVHWDeviceContext @ 0x3bb41c0] No VA display found for device: /dev/dri/card0.
[vaapi @ 0x31531e0] Failed to create a VAAPI device

I've tried calling out both "card0" and "renderD128" and even though not necessary, set additional permissions:
 

[/dev/dri] # ls -lah
total 0
drwxr-xr-x    2 admin    administ     100 May 15 08:42 ./
drwxr-xr-x   15 admin    administ   19.9K May 15 15:48 ../
crwxrwx---    1 admin    administ  226,   0 May 15 08:42 card0
crwxrwx---    1 admin    administ  226,  64 May 15 08:42 controlD64
crwxrwx---    1 admin    administ  226, 128 May 15 08:42 renderD128

Anyone able to get past this point?

Link to comment
Share on other sites

sstt671

 

Also struggling to get HW transcoding to work via VA API with qnap ts-451+ 4.3.3, Emby 3.2.16.0 (qnapclub) and static ffmpeg 3.3.0 (qnapclub).  I've called out the path for the static ffmpeg installation which is being recognized but the problem I'm having is:

 

fmpeg version 3.3-static http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.1 (Debian 5.4.1-8) 20170304
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-5 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
[AVHWDeviceContext @ 0x3bb41c0] No VA display found for device: /dev/dri/card0.
[vaapi @ 0x31531e0] Failed to create a VAAPI device

I've tried calling out both "card0" and "renderD128" and even though not necessary, set additional permissions:

 

[/dev/dri] # ls -lah
total 0
drwxr-xr-x    2 admin    administ     100 May 15 08:42 ./
drwxr-xr-x   15 admin    administ   19.9K May 15 15:48 ../
crwxrwx---    1 admin    administ  226,   0 May 15 08:42 card0
crwxrwx---    1 admin    administ  226,  64 May 15 08:42 controlD64
crwxrwx---    1 admin    administ  226, 128 May 15 08:42 renderD128

Anyone able to get past this point?

 

I have exactly same problem with similar setup on my TS-251+. 

Link to comment
Share on other sites

sstt671

One more test I did today

 

 

Look at the trancode log file when:

(1) using Emby's in built ffmpeg

2017-05-16 15:04:28.9080 Info MediaEncoder: Attempting to update encoder path to /share/CE_CACHEDEV1_DATA/.qpkg/Emby/Emby/ProgramData-Server/ffmpeg/20160215/. pathType: Custom
2017-05-16 15:04:28.9097 Info MediaEncoder: Running /share/CE_CACHEDEV1_DATA/.qpkg/Emby/Emby/ProgramData-Server/ffmpeg/20160215/ffmpeg -version
2017-05-16 15:04:28.9322 Info MediaEncoder: ffmpeg info: ffmpeg version N-52954-g295de3e-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.3.1 (Debian 5.3.1-8) 20160205
configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --disable-indev=sndio --disable-outdev=sndio --enable-librtmp --enable-libmfx --cc=gcc
libavutil      55. 17.103 / 55. 17.103
libavcodec     57. 24.102 / 57. 24.102
libavformat    57. 25.100 / 57. 25.100
libavdevice    57.  0.101 / 57.  0.101
libavfilter     6. 31.100 /  6. 31.100
libswscale      4.  0.100 /  4.  0.100
libswresample   2.  0.101 /  2.  0.101
libpostproc    54.  0.100 / 54.  0.100

2017-05-16 15:04:28.9338 Debug XmlSerializer: Serializing to file /share/CE_CACHEDEV1_DATA/.qpkg/Emby/Emby/ProgramData-Server/config/encoding.xml
2017-05-16 15:04:28.9338 Info MediaEncoder: FFMpeg: /share/CE_CACHEDEV1_DATA/.qpkg/Emby/Emby/ProgramData-Server/ffmpeg/20160215/ffmpeg
2017-05-16 15:04:28.9338 Info MediaEncoder: FFProbe: /share/CE_CACHEDEV1_DATA/.qpkg/Emby/Emby/ProgramData-Server/ffmpeg/20160215/ffprobe
2017-05-16 15:04:28.9338 Info MediaEncoder: Validating media encoder at /share/CE_CACHEDEV1_DATA/.qpkg/Emby/Emby/ProgramData-Server/ffmpeg/20160215/ffmpeg
2017-05-16 15:04:28.9338 Info MediaEncoder: Running /share/CE_CACHEDEV1_DATA/.qpkg/Emby/Emby/ProgramData-Server/ffmpeg/20160215/ffmpeg -decoders
2017-05-16 15:04:29.0109 Info MediaEncoder: Decoder available: mpeg2video
2017-05-16 15:04:29.0142 Info MediaEncoder: Decoder available: h264_qsv
2017-05-16 15:04:29.0178 Info MediaEncoder: Decoder available: hevc_qsv
2017-05-16 15:04:29.0228 Info MediaEncoder: Decoder available: mpeg2_qsv
2017-05-16 15:04:29.0319 Info MediaEncoder: Decoder available: vc1_qsv
2017-05-16 15:04:29.0319 Info MediaEncoder: Running /share/CE_CACHEDEV1_DATA/.qpkg/Emby/Emby/ProgramData-Server/ffmpeg/20160215/ffmpeg -encoders
2017-05-16 15:04:29.0600 Info MediaEncoder: Encoder available: libx264
2017-05-16 15:04:29.0616 Info MediaEncoder: Encoder available: libx265
2017-05-16 15:04:29.0637 Info MediaEncoder: Encoder available: mpeg4
2017-05-16 15:04:29.0659 Info MediaEncoder: Encoder available: msmpeg4
2017-05-16 15:04:29.0696 Info MediaEncoder: Encoder available: libvpx
2017-05-16 15:04:29.0733 Info MediaEncoder: Encoder available: libvpx-vp9
2017-05-16 15:04:29.0776 Info MediaEncoder: Encoder available: aac
2017-05-16 15:04:29.0830 Info MediaEncoder: Encoder available: libmp3lame
2017-05-16 15:04:29.0884 Info MediaEncoder: Encoder available: libopus
2017-05-16 15:04:29.0950 Info MediaEncoder: Encoder available: libvorbis
2017-05-16 15:04:29.1023 Info MediaEncoder: Encoder available: srt
2017-05-16 15:04:29.1184 Info MediaEncoder: Encoder available: h264_qsv
2017-05-16 15:04:29.1202 Info MediaEncoder: Encoder available: hevc_qsv
2017-05-16 15:04:29.1547 Info MediaEncoder: Encoder validation complete
2017-05-16 15:04:29.1553 Info HttpServer: HTTP Response 204 to 172.56.3.36. Time: 250ms. http://<<My DDNS Address>>:8096/emby/System/MediaEncoder/Path 
2017-05-16 15:04:32.3901 Info HttpServer: HTTP GET http://<<My DDNS Address>>:8096/emby/System/Logs. UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36

(2) Intel Quick Sync selected - see attached log file for detail.

 Stream #0:0(eng): Video: h264 (High), yuv420p, 1920x808, SAR 1:1 DAR 240:101, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      BPS             : 9012426
      BPS-eng         : 9012426
      DURATION        : 01:44:05.082000000
      DURATION-eng    : 01:44:05.082000000
      NUMBER_OF_FRAMES: 149732
      NUMBER_OF_FRAMES-eng: 149732
      NUMBER_OF_BYTES : 7035418193
      NUMBER_OF_BYTES-eng: 7035418193
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-05-11 01:28:38
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-05-11 01:28:38
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)
    Metadata:
      BPS             : 1508999
      BPS-eng         : 1508999
      DURATION        : 01:44:05.163000000
      DURATION-eng    : 01:44:05.163000000
      NUMBER_OF_FRAMES: 585484
      NUMBER_OF_FRAMES-eng: 585484
      NUMBER_OF_BYTES : 1177993808
      NUMBER_OF_BYTES-eng: 1177993808
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-05-11 01:28:38
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-05-11 01:28:38
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
[h264_qsv @ 0x3f09260] Error initializing an internal MFX session
Output #0, matroska, to '/share/CE_CACHEDEV1_DATA/.qpkg/Emby/Emby/ProgramData-Server/transcoding-temp/c0b5f35c7b1fc2b4ba53142a08cff5cf.mkv':
    Stream #0:0: Video: h264, none, q=2-31, 128 kb/s, SAR 1:1 DAR 0:0, 23.98 fps (default)
    Metadata:
      encoder         : Lavc57.24.102 h264_qsv
    Stream #0:1: Audio: mp3, 0 channels, 128 kb/s (default)
    Metadata:
      encoder         : Lavc57.24.102 libmp3lame
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_qsv))
  Stream #0:1 -> #0:1 (dts (dca) -> mp3 (libmp3lame))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

qsv_trancode error.txt

Link to comment
Share on other sites

For QNAP, VA API is our recommended approach. We're going to be soon taking over the development of the QNAP Emby package and then we'll work through all of this.

  • Like 1
Link to comment
Share on other sites

viceversa

For QNAP, VA API is our recommended approach. We're going to be soon taking over the development of the QNAP Emby package and then we'll work through all of this.

Great news and thank you very much for the update. I'm more than happy to help out with testing.

Link to comment
Share on other sites

sstt671

For QNAP, VA API is our recommended approach. We're going to be soon taking over the development of the QNAP Emby package and then we'll work through all of this.

Great! Looking forward to this.

Link to comment
Share on other sites

  • 2 weeks later...
sectune

Please make it happen, a happy qnap emby user here cheering and praying to the holy spaghetti monster to make it happen ;)

 

 

For QNAP, VA API is our recommended approach. We're going to be soon taking over the development of the QNAP Emby package and then we'll work through all of this.

Edited by sectune
Link to comment
Share on other sites

  • 3 weeks later...
joelang6126

I have a TS-EC1080 and am struggling with this. Transcoding always uses ridiculous amounts of CPU power!

Link to comment
Share on other sites

In the near future we are planning on taking over packaging of the QNAP package, and at that point we will have official guidance on GPU acceleration.

 

In the meantime, VA API should work. Thanks.

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