SOLVED

Unable to use NGINX RTMP Streaming Server with Stream

Brass Contributor

I'm trying to set up a NGINX RTMP on a VM to distribute a stream to multiple endpoints at the same time. I've successfully set up a stream from OBS to NGINX and then send it to Facebook and Youtube at the same time. However, when I set it up to add Stream, it never fully connects in Stream. I copy the Server Ingest URL from Stream and paste it into my nginx.conf file and unfortunately never connects. There aren't any errors in NGINX, but stream does tell me that I may be sending an incorrect signal.

 

  push rtmp://localhost/custom;
		}
		# Custom RTMP Application
		application custom {
			live on;
			record off;

			# Only allow localhost to publish
			allow publish 127.0.0.1;
			deny publish all;

			# Push URL with the Custom stream Ingest URL
			push rtmp://uniquecode-uniquecode2-usea.channel.media.azure.net:1935/live/uniquecode3;
		}

	}

 

Here's a site that talks through how to setup a NGINX RTMP Server.

https://www.scaleway.com/en/docs/setup-rtmp-streaming-server/

 

4 Replies
Did you add the password part? You take the ending key in the URL provided from Stream and use it as the password in addition to having the full URL .

location /auth {
if ($arg_pwd = 'stream url key here') {
return 200;
}
return 401;
}

@Chris WebbThanks for the reply! I do have that block of code under the server_name section. I tried changing it to what you suggested and also updated my OBS stream to add that key to the stream key. However, I believe that is only for local authentication between my OBS client and my NGINX Server. It unfortunately did not make a difference on the Microsoft Stream side.

 

I currently don't have an issue streaming from OBS to NGINX, and then NGINX distributing the stream out to local clients over rtmp, Facebook Live, and Youtube Live all at the same time. I'm struggling with distributing the stream to Microsoft Stream though.

 

Appreciate your help!

best response confirmed by hovee (Brass Contributor)
Solution

I was able to figure it out and get it to work. You get the following Server Ingest URL from Stream when you Start Setup of your video.

rtmp://uniquecode-uniquecode2-usea.channel.media.azure.net:1935/live/uniquecode3

You then need to split up the URL and have the first part of the URL with the port as the push, and then add app to the end with app=live/uniquecode3;

 

  push rtmp://localhost/custom;
		}
		# Custom RTMP Application
		application custom {
			live on;
			record off;

			# Only allow localhost to publish
			allow publish 127.0.0.1;
			deny publish all;

			# Push URL with the Custom stream Ingest URL
			push rtmp://uniquecode-uniquecode2-usea.channel.media.azure.net:1935 app=live/uniquecode3;
		}
	}

 

 

 

I added support for Microsoft Stream to this NGINX Docker Container if you want to stream to the container, and then stream to Microsoft Stream, Facebook, Youtube, Instagram, Periscope, all at the same time.

 

https://github.com/michaelkamprath/multi-service-rtmp-broadcaster

1 best response

Accepted Solutions
best response confirmed by hovee (Brass Contributor)
Solution

I was able to figure it out and get it to work. You get the following Server Ingest URL from Stream when you Start Setup of your video.

rtmp://uniquecode-uniquecode2-usea.channel.media.azure.net:1935/live/uniquecode3

You then need to split up the URL and have the first part of the URL with the port as the push, and then add app to the end with app=live/uniquecode3;

 

  push rtmp://localhost/custom;
		}
		# Custom RTMP Application
		application custom {
			live on;
			record off;

			# Only allow localhost to publish
			allow publish 127.0.0.1;
			deny publish all;

			# Push URL with the Custom stream Ingest URL
			push rtmp://uniquecode-uniquecode2-usea.channel.media.azure.net:1935 app=live/uniquecode3;
		}
	}

 

 

 

View solution in original post