GithubHelp home page GithubHelp logo

docker-nginx-rtmp's Introduction

Docker-nginx-rtmp

Docker image for an RTMP/HLS server running on nginx

  • NGINX Version 1.21.1
  • nginx-rtmp-module Version 1.2.2

Configurations

This image exposes port 1935 for RTMP Steams and has 2 default channels open "live" and "testing".

live (or your first stream name) is also accessable via HLS on port 8080

It also exposes 8080 so you can access http://:8080/stat to see the streaming statistics.

The configuration file is in /opt/nginx/conf/

Running

To run the container and bind the port 1935 to the host machine; run the following:

docker run -p 1935:1935 -p 8080:8080 jasonrivers/nginx-rtmp

Multiple Streams:

You can enable multiple streams on the container by setting RTMP_STREAM_NAMES when launching, This is a comma seperated list of names, E.G.

docker run      \
    -p 1935:1935        \
    -p 8080:8080        \
    -e RTMP_STREAM_NAMES=live,teststream1,teststream2   \
    jasonrivers/nginx-rtmp

Pushing streams

You can ush your main stream out to other RTMP servers, Currently this is limited to only the first stream in RTMP_STREAM_NAMES (default is live) by setting RTMP_PUSH_URLS when launching, This is a comma seperated list of URLS, EG:

docker run      \
    -p 1935:1935        \
    -p 8080:8080        \
    -e RTMP_PUSH_URLS=rtmp://live.youtube.com/myname/streamkey,rtmp://live.twitch.tv/app/streamkey
    jasonrivers/nginx-rtmp

OBS Configuration

Under broadcast settings, set the follwing parameters:

Streaming Service: Custom
Server: rtmp://<your server ip>/live
Play Path/Stream Key: mystream

Watching the steam

In your favorite RTMP video player connect to the stream using the URL: rtmp://<your server ip>/live/mystream http://<your server ip>/hls/mystream.m3u8

Tested players

  • VLC
  • omxplayer (Raspberry Pi)

docker-nginx-rtmp's People

Contributors

jasonrivers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-nginx-rtmp's Issues

Build Fails

Step 5/16 fails with this error:

ERROR: unsatisfiable constraints:
  binutils-libs (missing):
    required by: world[binutils-libs]

Getting a https stream

I have this running fine in VLC, it can use both the rtmp and the hls streams. I can't, however, get it to stream onto a html video player. Going by some posts I've found on StackExchange, this seems to be because the browser expects a https source, not a http one. How to I modify the container to get this?

I'm running the container inside docker-compose file with jwilder/nginx-proxy and jrcs/letsencrypt-nginx-proxy-companion

Live Transcoding

Would it be possible for this to have optional transcoding also? or would you happen to know a container that already does this or a way to do this.

How to reverse proxy?

Hi,

Wanted to give it a try and it works well with IP but I was wondering how to reverse-proxy this so as to use rtmp://stream.domain.tld/live/key

I tried to reverse 1935 and/or 8080 without success.

Thanks,

stream key in config

his is it possible to insert a stream key in the config file
the software I want to connect to it from needs a stream key or I get no connect button
ive got it running on a docker on Qnap so its a bit of a pain to add it start up be better if I can add the stream key in the Nginx config

Multiple Containers with Different ports

I'n not sure if this is possible with nginx or not, but is it possible to have multiple containers running with different ports? Basically I need a way to add and destroy multiple streams on the fly. Currently, I just create a single container with multiple streams, but this isn't going to work in the long run since I need to be able to add and remove streams on the fly.

HLS not working

Instead of the server name "live" I am using a random string for security. Here is an example:
rtmp://167.99.233.17:6541/5af856b407e6a/stream

The issue I am running into is that HLS doesnt seem to me working:
http://167.99.233.17:7934/hls/stream.m3u8

Am I doing something wrong here? Seems like I'm getting a 404.

Note: The ports are correct, I generate them randomly as a create/delete streams.

OBS Configuration - broadcast settings

Hi,

in witch file/ location I have to put the broadcast settings? In nginx.config I can´t find anthing...

I want to include an ip cam stream:
rtmp://192.168.1.193/bcs/channel0_main.bcs?channel=0

Thanks a lot!

adjust config to listen to ipv6

it looks like nginx currently isnt listening to ipv6

adding the [::] listening address solves this issue.

server {
    listen          8080;
    listen          [::]:8080;

...

having both listen configs in the file allows the server to be called on its ipv4 as on ipv6 addresses

Nothing on stat page

I run the docker with command docker run –rm -it -h docker -p 80:8080 -p 1935:1935 jasonrivers/nginx-rtmp

When I visit http://localhost/stat,it show a blank page without anything.

I read the nginx.conf, file /opt/nginx/conf/stat.xsl doesn't exist.

Anyone can tell me the reason?

Stream Key

Is there anyway to customize a stream key?

Why my nginx-rtmp docker image cannot work

I use the following command to build a docker:

docker build -t  nginx-rtmp:latest .

And after it is built successfully, the size only has 16.9MB, but the docker image pulled from your docker hub has 20.6MB, then I use the following command to start the image:

docker run -p 1935:1935 -p 8080:8080   -e RTMP_STREAM_NAMES=test1,test2   nginx-rtmp

the following error happens:

nginx: [emerg] the same path name "/tmp/hls" used in /opt/nginx/conf/nginx.conf:70 and in /opt/nginx/conf/nginx.conf:70

Enable CORS for HLS

Sorry for all of the issues. Is it possible to enable CORS automatically with each container?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.