How to use RTMP and RTMPS with NGINX on Windows

Facebook is planning to deprecate RTMP on May 1st on their Live API. They’re encouraging users that use the streaming tool to use RTMPS, a more secure version of RTMP that includes TLS/SSL (a set cryptographic protocols for secure communication).

Unfortunately, as of now, NGINX module nginx-rtmp-module doesn’t support RTMPS “out-of-the-box”. I opened an issue on GitHub on the plugin page and thanks to Liu Lantao, he devised an easy way to incorporate RTMPS into this module by using stunnel, a popular “application used to provide a universal TLS/SSL tunneling service”.

This article focuses on how to use stunnel to stream RTMPS such as Facebook Live with NGINX on Windows. For this setup, I’m using nginx 1.7.11.3 Gryphon (download here) on Windows 10.

Start by downloading and installing stunnel for Windows (download here). After you installed stunnel, you need to edit stunnel.conf which is located in 

C:\Users\YourUsername\AppData\Local\stunnel\config\stunnel.conf

Note: You can also type in ‘edit stunnel.conf’ in the search bar and it will open up Notepad for you!

1

Now add the following lines to end of stunnel.conf. This creates a session that allows NGINX to send the stream via RTMP and stunnel will then send the stream to Facebook via RTMPS.

[fb-live]
client = yes
accept = 127.0.0.1:1935
connect = live-api-s.facebook.com:443
verifyChain = no

Now modify nginx.conf and replace the old Facebook push instruction (if you had it there before) with the following line:

push rtmp://127.0.0.1:1935/rtmp/<your_facebook_stream_key>;

Save those two files and start stunnel via command-line or with the GUI application and then start nginx. Test your live stream with OBS ( instructions are under the testing section) or ffmpeg (instructions are in second to last code block).  That’s all there is to it!

From a high level, stunnel and NGINX should now operate like this:

 ____________        ____________        ____________        ____________  
| Streaming  |      |            |      |            |      |  Facebook  | 
|   Source   | ---> |   NGINX    | ---> |   stunnel  | ---> |    Live    | 
|____________|      |____________|      |____________|      |____________|

 

How to use RTMP and RTMPS with NGINX on Windows

Troubleshooting T-Mobile’s Simple Choice International Data Roaming “No Service” Issue

Since November of last year, T-Mobile’s Simple Choice plan gave users unlimited texting, (reduced) data in 120+ countries free of charge. In July 25, Not too long ago, T-Mobile extended onto their Simple Choice by introducing Mobile Without Borders, a service included for new customers that provides 4G LTE instead of reduced speeds and unlimited calling. I traveled to Mexico to visit my family and instead I was greeted with the infamous “No service”. Fortunately after searching online over the bloated airplane Wi-Fi, I was able to find a solution onto getting the appropriate. These are the potential solutions to get service. The phones I was able to get onto the international roaming working was an AT&T Motorola Moto X and an International Sony Xperia Z1 Compact (Android).

This guide is for those who know that their Non-US area that they are visiting has coverage. Check here to see if your country is available to get the simple choice benefits and has coverage.

Case 1: Check if Data Roaming is enabled

This is for those who have signal and are able to call and text, but cannot get data. This is a good quick and easy step to do before you jump into the other cases.

To check for data roaming, go to your phone’s settings. It varies from devices (even in Android), but its usually found its found somewhere around Settings->Mobile Network->Data Roaming

Should be enabled on
Should be enabled on

If you can’t find the option, you can fire up the phone’s dialer and dial #766# (#RON#) and roaming ought to be enabled.

Case 2: Check to see if International Data Roaming Blocking is enabled

In my case, my International Data Roaming Blocking was enabled. I had to follow this page onto how to get the International Data Roaming page, but I’ll summarize the same process here.

To access the International Data Roaming Blocking page , Login into your T-Mobile account online. It’s real easy to sign up for an account, Just head over to the signup page if you haven’t. But keep in mind that you have you must be the primary account holder of the T-Mobile account in order to make the changes to international roaming.

  1. Once your logged in, go to Profile (found on the top right hand corner)
  2. Next go to BLOCKING
  3. Finally, Look the option; Block international talk, text and data roaming. You’ll be able to see whether or not you have blocked roaming. If it’s on, click “On” to turn it off.
Turn it off to disable Roaming Blocking
Turn it off to disable Roaming Blocking

Once I turned off the option, I went onto my phone’s settings (In my case, it was under Settings->Mobile Network->Service Providers) to connect to one of T-Mobile’s roaming partners. Sure enough I was able to find one of T-Mobile’s Partners, (In my case, Telcel) and in no time, I was connected to the service. Immediately, I was flooded with texts, showing a good sign that I successfully made it onto network. On top of that, one of the texts was a message by T mobile reaffirming me I was on a compatible roaming network.

Case 3: Configuring APN

Depending on the country and the location you’re in, you might have to adjust your APN settings.  It’s a safe measure to create another APN entry so you can revert back to a known working one when you’re back in the states. But in the case if you don’t have a backup or you can’t make a backup, you might be able to download the internet settings depending on your device or by looking for a reset to default APN option. You can find how to get your APN setting by heading over to T-Mobile’s preferred APN settings.

Generic T-Mobile data settings

APN: fast.t-mobile.com
MMSC Server: http://mms.msg.eng.tmobile.com/mms/wapenc
APN Type: default,supl,mms
APN Protocol: IPV4

 

However Countless users on the T-Mobile and XDA forums have reported the same issue on the that by configuring the APN. Same as before, make another APN entry, if you can. Credit goes to havanahjoe.

APN: epc.tmobile.com
MMSC Server: http://mms.msg.eng.tmobile.com/mms/wapenc
APN Type: default,supl,mms
APN Protocol: IPV4

In my case, I didn’t have to change my carrier settings at all.

So hopefully, you were able to get service. Got any problems or any suggestions? Drop em in the comments!

Troubleshooting T-Mobile’s Simple Choice International Data Roaming “No Service” Issue