streamlinevideo / streamline

A reference system for end to end live streaming video. Capture, encode, package, uplink, origin, CDN, and player.
MIT License
748 stars 87 forks source link

launch.sh sends success message even when unsuccessful #6

Open JacquiManzi opened 6 years ago

JacquiManzi commented 6 years ago
# 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; }

JacquiManzi commented 6 years ago

PR here: https://github.com/colleenkhenry/streamline/pull/7