Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
revenz committed Sep 13, 2024
2 parents d4f6390 + 4b6b6cb commit f2d4dfe
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 3 deletions.
89 changes: 89 additions & 0 deletions DockerMods/FFmpeg7-experimental.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# ----------------------------------------------------------------------------------------------------
# Name: FFmpeg7-experimental
# Description: FFmpeg7 is an experimental build, currently you can only install either FFmpeg6 or FFmpeg7
# Author: John Andrews / Lawrence
# Revision: 1
# Icon: data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyNi4wLjEsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCAyMDAwIDIwMDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDIwMDAgMjAwMDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4NCgkuc3Qwe2ZpbGw6bm9uZTtzdHJva2U6IzM3OEU0MztzdHJva2Utd2lkdGg6MzAwO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDo4O30NCjwvc3R5bGU+DQo8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1LDUpIj4NCgk8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMTY2LjcsMTY2LjdoNTUyLjJMMTY2LjcsNzE4Ljl2NTUyLjJMMTI3MS4xLDE2Ni43aDU1Mi4yTDE2Ni43LDE4MjMuM2g1NTIuMkwxODIzLjMsNzE4Ljl2NTUyLjJsLTU1Mi4yLDU1Mi4yDQoJCWg1NTIuMiIvPg0KPC9nPg0KPC9zdmc+DQo=
# ----------------------------------------------------------------------------------------------------

#!/bin/bash

# Function to handle errors
function handle_error {
echo "An error occurred. Exiting..."
exit 1
}

# Check if the --uninstall option is provided
if [ "$1" == "--uninstall" ]; then
echo "Uninstalling FFmpeg and removing Jellyfin repository..."
# Remove symbolic links
rm -f /usr/local/bin/ffmpeg
rm -f /usr/local/bin/ffprobe

# Uninstall Jellyfin FFmpeg
if apt-get remove --purge -y jellyfin-ffmpeg7; then
echo "Jellyfin FFmpeg successfully uninstalled."
else
handle_error
fi

# Remove Jellyfin repository
rm -f /etc/apt/sources.list.d/jellyfin.list

# Remove Jellyfin GPG key
gpg --keyring /etc/apt/trusted.gpg.d/debian-jellyfin.gpg --batch --yes --delete-key "$(gpg --list-keys --keyring /etc/apt/trusted.gpg.d/debian-jellyfin.gpg --batch | grep -B 1 'Jellyfin Team' | head -n 1 | awk '{print $1}')"
rm -f "/etc/apt/trusted.gpg.d/debian-jellyfin.gpg"
rm -f "/etc/apt/trusted.gpg.d/debian-jellyfin.gpg~"

# Update package lists
if ! apt-get update; then
handle_error
fi

echo "Uninstallation complete."
exit 0
fi

# Check if FFmpeg is installed
if command -v ffmpeg &>/dev/null; then
echo "FFmpeg is already installed."
exit 0
fi

architecture=$(uname -m)
echo "Architecture: $architecture"

if [ "$architecture" != "x86_64" ] && [ "$architecture" != "armv7l" ] && [ "$architecture" != "aarch64" ] && [[ ! "$architecture" =~ [Aa][Rr][Mm] ]]; then
echo "The architecture is not recognized as AMD or ARM: $architecture."
exit 1
fi

echo "The architecture is recognized."

# Add Jellyfin GPG key with a timeout of 15 seconds
if ! curl -m 15 -fsSL https://repo.jellyfin.org/debian/jellyfin_team.gpg.key | gpg --dearmor --batch --yes -o /etc/apt/trusted.gpg.d/debian-jellyfin.gpg; then
handle_error
fi

# Add Jellyfin repository
os_id=$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release)
os_codename=$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)
echo "deb [arch=$(dpkg --print-architecture)] https://repo.jellyfin.org/$os_id $os_codename main" | tee /etc/apt/sources.list.d/jellyfin.list

# Update package lists again
if ! apt-get update; then
handle_error
fi

# Install Jellyfin FFmpeg
if ! apt-get install --no-install-recommends --no-install-suggests -y jellyfin-ffmpeg7; then
handle_error
fi

# Create symbolic links
ln -s /usr/lib/jellyfin-ffmpeg/ffmpeg /usr/local/bin/ffmpeg
ln -s /usr/lib/jellyfin-ffmpeg/ffprobe /usr/local/bin/ffprobe

echo "FFmpeg installation and setup complete."
exit 0
4 changes: 2 additions & 2 deletions Scripts/Flow/Video/Video - Devedse - RunAbAv1.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Video - Devedse - InstallAbAv1.js
* Executes the ab-av1 command.
* @author Devedse
* @revision 6
* @revision 7
* @uid 4b2d95ff-0b20-4be2-b945-e6efd8099feb
* @param {string} Preset The preset to use
* @param {string} SvtArguments The --svt arguments to pass to AbAv1. Only use if using SVT-AV1 encoder
Expand Down Expand Up @@ -93,7 +93,7 @@ function Script(Preset,SvtArguments,Encoder,PixFormat,MinVmaf,MaxEncodedPercent,

// Parse the output to find the CRF value
let output = executeAbAv1.output;
let crfValueMatch = output.match(/crf (\d+\.?\d*) VMAF.*predicted video stream size/);
let crfValueMatch = output.match(/ab_av1::command::crf_search\] crf (\d+\d) successful/);
Logger.ILog('crf: ' + crfValueMatch);
if (crfValueMatch && crfValueMatch.length > 1) {
let crfValue = crfValueMatch[1];
Expand Down
9 changes: 9 additions & 0 deletions docker-mods.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,14 @@
"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uOTk1LDM5LjgzMSwxNCwzNy4xOTQsMTRoLTMuNjMydjUuMTA0YzAsMi45NjYtMi42ODYsNS44OTYtNS43NjQsNS44OTZoLTcuMjM2Yy0yLjUyMywwLTUsMS44NjItNSw0LjM3N3Y4LjU4NmMwLDIuNDM5LDEuNzU5LDQuMjYzLDQuMjE4LDQuNjcyQzE5LjcxOSw0Mi42NDEsMjEuNTM2LDQzLjAwNiwyMy4wNzgsNDN6IE0yOC4wNjMsMzljLTAuODIxLDAtMS41LTAuNjc3LTEuNS0xLjUwMmMwLTAuODMzLDAuNjc5LTEuNDk4LDEuNS0xLjQ5OGMwLjgzNywwLDEuNSwwLjY2NCwxLjUsMS40OThDMjkuNTYzLDM4LjMyLDI4Ljg5OSwzOSwyOC4wNjMsMzl6Ii8\u002BPC9zdmc\u002B",
"FileName": "Python3.sh",
"Default": false
},
{
"Name": "FFmpeg7-experimental",
"Description": "FFmpeg7 is an experimental build, currently you can only install either FFmpeg6 or FFmpeg7",
"Author": "John Andrews / Lawrence",
"Revision": 1,
"Icon": "data:image/svg\u002Bxml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyNi4wLjEsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCAyMDAwIDIwMDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDIwMDAgMjAwMDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4NCgkuc3Qwe2ZpbGw6bm9uZTtzdHJva2U6IzM3OEU0MztzdHJva2Utd2lkdGg6MzAwO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDo4O30NCjwvc3R5bGU\u002BDQo8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1LDUpIj4NCgk8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMTY2LjcsMTY2LjdoNTUyLjJMMTY2LjcsNzE4Ljl2NTUyLjJMMTI3MS4xLDE2Ni43aDU1Mi4yTDE2Ni43LDE4MjMuM2g1NTIuMkwxODIzLjMsNzE4Ljl2NTUyLjJsLTU1Mi4yLDU1Mi4yDQoJCWg1NTIuMiIvPg0KPC9nPg0KPC9zdmc\u002BDQo=",
"FileName": "FFmpeg7-experimental.sh",
"Default": false
}
]
10 changes: 9 additions & 1 deletion repo.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
"Path": "Scripts/Flow/Video/Video - Devedse - RunAbAv1.js",
"Name": "Video - Devedse - RunAbAv1",
"Description": "Important: This script was made to be ran with the docker version of FileFlows. Results on other platforms may vary.\nPrerequisites:\nVideo - Devedse - InstallFfmpegBtbN.js\nVideo - Devedse - InstallAbAv1.js\nExecutes the ab-av1 command.\n/",
"Revision": 6,
"Revision": 7,
"Uid": "4b2d95ff-0b20-4be2-b945-e6efd8099feb"
},
{
Expand Down Expand Up @@ -874,6 +874,14 @@
"Revision": 3,
"Author": "John Andrews",
"Icon": "data:image/svg\u002Bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciICB2aWV3Qm94PSIwIDAgNDggNDgiIHdpZHRoPSI0OHB4IiBoZWlnaHQ9IjQ4cHgiPjxwYXRoIGZpbGw9IiMwMjc3QkQiIGQ9Ik0yNC4wNDcsNWMtMS41NTUsMC4wMDUtMi42M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TM2LDQzLjAwNiwyMy4wNzgsNDN6IE0yOC4wNjMsMzljLTAuODIxLDAtMS41LTAuNjc3LTEuNS0xLjUwMmMwLTAuODMzLDAuNjc5LTEuNDk4LDEuNS0xLjQ5OGMwLjgzNywwLDEuNSwwLjY2NCwxLjUsMS40OThDMjkuNTYzLDM4LjMyLDI4Ljg5OSwzOSwyOC4wNjMsMzl6Ii8\u002BPC9zdmc\u002B"
},
{
"Path": "DockerMods/FFmpeg7-experimental.sh",
"Name": "FFmpeg7-experimental",
"Description": "FFmpeg7 is an experimental build, currently you can only install either FFmpeg6 or FFmpeg7",
"Revision": 1,
"Author": "John Andrews / Lawrence",
"Icon": "data:image/svg\u002Bxml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyNi4wLjEsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCAyMDAwIDIwMDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDIwMDAgMjAwMDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4NCgkuc3Qwe2ZpbGw6bm9uZTtzdHJva2U6IzM3OEU0MztzdHJva2Utd2lkdGg6MzAwO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDo4O30NCjwvc3R5bGU\u002BDQo8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1LDUpIj4NCgk8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMTY2LjcsMTY2LjdoNTUyLjJMMTY2LjcsNzE4Ljl2NTUyLjJMMTI3MS4xLDE2Ni43aDU1Mi4yTDE2Ni43LDE4MjMuM2g1NTIuMkwxODIzLjMsNzE4Ljl2NTUyLjJsLTU1Mi4yLDU1Mi4yDQoJCWg1NTIuMiIvPg0KPC9nPg0KPC9zdmc\u002BDQo="
}
]
}

0 comments on commit f2d4dfe

Please sign in to comment.