This repository was archived by the owner on Oct 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathinstall_codecs
More file actions
80 lines (75 loc) · 2.5 KB
/
Copy pathinstall_codecs
File metadata and controls
80 lines (75 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
# Install OpenH264 Codecs
function openh264_codec {
# Variables
NAME="OpenH264 Codec"
REPO="fedora-cisco-openh264"
PACKAGE=gstreamer1-plugin-openh264
# Check if package is installed
if [ $(check_package_installed ${PACKAGE}) = 1 ]; then
echo_message warning "Package '$PACKAGE' is not installed. Installing..."
# Add repository
echo_message info "Enabling '$REPO' repository..."
superuser_do "dnf config-manager --set-enabled $REPO"
# Install package(s)
echo_message info "Installing $NAME..."
superuser_do "dnf install -y $PACKAGE"
# Finished
echo_message success "Installation of '$PACKAGE' complete."
whiptail --title "Finished" --msgbox "Installation of $NAME complete." 8 56
install_codecs
else
# Already installed
echo_message success "$NAME already installed."
whiptail --title "Finished" --msgbox "$NAME is already installed." 8 56
install_codecs
fi
}
# Install FFmpeg Codecs
function ffpmeg_codecs {
# Add RPM Fusion free
add_rpmfusion 'free' echo
# Update the list of packages in 'data/codecs-ffmpeg.list' to suit your preferences
install_from_list "FFmpeg multimedia codecs" "codecs-ffmpeg" install_codecs
}
# Install GStreamer (free) Codecs
function gstreamer_free {
# Add RPM Fusion free
add_rpmfusion 'free' echo
# Update the list of packages in 'data/codecs-gstreamer-free.list' to suit your preferences
install_from_list "GStreamer (free) multimedia codecs" "codecs-gstreamer-free" install_codecs
}
# Install GStreamer (non-free) Codecs
function gstreamer_nonfree {
# Add RPM Fusion Non-free
add_rpmfusion 'nonfree' echo
# Update the list of packages in 'data/codecs-gstreamer-nonfree.list' to suit your preferences
install_from_list "GStreamer (non-free) multimedia codecs" "codecs-gstreamer-nonfree" install_codecs
}
# Install Codecs
function install_codecs {
NAME="Multimedia Codecs"
echo_message title "Starting $NAME installation..."
# Draw window
CODECS=$(eval `resize` && whiptail \
--notags \
--title "Install $NAME" \
--menu "\nWhich $NAME would you like to install?" \
--ok-button "Install" \
--cancel-button "Go Back" \
$LINES $COLUMNS $(( $LINES - 12 )) \
'gstreamer_free' 'GStreamer (free) Codecs' \
'gstreamer_nonfree' 'GStreamer (non-free) Codecs' \
'ffpmeg_codecs' 'FFmpeg Codecs' \
'openh264_codec' 'OpenH264 Codec' \
3>&1 1>&2 2>&3)
# check exit status
if [ $? = 0 ]; then
echo_message header "Starting '$CODECS' function"
$CODECS
else
# Cancelled
echo_message info "$NAME installation cancelled."
main
fi
}