Catch ffmpeg output in stream
This commit is contained in:
parent
d5443e9eaf
commit
c073d1790f
@ -13,6 +13,8 @@
|
|||||||
* Move the `streamupload` directory to a place that is accessible to the web
|
* Move the `streamupload` directory to a place that is accessible to the web
|
||||||
server, like: `mv streamupload /var/www` and `cd` to that place. Now the
|
server, like: `mv streamupload /var/www` and `cd` to that place. Now the
|
||||||
output of `pwd` is the value for `$repopath`.
|
output of `pwd` is the value for `$repopath`.
|
||||||
|
* do `mkdir "$repopath/uploadpage/streams"` and
|
||||||
|
`chmod 777 "$repopath/uploadpage/streams"`.
|
||||||
* Copy `_vars` to `vars`, `_mailhash` to `mailhash` and `_countdown` to
|
* Copy `_vars` to `vars`, `_mailhash` to `mailhash` and `_countdown` to
|
||||||
`countdown` and set the variables in `vars` (webserver, SMTP-server),
|
`countdown` and set the variables in `vars` (webserver, SMTP-server),
|
||||||
`mailhash` (usernames, emails and bcrypt-password-hashes) and `countdown`
|
`mailhash` (usernames, emails and bcrypt-password-hashes) and `countdown`
|
||||||
|
|||||||
2
stream
2
stream
@ -20,7 +20,7 @@ esac
|
|||||||
|
|
||||||
# Stream, log it, and remove all files if successful
|
# Stream, log it, and remove all files if successful
|
||||||
set -o pipefail # to get ffmpeg's returncode
|
set -o pipefail # to get ffmpeg's returncode
|
||||||
ffmpeg -re -y -i "$in" -c:v copy -c:a copy -f flv "$rtmp" |tail -n 20 >"$in.log" &&
|
ffmpeg -re -y -i "$in" -c:v copy -c:a copy -f flv "$rtmp" 2>&1 |tail -n 20 >"$in.log" &&
|
||||||
rm "$in.log" "$in" "${in%.mp4}" ||
|
rm "$in.log" "$in" "${in%.mp4}" ||
|
||||||
echo "Error while streaming $1" >>"$log"
|
echo "Error while streaming $1" >>"$log"
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user