{"id":308,"date":"2025-01-02T12:00:36","date_gmt":"2025-01-02T05:00:36","guid":{"rendered":"https:\/\/prosindo.com\/blog\/?p=308"},"modified":"2025-01-02T12:00:36","modified_gmt":"2025-01-02T05:00:36","slug":"using-vaapi-in-lxc-unprivileged-container-proxmox-ve-7-1-zoneminder","status":"publish","type":"post","link":"https:\/\/prosindo.com\/blog\/2025\/01\/02\/using-vaapi-in-lxc-unprivileged-container-proxmox-ve-7-1-zoneminder\/","title":{"rendered":"Using VAAPI in LXC Unprivileged Container Proxmox VE 7.1 Zoneminder"},"content":{"rendered":"\n<p># run &#8216;getent group render&#8217; both in container and host<br>container 108<br>host 103<br><br># host: add line at \/etc\/subgid<br>root:103:1<br><br># calculate mapping:<br>map 0..107 ct to 100000..100107 host<br>map 108 ct to 103 host<br>map 109.. ct to 100109..<br><br># host: add to lxc config \/etc\/pve\/lxc\/101.conf<br># proxmox 7 use cgroup2 &#8211; https:\/\/pve.proxmox.com\/wiki\/Upgrade_from_6.x_to_7.0#CGroupV2<br>lxc.idmap: u 0 100000 65536<br>lxc.idmap: g 0 100000 108<br>lxc.idmap: g 108 103 1<br>lxc.idmap: g 109 100109 65427<br>lxc.cgroup.devices.allow: c 226:128 rwm<br>lxc.mount.entry: \/dev\/dri\/renderD128 dev\/dri\/renderD128 none bind,optional,create=file<br><br># should be working, else force it on host :-p<br><code>chmod 0666 \/dev\/dri\/renderD128<\/code><br><br># check at the container:<br><code>$ ls -ln \/dev\/dri\/renderD128<\/code><br>crw-rw&#8212;- 1 65534 108 226, 128 Dec 23 01:25 \/dev\/dri\/renderD128<br><br><code>$ sudo usermod -aG render zmuser<br>$ sudo usermod -aG render www-data<\/code><\/p>\n\n\n\n<p># DO NOT FORGET to restart after add user to group, its IMPORTANT!<\/p>\n\n\n\n<p><code>$ cat \/dev\/dri\/renderD128<\/code><\/p>\n\n\n\n<p><code>$ sudo apt install vainfo i965-va-driver<\/code><\/p>\n\n\n\n<p># container: Try using ffmpeg to decode h264<br><code>$ ffmpeg -v verbose -y -hwaccel vaapi -hwaccel_device \/dev\/dri\/renderD128 -i rtsp:\/\/&lt;user>:&lt;pass>@&lt;ip>:554\/stream2 result.mp4<\/code><\/p>\n\n\n\n<p># container: Try using ffmpeg to decode and encode h264<br><code>$ ffmpeg -v verbose -y -hwaccel vaapi -hwaccel_device \/dev\/dri\/renderD128 -i rtsp:\/\/&lt;user>:&lt;pass>@&lt;ip>:554\/stream2 -c:v h264_vaapi -qp 25 result.mp4<\/code><\/p>\n\n\n\n<p># container: Check GPU Utilization at Host:<br><code>$ sudo apt install intel-gpu-tools<br>$ sudo intel_gpu_top<\/code><\/p>\n\n\n\n<p>For Zoneminder FFMPEG, crf option not available for h264_vaapi<br>So, set this option: recording -> encoder: h264_vaapi, optional encoder parameters:<code> qp=25<\/code><\/p>\n\n\n\n<p>https:\/\/yoursunny.com\/t\/2022\/lxc-vaapi\/<br>https:\/\/pve.proxmox.com\/wiki\/Unprivileged_LXC_containers<br>https:\/\/itsembedded.com\/sysadmin\/proxmox_bind_unprivileged_lxc\/<br>https:\/\/trac.ffmpeg.org\/wiki\/Hardware\/QuickSync<br>https:\/\/trac.ffmpeg.org\/wiki\/Hardware\/VAAPI<br>https:\/\/forums.zoneminder.com\/viewtopic.php?t=30820<br>https:\/\/github.com\/intel\/intel-vaapi-driver\/blob\/master\/README<\/p>\n","protected":false},"excerpt":{"rendered":"<p># run &#8216;getent group render&#8217; both in container and hostcontainer 108host 103 # host: add line at \/etc\/subgidroot:103:1 # calculate mapping:map 0..107 ct to 100000..100107 hostmap 108 ct to 103 hostmap 109.. ct to 100109.. # host: add to lxc config \/etc\/pve\/lxc\/101.conf# proxmox 7 use cgroup2 &#8211; https:\/\/pve.proxmox.com\/wiki\/Upgrade_from_6.x_to_7.0#CGroupV2lxc.idmap: u 0 100000 65536lxc.idmap: g 0 100000 &hellip; <a href=\"https:\/\/prosindo.com\/blog\/2025\/01\/02\/using-vaapi-in-lxc-unprivileged-container-proxmox-ve-7-1-zoneminder\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Using VAAPI in LXC Unprivileged Container Proxmox VE 7.1 Zoneminder&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-308","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/prosindo.com\/blog\/wp-json\/wp\/v2\/posts\/308","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prosindo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prosindo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prosindo.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prosindo.com\/blog\/wp-json\/wp\/v2\/comments?post=308"}],"version-history":[{"count":14,"href":"https:\/\/prosindo.com\/blog\/wp-json\/wp\/v2\/posts\/308\/revisions"}],"predecessor-version":[{"id":470,"href":"https:\/\/prosindo.com\/blog\/wp-json\/wp\/v2\/posts\/308\/revisions\/470"}],"wp:attachment":[{"href":"https:\/\/prosindo.com\/blog\/wp-json\/wp\/v2\/media?parent=308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prosindo.com\/blog\/wp-json\/wp\/v2\/categories?post=308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prosindo.com\/blog\/wp-json\/wp\/v2\/tags?post=308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}