Jump to content

How to configure hardware transcoding of a video


Go to solution Solved by Q-Droid,

Recommended Posts

3032834864
Posted (edited)

Here's my yml file,I only have Intel's CPU with integrated graphics,How should I change the docker-compose.yml file to activate hardware transcoding?

version: "2.3"
volumes:
  emby:
services:
  emby:
    image: emby/embyserver
    container_name: embyserver
    ###runtime: nvidia # Expose NVIDIA GPUs
    network_mode: host # Enable DLNA and Wake-on-Lan
    environment:
      - UID=${DATA_USE_ID} # The UID to run emby as (default: 2)
      - GID=${DATA_GROUP_ID} # The GID to run emby as (default 2)
      - GIDLIST=39,998#${DATA_GROUP_ID} # A comma-separated list of additional GIDs to run emby as (default: 2)
    volumes:
      - ${ALL_CONFIG}/emby:/config # Configuration directory
      - ${EMBY_DATAS}:/mnt
      - /etc/localtime:/etc/localtime:ro
      - ${SERVER_CRTS}:/ssl/:ro
    ports:
      - ${EMBY_PORT}:8096 # HTTP port
      - ${EMBY_PORTS}:8920 # HTTPS port
    devices:
      - /dev/dri:/dev/dri 
      ##- /dev/vchiq:/dev/vchiq # MMAL/OMX on Raspberry Pi
    restart: on-failure

 

Edited by 3032834864
Q-Droid
Posted

It depends.

3032834864
Posted
2 hours ago, 3032834864 said:
localtime

Or what are the options? For example, what else can runtime fill in other than NVIDIA? And devices?

Q-Droid
Posted

You didn't post which Intel CPU/iGPU you have and some don't work.

For starters make sure the values in the GIDLIST are the actual values for the video and render groups GIDs on the host. If you're using network_mode: host then it won't accept the ports mapping, it might even throw an error. As for the HW accel for transcoding the devices entry is correct. The runtime entry is for NVIDIA and vchiq for RPi and those should stay commented out.

 

3032834864
Posted (edited)
流媒体
MKV (11 mbps)
HLS (16 mbps 75 fps)
将视频转换为兼容的编解码器
将音频转换为兼容的编解码器
视频
1080p HEVC
Main 10 120 11 mbps 23.976 fps
转码 (H264 16 mbps)
Dropped Frames
0
音频
Japanese DTS-HD MA 7.1 (默认)
48000 Hz
转码 (MP3 192 kbps)
[root@localhost dri]# pwd
/dev/dri
[root@localhost dri]# ls
by-path  card0  renderD128
[root@localhost dri]# 

Does this turn on hardware decoding?

"/dev/dri" Dock can be accessed

Edited by 3032834864
Q-Droid
Posted

Check in Manage Emby Server -> Transcoding and change Enable list to Advanced to see if HW is active. Look in the hardware detection log and ffmpeg logs from playback sessions to see if it's using HW accel.

 

3032834864
Posted
 
{"Protocol":"File","Id":"27c753c0e51001af502f61368a9d7d82","Path":"/mnt/sdd/MOVE/甲铁城的卡巴内里 总集篇 前篇 聚集的光芒 (2016)/甲铁城的卡巴内里 总集篇 前篇 聚集的光芒 1080p h265.mkv","Type":"Default","Container":"mkv","Size":10229338667,"Name":"甲铁城的卡巴内里 总集篇 前篇 聚集的光芒 1080p h265","IsRemote":false,"HasMixedProtocols":false,"RunTimeTicks":64394350000,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"RequiresClosing":false,"RequiresLooping":false,"SupportsProbing":false,"MediaStreams":[{"Codec":"hevc","Language":"jpn","ColorTransfer":"bt709","TimeBase":"1/1000","VideoRange":"SDR","DisplayTitle":"1080p HEVC","DisplayLanguage":"Japanese","IsInterlaced":false,"BitRate":12708367,"BitDepth":10,"RefFrames":1,"IsDefault":true,"IsForced":false,"IsHearingImpaired":false,"Height":1080,"Width":1920,"AverageFrameRate":23.976025,"RealFrameRate":23.976025,"Profile":"Main 10","Type":"Video","AspectRatio":"16:9","Index":0,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","PixelFormat":"yuv420p10le","Level":120,"IsAnamorphic":false,"ExtendedVideoType":"None","ExtendedVideoSubType":"None","ExtendedVideoSubTypeDescription":"None","AttachmentSize":0},{"Codec":"flac","Language":"jpn","TimeBase":"1/1000","Title":"FLAC 2ch","DisplayTitle":"Japanese FLAC stereo (默认)","DisplayLanguage":"Japanese","IsInterlaced":false,"ChannelLayout":"stereo","BitDepth":24,"Channels":2,"SampleRate":48000,"IsDefault":true,"IsForced":false,"IsHearingImpaired":false,"Type":"Audio","Index":1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","ExtendedVideoType":"None","ExtendedVideoSubType":"None","ExtendedVideoSubTypeDescription":"None","AttachmentSize":0},{"Codec":"dts","Language":"jpn","TimeBase":"1/1000","Title":"DTS-HDMA 5.1ch","DisplayTitle":"Japanese DTS-HD MA 5.1","DisplayLanguage":"Japanese","IsInterlaced":false,"ChannelLayout":"5.1","BitDepth":24,"Channels":6,"SampleRate":48000,"IsDefault":false,"IsForced":false,"IsHearingImpaired":false,"Profile":"DTS-HD MA","Type":"Audio","Index":2,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","ExtendedVideoType":"None","ExtendedVideoSubType":"None","ExtendedVideoSubTypeDescription":"None","AttachmentSize":0},{"Codec":"ass","Language":"sc","DisplayTitle":"Sardinian (ASS)","DisplayLanguage":"Sardinian","IsInterlaced":false,"IsDefault":false,"IsForced":false,"IsHearingImpaired":false,"Type":"Subtitle","Index":3,"IsExternal":true,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Path":"/mnt/sdd/MOVE/甲铁城的卡巴内里 总集篇 前篇 聚集的光芒 (2016)/甲铁城的卡巴内里 总集篇 前篇 聚集的光芒 1080p h265.srd.ass","Protocol":"File","ExtendedVideoType":"None","ExtendedVideoSubType":"None","ExtendedVideoSubTypeDescription":"None","AttachmentSize":0}],"Formats":[],"Bitrate":12708367,"RequiredHttpHeaders":{},"AddApiKeyToDirectStreamUrl":false,"ReadAtNativeFramerate":false,"ItemId":"466"}
 
>>>>>> User policy for emby_admin
Enable Playback Remuxing: True
Enable Video Playback Transcoding: True
Enable Audio Playback Transcoding: True
 
>>>>>> Hardware Encoders for h264
[X] VAAPI Xeon E3-1200 v3 Processor Integrated - H.264 (AVC)
 
>>>>>> Selected Codecs
Decoder Automatic software decoder

Looks like hardware decoding is enabled? My on-premise emby will show a green flag, but not in docker...

Is it because of a version issue?

Q-Droid
Posted

If your CPU really is a Haswell then it's too old to decode HEVC/h265. 

 

 

3032834864
Posted

If my log name is hardware_detection-XXX , instead of ffmpeg-transcodeXXX, Does it mean that the hard decoding has taken effect?

What else is there to tell if the hard decoding is in effect?

  • Solution
Q-Droid
Posted

Hardware detection is done by the server on startup to detect capabilities. It will log what's detected. 

Ffmpeg-xxx is generated during playback and conversion and will log the type and method used.

If you have the diagnostics plugin installed the user sessions section in the management console also shows playback and transcoding details while the sessions are actively streaming. 

 

3032834864
Posted (edited)

The video is 1080p H264,I don't think the hardware transcoding is working,User sessions in my Admin console look like this

正在播放


紫罗兰永恒花园外传:永远与自动手记人偶
2019
0:07 / 1:30:39

Emby 网页版 4.8.7.0
Chrome Windows
192.168.0.13 http/1.1
流媒体
MKV (5 mbps)
直接播放
视频
1080p 高264
直接播放 (5 Mbps)
音频
Japanese FLAC stereo (默认)
直接播放

Logs are also attached

hardware_detection-63852224789.txt

Edited by 3032834864
3032834864
Posted

I see, my CPU really doesn't support H.265, only when you change the video quality when playing an H.264 video, which green sign will be displayed

  • 2 weeks later...
3032834864
Posted
1 hour ago, Luke said:

@3032834864have your questions been answered?

yes

  • Thanks 1

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