From 1af6cc6b542c0baf1c204763fbe6645dc765ce22 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Fri, 18 Jul 2025 19:27:06 +0200 Subject: [PATCH] ErsatzTV: use project prebuild ffmpeg version (#6067) --- ct/ersatztv.sh | 28 ++++++++++++++++++++++++++-- install/ersatztv-install.sh | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 56 insertions(+), 4 deletions(-) diff --git a/ct/ersatztv.sh b/ct/ersatztv.sh index e11739826f..8c2ff5d331 100644 --- a/ct/ersatztv.sh +++ b/ct/ersatztv.sh @@ -26,13 +26,14 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/ErsatzTV/ErsatzTV/releases | grep -oP '"tag_name": "\K[^"]+' | head -n 1) + RELEASE=$(curl -fsSL https://api.github.com/repos/ErsatzTV/ErsatzTV/releases | grep -oP '"tag_name": "\Kv\K[^"]+' | head -n1) + RELEASE_FFMPEG=$(curl -fsSL https://api.github.com/repos/ErsatzTV/ErsatzTV-ffmpeg/releases | grep -oP '"tag_name": "\K[^"]+' | head -n 1) + if [[ "${RELEASE}" != "$(cat ~/.ersatztv 2>/dev/null)" ]] || [[ ! -f ~/.ersatztv ]]; then msg_info "Stopping ErsatzTV" systemctl stop ersatzTV msg_ok "Stopped ErsatzTV" - FFMPEG_VERSION="latest" FFMPEG_TYPE="medium" setup_ffmpeg fetch_and_deploy_gh_release "ersatztv" "ErsatzTV/ErsatzTV" "prebuild" "latest" "/opt/ErsatzTV" "*linux-x64.tar.gz" msg_info "Starting ErsatzTV" @@ -43,6 +44,29 @@ function update_script() { else msg_ok "No update required. ${APP} is already at ${RELEASE}" fi + + if [[ "${RELEASE_FFMPEG}" != "$(cat ~/.ersatztv-ffmpeg 2>/dev/null)" ]] || [[ ! -f ~/.ersatztv-ffmpeg ]]; then + msg_info "Stopping ErsatzTV" + systemctl stop ersatzTV + msg_ok "Stopped ErsatzTV" + + fetch_and_deploy_gh_release "ersatztv-ffmpeg" "ErsatzTV/ErsatzTV-ffmpeg" "prebuild" "latest" "/opt/ErsatzTV-ffmpeg" "*-linux64-gpl-7.1.tar.xz" + + msg_info "Set ErsatzTV-ffmpeg links" + chmod +x /opt/ErsatzTV-ffmpeg/bin/* + ln -sf /opt/ErsatzTV-ffmpeg/bin/ffmpeg /usr/local/bin/ffmpeg + ln -sf /opt/ErsatzTV-ffmpeg/bin/ffplay /usr/local/bin/ffplay + ln -sf /opt/ErsatzTV-ffmpeg/bin/ffprobe /usr/local/bin/ffprobe + msg_ok "ffmpeg links set" + + msg_info "Starting ErsatzTV" + systemctl start ersatzTV + msg_ok "Started ErsatzTV" + + msg_ok "Updated Successfully" + else + msg_ok "No update required. ErsatzTV-ffmpeg is already at ${RELEASE_FFMPEG}" + fi exit } diff --git a/install/ersatztv-install.sh b/install/ersatztv-install.sh index 728a0fdc3a..4c930bb952 100644 --- a/install/ersatztv-install.sh +++ b/install/ersatztv-install.sh @@ -13,8 +13,6 @@ setting_up_container network_check update_os -FFMPEG_VERSION="latest" FFMPEG_TYPE="full" setup_ffmpeg - msg_info "Setting Up Hardware Acceleration" $STD apt-get -y install {va-driver-all,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools} if [[ "$CTTYPE" == "0" ]]; then @@ -26,7 +24,37 @@ if [[ "$CTTYPE" == "0" ]]; then fi msg_ok "Set Up Hardware Acceleration" +read -r -p "${TAB3}Do you need the intel-media-va-driver-non-free driver for HW encoding (Debian 12 only)? " prompt +if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then + msg_info "Installing Intel Hardware Acceleration (non-free)" + cat </etc/apt/sources.list.d/non-free.list + +deb http://deb.debian.org/debian bookworm non-free non-free-firmware +deb-src http://deb.debian.org/debian bookworm non-free non-free-firmware + +deb http://deb.debian.org/debian-security bookworm-security non-free non-free-firmware +deb-src http://deb.debian.org/debian-security bookworm-security non-free non-free-firmware + +deb http://deb.debian.org/debian bookworm-updates non-free non-free-firmware +deb-src http://deb.debian.org/debian bookworm-updates non-free non-free-firmware +EOF + $STD apt-get update + $STD apt-get -y install {intel-media-va-driver-non-free,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools} +else + msg_info "Installing Intel Hardware Acceleration" + $STD apt-get -y install {va-driver-all,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools} +fi +msg_ok "Installed and Set Up Intel Hardware Acceleration" + fetch_and_deploy_gh_release "ersatztv" "ErsatzTV/ErsatzTV" "prebuild" "latest" "/opt/ErsatzTV" "*linux-x64.tar.gz" +fetch_and_deploy_gh_release "ersatztv-ffmpeg" "ErsatzTV/ErsatzTV-ffmpeg" "prebuild" "latest" "/opt/ErsatzTV-ffmpeg" "*-linux64-gpl-7.1.tar.xz" + +msg_info "Set ErsatzTV-ffmpeg links" +chmod +x /opt/ErsatzTV-ffmpeg/bin/* +ln -sf /opt/ErsatzTV-ffmpeg/bin/ffmpeg /usr/local/bin/ffmpeg +ln -sf /opt/ErsatzTV-ffmpeg/bin/ffplay /usr/local/bin/ffplay +ln -sf /opt/ErsatzTV-ffmpeg/bin/ffprobe /usr/local/bin/ffprobe +msg_ok "ffmpeg links set" msg_info "Creating Service" cat </etc/systemd/system/ersatzTV.service