From e2786efb5cbed75effb96b535aa525c99f0a82a1 Mon Sep 17 00:00:00 2001 From: aptalca Date: Wed, 11 Mar 2020 15:42:50 -0400 Subject: [PATCH] add v4l2, remove transcode --- Dockerfile | 2 +- Dockerfile.aarch64 | 2 +- Dockerfile.armhf | 2 +- readme-vars.yml | 24 ++++++++++++++++++------ root/etc/cont-init.d/40-gid-video | 27 +++++++++------------------ 5 files changed, 30 insertions(+), 27 deletions(-) diff --git a/Dockerfile b/Dockerfile index f019fde..876e94d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,4 +47,4 @@ COPY root/ / # ports and volumes EXPOSE 8096 8920 -VOLUME /config /transcode +VOLUME /config diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 9438701..3ecc686 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -47,4 +47,4 @@ COPY root/ / # ports and volumes EXPOSE 8096 8920 -VOLUME /config /transcode +VOLUME /config diff --git a/Dockerfile.armhf b/Dockerfile.armhf index dedb2aa..262c282 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -50,4 +50,4 @@ COPY root/ / # ports and volumes EXPOSE 8096 8920 -VOLUME /config /transcode +VOLUME /config diff --git a/readme-vars.yml b/readme-vars.yml index 0c79546..614b150 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -24,9 +24,9 @@ common_param_env_vars_enabled: true #PGID, PUID, etc param_container_name: "{{ project_name }}" param_usage_include_vols: true param_volumes: - - { vol_path: "/config", vol_host_path: "", desc: "Jellyfin data storage location. *This can grow very large, 50gb+ is likely for a large collection.*" } - - { vol_path: "/data/tvshows", vol_host_path: "", desc: "Media goes here. Add as many as needed e.g. `/data/movies`, `/data/tv`, etc." } - - { vol_path: "/data/movies", vol_host_path: "", desc: "Media goes here. Add as many as needed e.g. `/data/movies`, `/data/tv`, etc." } + - { vol_path: "/config", vol_host_path: "/path/to/library", desc: "Jellyfin data storage location. *This can grow very large, 50gb+ is likely for a large collection.*" } + - { vol_path: "/data/tvshows", vol_host_path: "path/to/tvseries", desc: "Media goes here. Add as many as needed e.g. `/data/movies`, `/data/tv`, etc." } + - { vol_path: "/data/movies", vol_host_path: "/path/to/movies", desc: "Media goes here. Add as many as needed e.g. `/data/movies`, `/data/tv`, etc." } param_usage_include_ports: true param_ports: - { external_port: "8096", internal_port: "8096", port_desc: "Http webUI." } @@ -39,15 +39,17 @@ opt_param_env_vars: - { env_var: "UMASK_SET", env_value: "<022>", desc: "for umask setting of Emby, default if left unset is 022."} opt_param_usage_include_vols: true opt_param_volumes: - - { vol_path: "/transcode", vol_host_path: "", desc: "Path for transcoding folder, *optional*." } - { vol_path: "/opt/vc/lib", vol_host_path: "/opt/vc/lib", desc: "Path for Raspberry Pi OpenMAX libs *optional*." } opt_param_device_map: true opt_param_devices: - { device_path: "/dev/dri", device_host_path: "/dev/dri", desc: "Only needed if you want to use your Intel GPU for hardware accelerated video encoding (vaapi)." } - { device_path: "/dev/vchiq", device_host_path: "/dev/vchiq", desc: "Only needed if you want to use your Raspberry Pi OpenMax video encoding (Bellagio)." } + - { device_path: "/dev/video10", device_host_path: "/dev/video10", desc: "Only needed if you want to use your Raspberry Pi V4L2 video encoding." } + - { device_path: "/dev/video11", device_host_path: "/dev/video11", desc: "Only needed if you want to use your Raspberry Pi V4L2 video encoding." } + - { device_path: "/dev/video12", device_host_path: "/dev/video12", desc: "Only needed if you want to use your Raspberry Pi V4L2 video encoding." } opt_param_usage_include_ports: true opt_param_ports: - - { external_port: "8920", internal_port: "8920", port_desc: "Https webUI (you need to setup your own certificate)." } + - { external_port: "8920", internal_port: "8920", port_desc: "Https webUI (you need to set up your own certificate)." } # application setup block @@ -55,7 +57,7 @@ app_setup_block_enabled: true app_setup_block: | Webui can be found at `http://:8096` - More information can be found in their official documentation [here](https://github.com/MediaBrowser/Wiki/wiki) . + More information can be found in their official documentation [here](https://jellyfin.org/docs/general/quick-start.html) . ## Hardware Acceleration @@ -84,8 +86,18 @@ app_setup_block: | -v /opt/vc/lib:/opt/vc/lib ``` + ### V4L2 (Raspberry Pi) + + Hardware acceleration users for Raspberry Pi V4L2 will need to mount their /dev/video1X devices inside of the container by passing the following options when running or creating the container: + ``` + --device=/dev/video10:/dev/video10 + --device=/dev/video11:/dev/video11 + --device=/dev/video12:/dev/video12 + ``` + # changelog changelogs: + - { date: "11.03.20:", desc: "Add v4l2 support on Raspberry Pi; remove optional transcode mapping (location is selected in the gui, defaults to path under `/config`)." } - { date: "30.01.20:", desc: "Add nightly tag." } - { date: "09.01.20:", desc: "Add Pi OpenMax support." } - { date: "02.10.19:", desc: "Improve permission fixing for render & dvb devices." } diff --git a/root/etc/cont-init.d/40-gid-video b/root/etc/cont-init.d/40-gid-video index 9ebcb11..3c81fdc 100644 --- a/root/etc/cont-init.d/40-gid-video +++ b/root/etc/cont-init.d/40-gid-video @@ -1,33 +1,24 @@ #!/usr/bin/with-contenv bash -FILES=$(find /dev/dri /dev/dvb /dev/vchiq -type c -print 2>/dev/null) +FILES=$(find /dev/dri /dev/dvb /dev/vchiq /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 - touch /groupadd - else - if [ ! "${VIDEO_GID}" == '0' ]; 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 - touch /groupadd + 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 -if [ -n "${FILES}" ] && [ ! -f "/groupadd" ]; then - usermod -a -G root abc -fi - # 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 +fi