[Guide] Nginx server streaming recorder with profiles. (W32)

Hi all,

I made a small guide for streamers who want to save a copy of their broadcasts and want to set up their own rtmp server locally.

Please keep in mind that you will have to do some adjustments for your specific setup/wishes.

https://docs.google.com/file/d/0B1HhEyA7_SPUejQzSjVlS2Y2WU0/edit?usp=sharing

(click on "file" top left corner and then download)

The download contains the following:

nginx-rtmp module for windows provided by mkdr here on the forums.
Jwplayer
My recording interface
A batch file for rss testing
fnr.exe Tool to quickly find and replace words in multiple documents.
And some small scripts to make it all work.

This instruction wil show the quickest way to set it up.
1. Download it and extract it to you c:\ drive. (no other folder of whatever, just plain in c:\)
so you will have c:\nginx_rtmp_w32\the files in the zip.
2. Check what ip adress you have on the server/computer
3. Open the folder c:\nginx_rtmp_w32\Tools and start fnr.exe
4. In the <dir> line fill in: c:\nginx_rtmp_w32\html\Body (or browse to it with the button)
5. In the Find box fil in XXX.XXX.XXX.XXX (no spaces)
6. In the Replace box fil in the ip adress you got in point 2.
7. Click on the replace button and you will see 18 modifications.
8. Close this program and start the server by clicking on: c:\nginx_rtmp_w32\nginx.exe
9. Open an internet browser and fill in the ip you got at point 2 and go.

A more comprehensive instruction is available when you have setup the server and able to reach it in a browser.


And a quick view on how the interface looks like:

1z21uuh.png




================================================================================
Notice:

*AT THE MOMENT THE SERVER IS NOT SECURE, PLEASE KEEP THAT IN MIND FOR YOUR SITUATION.

*All is set up in windows syntax so adjust to linux syntax if you use a linux dist (URLs, save paths, timeformats).

*The Exec_ command is currently not possible with the win32 compile so re-encoding is not implemented. (yet)
(or someone knows how to do this without the exec_ directive) (not really looked into this yet)

* The records get messed up if the same streamkey/path is used in obs on different pc's so keep in mind that you will have to fill in the streampath in OBS if you are broadcasting with more than one pc to that server. (Want to solve that in the future by forcing a stream name else error)

* If there are more requests for a specific profile, please let me know and ill see if i can add it.
================================================================================
 

Jack0r

The Helping Squad
Re: [Guide] Nginx server streaming recording profiles. (W32)

Hey, first of all thanks for the guide, but I had one or two questions:
Code:
		application live1 {
			live on;
			recorder rec1 {
				record all;
				record_path E:/capture/nginx;
				record_unique off;
				record_suffix _%d-%b-%y_%H-%M.flv;
			}
		}
I am using this application configuration for my current setup. And was wondering why you are using:
publish_notify on;
allow publish all;
allow play all;
on_play http://localhost:80/on_play;
Are all these commands necessary to forward the stream to each application? Or is it planned to use only one Application at a time? It is maybe a bit confusing as most people will probably only use one profile I guess? And if so, you might be able to simplify the different recorders
I also use the rtmp control module which is necessary for the manual recordings, i think?! And dont you need to define a recorder to control them? You didnt show the http server configuration which would include the control configuration, so you might wanna add it if its necessary.

Looking forward to your manual interface. I currently just use a webpage with simple links and an iframe which includes the stats page.
 
Re: [Guide] Nginx server streaming recording profiles. (W32)

Hi Jack0r,

Yea i realised afer a couple hours reading and woringking on that interface, that my guide is far from complete.

but the directives:

publish_notify on;
allow publish all;
allow play all;
on_play http://localhost:80/on_play;

I have added them for future use in my interface when i'm more proficient with java and jquery to pull info from the server and a posibility to control the access to each profile/app/block separately.

And it's also done to make a downloadble zip for anyone who wants the whole server+profiles in one go.
However it's just apreparation for the future because now im still buisy with making a basic recording / viewing interface for these 9 profiles and some othe small things.
I guess it's basicly like your website but with some more styling.
However i want to make some elements responsive to user input in the future but it wil take a while before i have implemented that :)

I got a basic manual interface already working however i want to make it more nice/intuïtive before i will release it.

Ah about the recorder setups: From what i understood from the rtmp documentation is that each app is a instance on it's own so it has to be redefined with each new block. And also to get a better/easyer way to make the recording interface intuïtive. Thats why they are so eleborate :)

I also have a replay function in mind in the future that feeds the jwplayer playlist with a rss generator.
(already ahve it working and it works good but im buisy with that interface and i want to streamline it for the downloadable zip that i have planned)
 

Kayda

New Member
Re: [Guide] Nginx server streaming recorder with profiles. (

Hey there, I am trying to set up a small private server on my pc to allow some friends to stream to it over the LAN from what I gather from your guide that is possible to do. The only problem I am having though is the IP, I'm assuming I need some other form of software, but when I look up my IP address I'm getting XX.XX.XX.XX as opposed to XXX.XXX.XXX.XXX If you could provide any insight in to what I would need I would be most grateful.

Thank you.
 
Re: [Guide] Nginx server streaming recorder with profiles. (

Hi, sorry for the late responce.
Been caught up with some things so im not looking much to be honest.
However it certainly is possible with this setup but im not sure in what step you are exactly having a problem.
Would you mind explaining it a bit more?
 

Kayda

New Member
Re: [Guide] Nginx server streaming recorder with profiles. (

So if my IP Address is something like 98.45.34.12 I can put that in place of the XXX.XXX.XXX.XXX and would I then be able to have my friends stream to me over the LAN Network? Or is there something else I need to help this work? I've heard other guides say about setting up a server, but if I'm wanting to use my pc, then I wouldn't need to set one up correct?

UPDATE: sorry I've found my IPv4 IP and used that, and i've typed that into a browser and it just shows the words "It Works!" When I try and run the nginx software admin or otherwise it just flashes a command prompt up on the screen then closes?
 

Jack0r

The Helping Squad
Re: [Guide] Nginx server streaming recorder with profiles. (

Wait a second, do you want your mates to stream over Lan or Internet?
For Local Area Networks you cannot use the Internet-IP address, but if you mates will stream to you over the internet, the IP you mentioned should be the correct one.
 
Re: [Guide] Nginx server streaming recorder with profiles. (

Hi sorry for not responding again in a while .. had an eye infection so irritating that i could not look at illuminated sources (ie monotors ect.) verry annoying.

However you indeed had to fill in your ipv4 adress for a LAN situation. Also make sure that nginx isn't start up twice.
(if it's started up twice you will see 4 nginx.exe instances in the processes tab in the taskmanager.)
In the normal working state you will see 2 processes.

But for the software to work you jusy have to fill in the ipv4 adress in a browser and it should be working.
Ah....
I just realised....
Perhaps you will need to install java. Even tho the most of the page is coded in plain html/css some element actually use java.

If that doesn't work you can check the log file and post the errors in this thread and i'll help you out with those.
(log folder in the server software)

Also dont forget to configure your router properly/ It should show the webpage normally as it is set to port 80 in the server settings. The other ports should be manually set on your router.
 

sneaky4oe

Member
Re: [Guide] Nginx server streaming recorder with profiles. (

Hi, can this server transcode stream to lower resolution?
 

kired

New Member
Hi! I was able to stream to the server and even have it save the stream for me, like intended. I wasn't able, though, to watch the stream with the JW Player, I get this error 'Error loading stream: Could not connect to server'. I tried everything I could think of, and couldn't get it to work.
What I really want is to have a second OBS on another computer to re encode the stream and then send it over the internet. Maybe I shouldn't try to do this with your solution? What do you think?
Thanks!
 
Top