Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

launch.sh sends success message even when unsuccessful #6

Open
JacquiManzi opened this issue Mar 25, 2018 · 1 comment
Open

launch.sh sends success message even when unsuccessful #6

JacquiManzi opened this issue Mar 25, 2018 · 1 comment

Comments

@JacquiManzi
Copy link
Contributor

JacquiManzi commented Mar 25, 2018

# 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
Copy link
Contributor Author

PR here: #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant