homebridge/ffmpeg-for-homebridge

VAAPI HW Acceleration - Synology Docker

AdiAbuAli opened this issue · 4 comments

Describe The Bug:

Am using mrlt8_Wyze_bridge, which intuen use FFMPEG for homebridge in Synology DS720+ Docker.
When I tries to customize the command to use VAAPI for HW accelartion, I got device creation failed -12 from FFMPEG.
I defined device in docker yml to be "device" = "/dev/dri/:/dev/dri"
And grant cmod 444 RenderD128
And installed vainfo, and checked the output and I can see VAAPI for i965 defined in docker container.
Also I defined in environment LIBVA_DRIVER_NAME=i965
But still all failed.

root@mrlt8-wyze-bridge_dev:/# ls -la /dev/dri
total 0
drwxr-xr-x 2 root root 80 Nov 13 23:34 .
drwxr-xr-x 13 root root 13860 Nov 13 23:34 ..
crw------- 1 root root 226, 0 Nov 13 23:34 card0
crw-rw---- 1 root 937 226, 128 Nov 13 23:34 renderD128

root@mrlt8-wyze-bridge_dev:/# vainfo
error: XDG_RUNTIME_DIR not set in the environment.
error: can't connect to X server!
libva info: VA-API version 1.4.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_4
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.4 (libva 2.4.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Gemini Lake - 2.3.0
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointEncSliceLP
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointEncSliceLP
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointEncPicture
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointVLD

To Reproduce:

FFMPEG -hide_banner -loglevel info -hwaccel vaapi -hwaccel_output_format vaapi -hwaccel_device /dev/dri/renderD128 -flags low_delay -fflags +genpts -i - -c:a copy -c:v libx264 -tune zerolatency -preset slow -coder ac -b:v 820K -crf 23 -maxrate 1920K -bufsize 4M -rtsp_transport tcp -f rtsp rtsp://0.0.0.0:8554

Expected behavior:

FFMPEG to start HW transcode the stream.
ffmpeg output:
device creation failed -12

Run `ffmpeg` in a terminal window and post the output below

Screenshots:

Screenshot_20211122-015104_Samsung Internet

Environment:
{
"CapAdd" : [],
"CapDrop" : [],
"cmd" : "python3 /app/wyze_bridge.py",
"cpu_priority" : 90,
"device" : "/dev/dri/:/dev/dri/",
"enable_publish_all_ports" : false,
"enable_restart_policy" : true,
"enabled" : true,
"env_variables" : [
{
"key" : "LIBVA_DRIVER_NAME",
"value" : "i965"
},
{
"key" : "PATH",
"value" : "/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
},
{
"key" : "LANG",
"value" : "C.UTF-8"
},
{
"key" : "GPG_KEY",
"value" : "E3FF2839C048B25C084DEBE9B26995E310250568"
},
{
"key" : "PYTHON_VERSION",
"value" : "3.9.8"
},
{
"key" : "PYTHON_PIP_VERSION",
"value" : "21.2.4"
},
{
"key" : "PYTHON_SETUPTOOLS_VERSION",
"value" : "57.5.0"
},
{
"key" : "PYTHON_GET_PIP_URL",
"value" : "https://github.com/pypa/get-pip/raw/3cb8888cc2869620f57d5d2da64da38f516078c7/public/get-pip.py"
},
{
"key" : "PYTHON_GET_PIP_SHA256",
"value" : "c518250e91a70d7b20cceb15272209a4ded2a0c263ae5776f129e0d9b5674309"
},
{
"key" : "PYTHONUNBUFFERED",
"value" : "1"
},
{
"key" : "RTSP_PROTOCOLS",
"value" : "tcp"
},
{
"key" : "RTSP_READTIMEOUT",
"value" : "30s"
},
{
"key" : "RTSP_READBUFFERCOUNT",
"value" : "4096"
},
{
"key" : "RTSP_LOGLEVEL",
"value" : "warn"
},
{
"key" : "SDK_KEY",
"value" : "AQAAADQA6XDOFkuqH88f65by3FGpOiz2Dm6VtmRcohNFh/rK6OII97hoGzIJJv/qRjS3EDx17r7hKtmDA/a6oBLGOTC5Gml7PgFGe26VYBaZqQF34BwIwAMQX7BGsONLW8cqQbdI5Nm560hm50N6cYfT2YpE9ctsv5vP5S49Q5gg864IauaY3NuO1e9ZVOvJyLcIJqJRy95r4fMkTAwXZiQuFDAb"
},
{
"key" : "RTSP_API",
"value" : "Yes"
},
{
"key" : "RTSP_APIADDRESS",
"value" : "0.0.0.0:9997"
},
{
"key" : "RTSP_PPROF",
"value" : "Yes"
},
{
"key" : "RTSP_READBUFFERSIZE",
"value" : "65536"
},
{
"key" : "FRESH_DATA",
"value" : "True"
},
{
"key" : "FFMPEG_CMD",
"value" : "-loglevel error -use_wallclock_as_timestamps 1 -fflags +genpts -flags low_delay -i - -c copy -rtsp_transport tcp -f rtsp rtsp://0.0.0.0:8554"
},
{
"key" : "MQTT_HOST",
"value" : "False"
},
{
"key" : "WYZE_EMAIL",
"value" : "adi.abuali@yahoo.com"
},
{
"key" : "WYZE_PASSWORD",
"value" : "Alborg2001!"
},
{
"key" : "NET_MODE",
"value" : "LAN"
},
{
"key" : "QUALITY",
"value" : "HD120"
},
{
"key" : "RTSP_RTMPDISABLE",
"value" : "Yes"
},
{
"key" : "RTSP_HLSDISABLE",
"value" : "Yes"
},
{
"key" : "TZ",
"value" : "Asia/Amman"
}
],
"exporting" : false,
"id" : "745a134d7ea9e1414cbe0c1204509a43dfc5c9322bd8abeee9976658cb36bf2b",
"image" : "mrlt8-wyze-bridge_dev:20211120",
"is_ddsm" : false,
"is_package" : false,
"links" : [],
"memory_limit" : 6442450944,
"memory_limit_slider" : 6144,
"name" : "mrlt8-wyze-bridge_dev",
"network" : [
{
"driver" : "bridge",
"name" : "bridge"
}
],
"network_mode" : "bridge",
"port_bindings" : [
{
"container_port" : 8554,
"host_port" : 8554,
"type" : "tcp"
},
{
"container_port" : 9997,
"host_port" : 9997,
"type" : "tcp"
},
{
"container_port" : 9999,
"host_port" : 9999,
"type" : "tcp"
}
],
"privileged" : true,
"shortcut" : {
"enable_shortcut" : false,
"enable_status_page" : false,
"enable_web_page" : false,
"web_page_url" : ""
},
"use_host_network" : false,
"volume_bindings" : []
}

  • Operating System:
  • Docker 20.10.3 -1239 over Synology DS720J+ (DSM 7.1)
    Intel Celeron J4125, 4 core, 2Ghz burst upto 2.7

Any help pr update?

Can you please enable VAAPI/INTEL HW ACCELERATION?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been closed as no further activity has occurred.