Skip to content

Regarding setting up a fallback for multiple RTSP streams proxied through MediaMTX #3251

Discussion options

You must be logged in to vote

Probably not the cleanest option and should probably be using MediaMTX built in "fallback:" just don't know how, so scripted my own version using Bash script FFMpeg and FFProbe, the way I figure it if it is on a cron for every 2-5 seconds it will do the trick just fine:

#!/bin/bash

# Function to extract specific variables from .env file
extractEnvVariable() {
    local envFile="${1}"
    local variableName="${2}"
    local variableValue=$(grep "^${variableName}=" "$envFile" | cut -d'=' -f2- | tr -d '"' | tr -d "'")
    echo "$variableValue"
}

# Absolute path to the script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# Paths to the .env and .env-secrets files
ENV…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by leysjeremy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant