emby吧 关注:11,094贴子:27,461

群晖容器中搭建支持硬件编码的Emby Server教程及注意事项

只看楼主收藏回复

首先确认你的群晖是什么架构的CPU,以便下载相应的镜像,下错镜像启动容器会失败。还有一个注意事项:你的网络最好有访问外网的条件,要不然下载镜像和使用Emby是会遇到下载相关内容慢或者不能访问的问题。
我的群晖是x64架构,下面我以此架构为例。
1、安装群晖套件中心中的Docker应用。
2、在注册表项中搜索emby,在搜索结果中选择emby/embyserver,下载该镜像到本地。(此镜像为官方出的容器镜像,更新于官网同步)。
3、在群晖的控制面板的终端机和SNMP中勾选启用SSH功能并应用。
4、使用SSH工具登录你的群晖。(例子:比如你的群晖ip为192.168.1.100,我用mac终端登录时就输入以下指令“ssh 你的用户名@192.168.1.100”,然后会提示你输入密码,输入密码的过程中不会显示输入过程,输入完成后回车。你现在应该已经正确登录了你的群晖。)
5、确认硬解驱动,更改权限,输入以下指令:
sudo ls -la /dev/dri/
(执行次指令时会让你再次输入你的密码,检查输出是否存在renderD128项,白裙一定有。黑裙没有的话请更换有正确驱动的群晖启动镜像)
然后更改renderD128的文件权限为666,/dev/dri文件夹权限为755,执行以下指令:
sudo chmod 666 /dev/dri/renderD128
sudo chmod 755 /dev/dri
6、创建一个支持硬件解码的容器(#后面为此条指令的备注,不要复制进指令中去)
sudo docker run -d \
--volume /物理机配置文件目录:/config \ # 把容器中的配置文件映射到本地
--volume /物理机媒体文件目录:/容器媒体目录名1 \ # 你媒体文件的存放目录1
--volume /物理机媒体文件目录:/容器媒体目录名2 \ # 你媒体文件的存放目录2
--device /dev/dri:/dev/dri \ # To mount all render nodes for VAAPI/NVDEC/NVENC(映射显卡驱动到容器)
--publish 8096:8096 \ # To expose the HTTP port(把容器的8096端口映射到本机的8096端口上)
--publish 8920:8920 \ # To expose the HTTPS port(把容器的8097端口映射到本机的8097端口上)
--env UID=0 \ # The UID to run emby as (default: 2)(让你的容器在执行时有足够的权限)
--env GID=0 \ # The GID to run emby as (default 2)(让你的容器在执行时有足够的权限)
--env GIDLIST=0,0 \ # A comma-separated list of additional GIDs to run emby as (default: 2)(让你的容器在执行时有足够的权限)
emby/embyserver:latest
这时你应该从群晖的Docker应用界面的容器项中看见一个已经创建好的Emby容器了,不要着急启动。还要进一步设置。
7、在你群晖的web界面中启动File Station,找到你媒体文件的所在文件夹,在文件夹上点右键选属性,选择权限选项卡。点击新增按钮,添加Everyone这个组,并赋予这个组读取和写入的权限,选择确定。
8、至此你可以启动你的Emby容器了。然后正常通过浏览器界面登录你的服务器,使用跟实机安装的服务器毫无区别。
9、记得关闭群晖的SSH服务。
10、升级Emby Server容器
关闭Emby容器
在注册表中搜索Emby,并从新下载emby/embyserver镜像。
在容器项中选择Emby容器,然后在界面上面的操作按钮菜单中选择清除。
重新启动你的Emby容器
升级完成。
享受容器带来的便利吧。


IP属地:辽宁1楼2020-10-14 09:23回复
    感谢大佬,非常受用


    IP属地:江西来自Android客户端2楼2020-10-14 14:41
    回复
      2026-03-01 15:54:14
      广告
      不感兴趣
      开通SVIP免广告
      大佬请问一下套件版的emby转码效率高还是docker版的转码效率高?


      IP属地:四川3楼2020-11-03 00:12
      收起回复
        我装的ubt20,intel显卡已经GVT-t直通给群晖虚拟机,再映射给EMBY的docker了,权限什么都给了,命令测试都正常一播放就只会选择软解,CPU100%,不知道怎么回事
        root@ds918:~# docker exec -it EMBY ls -l /dev/dri
        crwxrwxrwx 1 root root 226, 0 Dec 6 09:57 card0
        crwxrwxrwx 1 root root 226, 128 Dec 6 09:57 renderD128
        root@ds918:~# docker exec -it EMBY /bin/ffdetect -hide_banner -show_program_version -loglevel 48 -show_error -show_log 40 vaencdec -print_format json
        ffdetect version 4.3.0-emby_2020_05_23 Copyright (c) 2018-2019 softworkz for Emby LLC
        built with 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-amf --disable-debug --disable-doc --disable-ffplay --disable-vdpau --disable-xlib --enable-fontconfig --enable-gnutls --enable-gpl --enable-iconv --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-cuda-llvm --enable-cuvid --enable-libmfx --enable-nvdec --enable-nvenc --enable-vaapi --extra-libs='-ldrm -lva-drm' --enable-cross-compile --cross-prefix=x86_64-emby-linux-gnu- --arch=x86_64 --target-os=linux --pkg-config=pkg-config --pkg-config-flags=--static --enable-shared --disable-static
        libavutil 56. 36.100 / 56. 36.100
        {
        "ProgramVersion": {
        "Version": "4.3.0-emby_2020_05_23",
        "Copyright": "Copyright (c) 2018-2019 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-amf --disable-debug --disable-doc --disable-ffplay --disable-vdpau --disable-xlib --enable-fontconfig --enable-gnutls --enable-gpl --enable-iconv --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-cuda-llvm --enable-cuvid --enable-libmfx --enable-nvdec --enable-nvenc --enable-vaapi --extra-libs='-ldrm -lva-drm' --enable-cross-compile --cross-prefix=x86_64-emby-linux-gnu- --arch=x86_64 --target-os=linux --pkg-config=pkg-config --pkg-config-flags=--static --enable-shared --disable-static"
        },
        "Devices": [
        Begin GetVaAdapterInfo
        Found 31 device entries
        Begin get_nodes
        Found 3 drm entries
        End GetVaAdapterInfo
        {
        "DeviceIndex": 0,
        "DeviceInfo": {
        "VendorName": "Intel Corporation",
        "DeviceName": "8th Gen Core Processor Gaussian Mixture Model",
        "SubsytemVendorName": "ASRock Incorporation",
        "VendorId": 32902,
        "DeviceId": 16017,
        "SubsytemVendorId": 6217,
        "SubsytemDeviceId": 16017,
        "DevPath": "/sys/bus/pci/devices/0000:06:01.0",
        "DrmCard": "/dev/dri/card0",
        "DrmRender": "/dev/dri/renderD128",
        "IsEnabled": 1,
        /dev/dri/renderD128: VA-API version: 1.7 (libva 1.7.0)
        "IsBootVga": 1,
        "ApiVersionMajor": 1,
        /dev/dri/renderD128: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 20.1.1 (ac0a19f)
        "ApiVersionMinor": 7,
        "Driver": "Intel iHD driver for Intel(R) Gen Graphics - 20.1.1 (ac0a19f)"
        },
        "Decoders": [
        {
        "CodecName": "MPEG2VIDEO",
        "CodecProfile": "MPEG2_SIMPLE",
        "CodecId": 2,
        "MaxWidth": 2048,
        "MaxHeight": 2048,
        "ColorFormats": "NV12 ",
        "RTFormat": 131075,
        "DecSliceMode": 1,
        "DecProcessing": 0,
        "MaxPictureWidth": 1920,
        "MaxPictureHeight": 1920,
        "ProcessingRate": 2,
        "CustomRoundingControl": 0
        },
        播放看log就显示自动选择软解,***。。。
        >>>>>> User policy for rootEnablePlaybackRemuxing: TrueEnableVideoPlaybackTranscoding: TrueEnableAudioPlaybackTranscoding: True >>>>>> Affected codecsEncoder libx264 Software EncoderProfiles: Baseline Profile (Level 6.2), Main Profile (Level 6.2), High Profile (Level 6.2), High 10 Profile (Level 6.2), High 4:2:2 Profile (Level 6.2), High 4:4:4 Predictive Profile (Level 6.2) >>>>>> FindVideoEncoder - Media: h264, UseHardwareCodecs: True, Mode: CustomInfo Checking: 'libx264 Software Encoder'Info Check successful - selecting 'libx264 Software Encoder' >>>>>> FindVideoDecoder - MediaType: hevc, Mode: CustomInfo Checking: 'Automatic software decoder'Info Check successful - selecting 'Automatic software decoder'


        5楼2020-12-06 18:43
        收起回复
          楼主,想请教下,918+原来用套件版本EMBY,硬解4k没有花屏的现象,前几天升级了7.0,改成了docker版本安装EMBY,硬解4k经常花屏,这个是啥原因呢


          IP属地:江苏6楼2020-12-14 09:48
          收起回复


            IP属地:日本来自iPhone客户端7楼2020-12-14 09:58
            回复
              楼主请教,用硬件转码只有6.5FPS,卡,反而没有软解流畅,应该怎么设置?谢谢!


              8楼2021-01-10 19:05
              收起回复
                请教大佬,QNAP TVS-873,是amd的U,型号Rx-421bd,集成R7显卡,目前只有套件版jeffylin的H264成功硬解,H265和hevc不行。emby和plex开了会员后更是连264都无法硬解,请教下大佬有什么解决方案吗,谢谢啦


                IP属地:江苏9楼2021-02-12 13:15
                收起回复
                  2026-03-01 15:48:14
                  广告
                  不感兴趣
                  开通SVIP免广告
                  大佬请问一下
                  我是用unraid装的群晖 +套件的emby
                  有会员(您拥有一个 Lifetime Emby Premiere 计划)
                  转码设置中解码器下面可以看到核显的编号 SSH检查也有驱动
                  但是用网页播放视频还是显示软解解码 CPU100%是什么原因?


                  IP属地:安徽10楼2021-02-16 02:01
                  收起回复
                    没有这个文件呢


                    星座王
                    点亮12星座印记,去领取
                    活动截止:2100-01-01
                    去徽章馆》
                    11楼2021-04-24 11:12
                    收起回复
                      这个说明终于能理解怎么装了


                      IP属地:广西来自Android客户端12楼2021-05-18 03:43
                      回复
                        truenas scale发布了21.08b1,今晚试一下docker emby硬解,显卡gt720,2G,应该能解码4k,前几次多少都遇到些无法硬解的问题,有一起折腾的兄弟吗?


                        IP属地:新疆13楼2021-09-03 20:39
                        回复
                          出问题了
                          truenas# docker exec -it 28e09cf52750 /bin/ffdetect -hide_banner -show_program_version -loglevel 48 -show_error -show_log 40 vaencdec -print_format json
                          ffdetect version 4.3.0-emby_2021_02_27 Copyright (c) 2018-2021 softworkz for Emby LLC
                          built with 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-debug --disable-doc --disable-ffplay --disable-vdpau --disable-xlib --enable-chromaprint --enable-fontconfig --enable-gnutls --enable-gpl --enable-iconv --enable-libass --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libzvbi --enable-pic --enable-version3 --enable-libx265 --enable-cuda-llvm --enable-cuvid --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'
                          libavutil 56. 36.100 / 56. 36.100
                          {
                          "ProgramVersion": {
                          "Version": "4.3.0-emby_2021_02_27",
                          "Copyright": "Copyright (c) 2018-2021 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-debug --disable-doc --disable-ffplay --disable-vdpau --disable-xlib --enable-chromaprint --enable-fontconfig --enable-gnutls --enable-gpl --enable-iconv --enable-libass --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libzvbi --enable-pic --enable-version3 --enable-libx265 --enable-cuda-llvm --enable-cuvid --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'"
                          },
                          "Devices": [
                          Begin GetVaAdapterInfo
                          Found 26 device entries
                          Begin get_nodes
                          Found 2 drm entries
                          Begin get_nodes
                          Found 2 drm entries
                          End GetVaAdapterInfo
                          {
                          "DeviceIndex": 0,
                          "DeviceInfo": {
                          "VendorName": "Matrox Electronics Systems Ltd.",
                          "DeviceName": "MGA G200eH3",
                          "SubsytemVendorName": "Hewlett Packard Enterprise",
                          "SubsytemDeviceName": "iLO5 VGA",
                          "VendorId": 4139,
                          "DeviceId": 1336,
                          "SubsytemVendorId": 5520,
                          "SubsytemDeviceId": 228,
                          "DevPath": "/sys/bus/pci/devices/0000:01:00.1",
                          "DrmCard": "/dev/dri/card0",
                          "IsEnabled": 1,
                          "IsBootVga": 1,
                          "Error": {
                          "Number": -1,
                          "Message": "Failed to open the drm device (null)"
                          }
                          }
                          },
                          {
                          "DeviceIndex": 1,
                          "DeviceInfo": {
                          "VendorName": "NVIDIA Corporation",
                          "DeviceName": "GK208B [GeForce GT 720]",
                          "SubsytemVendorName": "PC Partner Limited / Sapphire Technology",
                          "VendorId": 4318,
                          "DeviceId": 4744,
                          "SubsytemVendorId": 5963,
                          "SubsytemDeviceId": 12907,
                          "DevPath": "/sys/bus/pci/devices/0000:07:00.0",
                          "DrmCard": "/dev/dri/card1",
                          "DrmRender": "/dev/dri/renderD128",
                          "IsEnabled": 1,
                          "IsBootVga": 0,
                          "Error": {
                          "Number": -1,
                          "Message": "Failed to open the drm device /dev/dri/renderD128"
                          }
                          }
                          }
                          ],
                          "Log": [
                          {
                          "Level": 40,
                          "Category": 0,
                          "Message": "Found 26 device entries"
                          }
                          ]
                          }
                          truenas#


                          IP属地:新疆14楼2021-09-03 23:48
                          回复
                            命令行运行
                            sudo docker run -d \
                            -v /mnt/Data/media/emby/config:/config \
                            -v /mnt/Data/media/movie:/mnt/move \
                            --device /dev/dri:/dev/dri \
                            -p 8096:8096 \
                            -p 8920:8920 \
                            -e UID=0 \
                            -e GID=0 \
                            -e GIDLIST=0,0 \
                            emby/embyserver:latest
                            truenas# dodockeexec -it 是Y sbin/ffdetect -hide_banner -show_program_version -loglevel 48 -show_error -show_log 40 vaencdec -print_format jsonn
                            #
                            truenas# dodocker exec -it 053bbdacd033 /bin/ffdetect -hide_banner -show_program_version -loglevel 48 -show_error -show_log 40 vaencdec -print_format json
                            ffdetect version 4.3.0-emby_2021_02_27 Copyright (c) 2018-2021 softworkz for Emby LLC
                            built with 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-debug --disable-doc --disable-ffplay --disable-vdpau --disable-xlib --enable-chromaprint --enable-fontconfig --enable-gnutls --enable-gpl --enable-iconv --enable-libass --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libzvbi --enable-pic --enable-version3 --enable-libx265 --enable-cuda-llvm --enable-cuvid --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'
                            libavutil 56. 36.100 / 56. 36.100
                            {
                            "ProgramVersion": {
                            "Version": "4.3.0-emby_2021_02_27",
                            "Copyright": "Copyright (c) 2018-2021 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-debug --disable-doc --disable-ffplay --disable-vdpau --disable-xlib --enable-chromaprint --enable-fontconfig --enable-gnutls --enable-gpl --enable-iconv --enable-libass --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libzvbi --enable-pic --enable-version3 --enable-libx265 --enable-cuda-llvm --enable-cuvid --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'"
                            },
                            "Devices": [
                            Begin GetVaAdapterInfo
                            Found 26 device entries
                            Begin get_nodes
                            Found 2 drm entries
                            Begin get_nodes
                            Found 2 drm entries
                            End GetVaAdapterInfo
                            {
                            "DeviceIndex": 0,
                            "DeviceInfo": {
                            "VendorName": "Matrox Electronics Systems Ltd.",
                            "DeviceName": "MGA G200eH3",
                            "SubsytemVendorName": "Hewlett Packard Enterprise",
                            "SubsytemDeviceName": "iLO5 VGA",
                            "VendorId": 4139,
                            "DeviceId": 1336,
                            "SubsytemVendorId": 5520,
                            "SubsytemDeviceId": 228,
                            "DevPath": "/sys/bus/pci/devices/0000:01:00.1",
                            "DrmCard": "/dev/dri/card0",
                            "IsEnabled": 1,
                            "IsBootVga": 1,
                            "Error": {
                            "Number": -1,
                            "Message": "Failed to open the drm device (null)"
                            }
                            }
                            },
                            {
                            "DeviceIndex": 1,
                            "DeviceInfo": {
                            "VendorName": "NVIDIA Corporation",
                            "DeviceName": "GK208B [GeForce GT 720]",
                            "SubsytemVendorName": "PC Partner Limited / Sapphire Technology",
                            "VendorId": 4318,
                            "DeviceId": 4744,
                            "SubsytemVendorId": 5963,
                            "SubsytemDeviceId": 12907,
                            "DevPath": "/sys/bus/pci/devices/0000:07:00.0",
                            "DrmCard": "/dev/dri/card1",
                            "DrmRender": "/dev/dri/renderD128",
                            "IsEnabled": 1,
                            "IsBootVga": 0,
                            "Error": {
                            "Number": -1,
                            "Message": "Failed to initialize VA /dev/dri/renderD128. Error -1"
                            }
                            }
                            }
                            ],
                            "Log": [
                            {
                            "Level": 40,
                            "Category": 0,
                            "Message": "Found 26 device entries"
                            }
                            ]
                            }
                            #
                            truenas#


                            IP属地:新疆15楼2021-09-04 00:14
                            回复
                              2026-03-01 15:42:14
                              广告
                              不感兴趣
                              开通SVIP免广告
                              兄弟们,docker 显卡初始化问题,上述错误中 Failed to initialize VA /dev/dri/renderD128. Error -1
                              不知道如何解决


                              IP属地:新疆16楼2021-09-04 00:58
                              收起回复