Last active
October 21, 2020 12:42
-
-
Save jniltinho/2534f3ef5d3f8c31014f16b2d5dfe144 to your computer and use it in GitHub Desktop.
Install RTMP Nginx on Ubuntu 18.04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### Author: Nilton OS <jniltinho dot gmail.com> | |
### Version 0.1 | |
## https://opensource.com/article/19/1/basic-live-video-streaming-server | |
## https://obsproject.com/forum/resources/how-to-set-up-your-own-private-rtmp-server-using-nginx.50 | |
## https://gist.github.com/tabvn/cb58cf621ddc346c19e44542ed5e800c | |
## https://docs.peer5.com/guides/setting-up-hls-live-streaming-server-using-nginx/ | |
## https://illegalpornography.com/computers/2018/09/14/hls-streaming-with-nginx-that-works.html | |
## https://dev.to/samuyi/how-to-setup-nginx-for-hls-video-streaming-on-centos-7-3jb8 | |
docker run --rm -it -v "${PWD}:/install" -p 1935:1935 ubuntu:bionic /bin/bash | |
apt-get update | |
apt-get -y install apt-transport-https ca-certificates curl software-properties-common | |
add-apt-repository universe | |
apt-get -y install nginx | |
apt-get -y install libnginx-mod-rtmp | |
echo 'rtmp { | |
server { | |
listen 1935; | |
chunk_size 4096; | |
application live { | |
live on; | |
record off; | |
#push rtmp://live.twitch.tv/app/[streamkeyfromtwitch]; | |
#push rtmp://a.rtmp.youtube.com/live2/[streamkeyfromyoutube]; | |
} | |
} | |
}' >> /etc/nginx/nginx.conf | |
## Testando a configuração | |
/usr/sbin/nginx -t | |
# /usr/sbin/nginx -g 'daemon off;' | |
/usr/sbin/nginx | |
/usr/sbin/nginx -s reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment