streamlinevideo / streamline

A reference system for end to end live streaming video. Capture, encode, package, uplink, origin, CDN, and player.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

launch.sh sends success message even when unsuccessful

JacquiManzi opened this issue Β· comments

# Upload the player over HTTP PUT to the origin server

curl -X PUT --upload-file /tmp/${vid}.html http://${1}/${vid}.html -H "Content-Type: text/html; charset=utf-8"

echo ...and awaaaaayyyyy we go! πŸš€πŸš€πŸš€πŸš€

echo Input detected on ${device} as ${res} ${fps}

echo Currently streaming to: https://${2}/${vid}.html

The end of this script seems to execute the above lines even when the process fails.

As an example, I currently do not have ffmpeg installed, but the process does not exit after an error occurs in the below lines:

# Get the name of the capture card

ffmpeg -hide_banner -f decklink -list_devices 1  \
-i dummy &> .tmp.txt
sed -i '1d' .tmp.txt
output=$(<.tmp.txt)

IFS="'" read _ device _ <<< "$output"

I'm no bash expert, but googling around suggests we could throw errors using set -e.

However, i think this command added to launch.sh could be a good temporary solution.
command -v ffmpeg >/dev/null 2>&1 || { echo "ffmpeg is required for launching the encoder. Aborting." >&2; exit 1; }

PR here: #7