JasonRivers / Docker-nginx-rtmp

Docker Image for RTMP streams using Nginx
181 stars 114 forks source link

HLS not working #10

Closed BeanMeUp closed 6 years ago

BeanMeUp commented 6 years ago

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.

JasonRivers commented 6 years ago

Please could you post your docker run command so I can have a look at this locally? We have been generating containers on-the-fly without any issues, If I can run the same thing as you are then I can check this out.

BeanMeUp commented 6 years ago

Sure! docker run --name " . $this->container_name . " -p " . $this->private_port . ":1935 -p " . $this->public_port . ":8080 -e RTMP_STREAM_NAMES=" . $this->rtmp_stream_name . " jasonrivers/nginx-rtmp"

Or without PHP

docker run --name {{container name}} -p {{rtmp port}}:1935 -p {{hls port}}:8080 -e RTMP_STREAM_NAMES={{stream name}} jasonrivers/nginx-rtmp

Also, the stream I posted above is an active container so feel free to go to that URL to see that it is returning 404.

BeanMeUp commented 6 years ago

@JasonRivers It looks like I can access http://167.99.233.17:7934/hls/ it's just 403 Forbidden.. however, when I try http://167.99.233.17:7934/hls/stream.m3u8 it's 404.

I tried other URL combinations as well, but no luck. Is it because I am doing RTMP_STREAM_NAMES as well?

BeanMeUp commented 6 years ago

@JasonRivers Did you ever get the chance to looking into this?

BeanMeUp commented 6 years ago

I got it to work. Be sure to test using a working player and not just the URL. Also, I needed to randomize the stream password as well as only have one stream playing on one port. Not a big deal, it works.

ivantw08 commented 6 years ago

i tried it with video.js . Still not work @fyroc could you help me ? tell me about detail ? please ~~~

BeanMeUp commented 6 years ago

@ivantw08 You can't just test with the URL, you have to test using an HLS player.

https://developer.jwplayer.com/tools/stream-tester/