Jump to content

Emby on TS-453d with hardware transcoding


AsheAshe

Recommended Posts

AsheAshe

Hello,

Hoping to get a little help with this - tried the sticky topic but the RunLast app appears to be a qpackage on qnapclub which hasnt worked for a few weeks for me now

 

new QNAP, Docker and Emby user muddling my way how everything works and learning a lot on the way.

 

This is my current set up:

 

QNAP TS-453D upgraded to 16gb ram

Nvidia shield pro for most media consumption

Containers set up for Sonarr, Radarr, Emby, Jellyfin, SABNZBD, Qbitorrent on the QNAP

occasional iOS use via iphone and ipad

 

In general everything working as I would like it to, and previously I used an HP microserver to host hard drives with my media library and accessed via nvidia shield pro, but wanting to move away from these and looking at the differences between Jellyfin and Emby.

 

When using Jellyfin, if I go to Transcoding settings I have the option of selecting Intel Quick Sync, and VA-Api - not sure which of these is best to select however with VA-API, I was able to use the Jellyfin client to successfully decode a 4k Dolby Vision rip of Prey via my iphone at a stable framerate.

 

I then disabled the Jellyfin container and ran the Emby one and configured as similar as possible, however have noted that in Transcoder settings in Emby, there is only Yes, No or Advanced for enable hardware acceleration. If I select Yes, then with the same file and the iOS jellyfin client, the playback is choppy and clearly not working correctly. If I select advanced, this tells me that it requires an active Emby premier subscription, and two lines appear saying Preferred Hardware Decoders and Preferred hardware Encoders, however they are just text and there is no drop down there to select anything? I have Emby premier enabled on both the client and server side.

 

99.9% of my use case is using NVidia shield pro's so for the most part emby is doing what I want it to do, but from time to time I may want to watch on my phone or iPad, and also as a learning experience, just want to learn what exactly I am doing wrong that is causing it to behave differently to Jellyfin's implementation.

 

The containers were launched using CLI, and this is the code I used for Jellyfin;

 

docker run -d \

--name=jellyfin \

-e PUID=1001 \

-e PGID=1000 \

-e TZ=Europe/London \

-e JELLYFIN_PublishedServerUrl=192.168.1.167 `#optional` \

-p 8096:8096 \

-p 8920:8920 `#optional` \

-p 7359:7359/udp `#optional` \

-v jellyfin_config_series:/config \

-v /share/NAS/datastore:/data \

-v /share/NAS/datastore/media/movies:/data/movies \

-v /share/NAS/datastore/media/tv:/data/tv \

--restart unless-stopped \

lscr.io/linuxserver/jellyfin:latest

 

 

And this is the code I used for Emby:

 

docker run -d \

--name=emby \

-e PUID=1001 \

-e PGID=1000 \

-e TZ=Europe/London \

-p 8096:8096 \

-v emby_config:/config \

-v /share/NAS/datastore:/data \

-v /share/NAS/datastore/media/tv:/data/tv \

-v /share/NAS/datastore/media/movies:/data/movies \

--device /dev/dri:/dev/dri \

--restart unless-stopped \

lscr.io/linuxserver/emby:latest

 

 

Taken from hub.docker.com

 

the line " --device /dev/dri:/dev/dri \" on hub.docker.com site states this enables the intel quick sync and the VA-Api so assumed would have been able to see it.

 

Can anyone kindly shed any light in which stage I'm going wrong?

 

As a separate query - I've tried using the hub.docker.com version of the CLI from Emby themselves which is below;

 

https://hub.docker.com/r/emby/embyserver

 

e.g their code is:

docker run -d \

--name embyserver \

--volume /path/to/programdata:/config \ # Configuration directory

--volume /path/to/share1:/mnt/share1 \ # Media directory

--volume /path/to/share2:/mnt/share2 \ # Media directory

--net=host \ # Enable DLNA and Wake-on-Lan

--device /dev/dri:/dev/dri \ # VAAPI/NVDEC/NVENC render nodes

--device /dev/vchiq:/dev/vchiq \ # MMAL/OMX on Raspberry Pi

--runtime=nvidia \ # Expose NVIDIA GPUs

--publish 8096:8096 \ # HTTP port

--publish 8920:8920 \ # HTTPS port

--env UID=1000 \ # The UID to run emby as (default: 2)

--env GID=100 \ # The GID to run emby as (default 2)

--env GIDLIST=100 \ # A comma-separated list of additional GIDs to run emby as (default: 2)

emby/embyserver:latest

 

so another newb question - how come the other CLI's have single -'s at the start of the line and this one has --? I've tried changing the above to my system setup but when I paste it into putty the syntax is obviously not right, and the commands seem to get sent as individual lines and fails; do I need to take out the first - and take out the comments after the final \ on each line? e.g;

docker run -d \

--name embyserver \

-v /share/NAS/datastore:/data \

-v /share/NAS/datastore/media/tv:/data/tv \

-v /share/NAS/datastore/media/movies:/data/movies \

-net=host \

-device /dev/dri:/dev/dri \

-runtime=nvidia \

-publish 8096:8096 \

-env UID=1001 \

-env GID=1000 \

-env GIDLIST=100 \

emby/embyserver:latest

(also can anyone explain GIDLIST and how to confirm that variable? I'm comfortable with my UID and GID but GIDLIST is a new one that appeared in this CLI that I had not seen before?)

 

if I paste that into putty, without doing any customisation for my setup, I get this

[Ashe@Storage dev]$ docker run -d \
>     --name embyserver \
>     --volume /path/to/programdata:/config \ # Configuration directory
    --env GID=100 \ # The GID to run emby as (default 2)
    --env GIDLIST=100 \ # A comma-separated list of additional GIDs to run emby                                        as (default: 2)
    emby/embyserver:latestdocker: invalid reference format.
See 'docker run --help'.
[Ashe@Storage dev]$     --volume /path/to/share1:/mnt/share1 \ # Media directory
-sh: --volume: command not found
[Ashe@Storage dev]$     --volume /path/to/share2:/mnt/share2 \ # Media directory
-sh: --volume: command not found
[Ashe@Storage dev]$     --net=host \ # Enable DLNA and Wake-on-Lan
-sh: --net=host: command not found
[Ashe@Storage dev]$     --device /dev/dri:/dev/dri \ # VAAPI/NVDEC/NVENC render                                        nodes
-sh: --device: command not found
[Ashe@Storage dev]$     --device /dev/vchiq:/dev/vchiq \ # MMAL/OMX on Raspberry                                        Pi
-sh: --device: command not found
[Ashe@Storage dev]$     --runtime=nvidia \ # Expose NVIDIA GPUs
-sh: --runtime=nvidia: command not found
[Ashe@Storage dev]$     --publish 8096:8096 \ # HTTP port
-sh: --publish: command not found
[Ashe@Storage dev]$     --publish 8920:8920 \ # HTTPS port
-sh: --publish: command not found
[Ashe@Storage dev]$     --env UID=1000 \ # The UID to run emby as (default: 2)
-sh: syntax error near unexpected token `('
[Ashe@Storage dev]$     --env GID=100 \ # The GID to run emby as (default 2)
-sh: syntax error near unexpected token `('
[Ashe@Storage dev]$     --env GIDLIST=100 \ # A comma-separated list of addition                                       al GIDs to run emby as (default: 2)
-sh: syntax error near unexpected token `('
[Ashe@Storage dev]$     emby/embyserver:latest

 

So tried amending it to the same as the linuxserver one;

docker run -d \
  --name=embyserver \
  -e PUID=1001 \
  -e PGID=1000 \
  -e GIDLIST=100,1000 \
  -e TZ=Europe/London \
  -p 8096:8096 \
  -v emby_confignew:/config \
  -v /share/NAS/datastore:/data \
  -v /share/NAS/datastore/media/tv:/data/tv \
  -v /share/NAS/datastore/media/movies:/data/movies \
  --device /dev/dri:/dev/dri/ \
  --restart unless-stopped \
  emby/embyserver:latest

which works! 

However still get same behaviour:

https://imgur.com/fshClJH

 

In the detected hardware log I can see an error to say its failing to detect /dev/dri/renderD128

so tried using the above code with that path but still same result. 

 

Detected hardware log:

 

 
"DeviceInfo": {

},
"Error": {
"Number": -1,
"Message": "No VA device found at index 3"
}
}
],
"Log": [
{
"Level": 40,
"Category": 0,
"Message": "Found 16 device entries"
},
{
"Level": 40,
"Category": 0,
"Message": "Found 16 device entries"
},
{
"Level": 40,
"Category": 0,
"Message": "Found 16 device entries"
},
{
"Level": 40,
"Category": 0,
"Message": "Found 16 device entries"
}
]
}

,"ExitCode":0},"NvidiaCodecProvider":{"CodecProviderName":"NvidiaCodecProvider","StandardError":"ffdetect version 5.0.0-emby_2022_05_27-u1 Copyright (c) 2018-2022 softworkz for Emby LLC\n built with gcc 8.3.0 (crosstool-NG 1.24.0)\n configuration: --cc=x86_64-emby-linux-gnu-gcc --prefix=/home/embybuilder/Buildbot/x64/ffmpeg-x64/staging --disable-alsa --disable-debug --disable-doc --disable-ffplay --disable-libpulse --disable-libxcb --disable-vdpau --disable-xlib --enable-chromaprint --enable-fontconfig --enable-gnutls --enable-gpl --enable-iconv --enable-libaribb24 --enable-libass --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libzvbi --enable-pic --enable-version3 --enable-libtesseract --enable-cuda-llvm --enable-cuvid --enable-libdrm --enable-libmfx --enable-nvdec --enable-nvenc --enable-vaapi --enable-opencl --enable-cross-compile --cross-prefix=x86_64-emby-linux-gnu- --arch=x86_64 --target-os=linux --enable-shared --disable-static --pkg-config=pkg-config --pkg-config-flags=--static --extra-libs='-lm -lstdc++ -pthread'\n libavutil 57. 19.100 / 57. 19.100\nCannot load libcuda.so.1\nError loading CUDA functions\n\n","Result":{
"ProgramVersion": {
"Version": "5.0.0-emby_2022_05_27-u1",
"Copyright": "Copyright (c) 2018-2022 softworkz for Emby Llc",
"Compiler": "gcc 8.3.0 (crosstool-NG 1.24.0)",
"Configuration": "--cc=x86_64-emby-linux-gnu-gcc --prefix=/home/embybuilder/Buildbot/x64/ffmpeg-x64/staging --disable-alsa --disable-debug --disable-doc --disable-ffplay --disable-libpulse --disable-libxcb --disable-vdpau --disable-xlib --enable-chromaprint --enable-fontconfig --enable-gnutls --enable-gpl --enable-iconv --enable-libaribb24 --enable-libass --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libzvbi --enable-pic --enable-version3 --enable-libtesseract --enable-cuda-llvm --enable-cuvid --enable-libdrm --enable-libmfx --enable-nvdec --enable-nvenc --enable-vaapi --enable-opencl --enable-cross-compile --cross-prefix=x86_64-emby-linux-gnu- --arch=x86_64 --target-os=linux --enable-shared --disable-static --pkg-config=pkg-config --pkg-config-flags=--static --extra-libs='-lm -lstdc++ -pthread'"
},
"Error": {
"Number": -1,
"Message": "Operation not permitted"
},
"Log": [
{
"Level": 16,
"Category": 0,
"Message": "Cannot load libcuda.so.1"
},
{
"Level": 16,
"Category": 0,
"Message": "Error loading CUDA functions"
}
]
}
 
 
 
at a bit of a dead end! Anyone able to help?
Link to comment
Share on other sites

AsheAshe

Solved this by following some instructions from a friend, will post step by step later in case it helps anyone else 

  • Thanks 1
Link to comment
Share on other sites

On 8/14/2022 at 2:04 PM, AsheAshe said:

Solved this by following some instructions from a friend, will post step by step later in case it helps anyone else 

That would be great, thanks !

Link to comment
Share on other sites

  • 1 month later...
Ikario
Quote

 

If you just want to use the integrated gpu (Quicksync/VAAPI) then you need to make sure /dev/dri has the right permissions, as it normally comes with only owner (admin most likely) rw permissions.  

chmod -R 770 /dev/dri

This way, you can add whatever group owns /dev/dri (ls -l /dev/) the GIDLIST in the docker compose file and it should automatically see the integrated GPU. You could also do 777 and forget about groups or users but that's not something I'd be comfortable doing.

 

From my original post, this is probably the issue.  This reses every time you restart your server though so if you can't get RunLast, then maybe try Entware or maybe even QNAPs, default init.d might stick? (This last one I'm not sure, iirc there were issues with that, but you might as well try)

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