Skip to content

Videos: Improve hardware transcoding on Synology NAS devices #2228

@sunbeam60

Description

@sunbeam60

On Synology NAS devices (and possibly other setups, /dev/dri/renderD128 has permissions 'u=rw,g=,o=' and is owned by user "videodriver".

This configuration prevents hardware transcoding using h264_qsv as the VAAPI device cannot be unless the Synology user runs the docker package as root:

/usr/bin/ffmpeg -qsv_device /dev/dri/renderD128 -i /photoprism/originals/2022/02/27/IMG_8370.MOV -c:a aac -vf format=rgb32 -c:v h264_qsv -vsync vfr -r 30 -b:v 25M -maxrate 25M -f mp4 -y /photoprism/storage/sidecar/2022/02/27/IMG_8370.MOV.avc"
[SNIP]
Failed to create a VAAPI device

If the file permissions for /dev/dri/renderD128 inside the container is set to 'u=rw,g=rw,o=rw', PhotoPrism's invocation of ffmpeg with h264_qsv succeeds.

This is a common issue for docker containers using hardware transcoding and it seems the common pattern it to iterate across the dev/dri/render devices, ensuring groups have rw rights and adding whatever group the docker's user belongs to as group owners.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementEnhancement or improvement of an existing featurereleasedAvailable in the stable releasevideoVideo Formats, Transcoding, FFmpeg, Streaming & Co

    Type

    No type

    Projects

    Status

    Release 🌈

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions