Files
docker-jellyfin/root/etc/cont-init.d/40-gid-video
aptalca 3e7e072fc8 enable rpi hw decode, readme updates
also create missing default transcodes folder
2020-04-11 14:52:12 -04:00

25 lines
729 B
Plaintext

#!/usr/bin/with-contenv bash
FILES=$(find /dev/dri /dev/dvb /dev/vchiq /dev/vc-mem /dev/video1? -type c -print 2>/dev/null)
for i in $FILES
do
VIDEO_GID=$(stat -c '%g' "$i")
if ! id -G abc | grep -qw "$VIDEO_GID"; then
VIDEO_NAME=$(getent group "${VIDEO_GID}" | awk -F: '{print $1}')
if [ -z "${VIDEO_NAME}" ]; then
VIDEO_NAME="video$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c8)"
groupadd "$VIDEO_NAME"
groupmod -g "$VIDEO_GID" "$VIDEO_NAME"
fi
usermod -a -G "$VIDEO_NAME" abc
fi
done
# openmax lib loading
if [ -e "/opt/vc/lib" ] && [ ! -e "/etc/ld.so.conf.d/00-vmcs.conf" ]; then
echo "[jellyfin-init] Pi Libs detected loading"
echo "/opt/vc/lib" > "/etc/ld.so.conf.d/00-vmcs.conf"
ldconfig
fi