Resource icon

All Versions How to set up your own private RTMFP server using MonaServer

RADRaze2KX

Member
Seems like I got it working today using the link I had trouble with previously.
http://raspi.monaserver.ovh/MonaCli...fp://127.0.0.1:1935/live/test?unbuffered=true


upload_2017-1-4_0-47-22.png


However even with all options turned off, I can't seem to get my stream down past 1s delay. 1.1s, still a LOT better than it was. Any ideas on breaking past 1s delay? Or have I met my limit? :) Thank you for all your help with this, the entire community appreciates it!

Also, is that where I put the "?unbuffered=true" ? In the URL Bar at the top (Actual Address Bar), or should I put it in the player's URL section? Thank you
 

Attachments

  • upload_2017-1-4_0-47-20.png
    upload_2017-1-4_0-47-20.png
    312 KB · Views: 243

RADRaze2KX

Member
WOW I got 0.3s delay now! The issue I was having with your player is that it requires mona to have a stream path (:1935/live/test) rather than just going from the port number (which is what I was using before w/ Screen Mirroring App). Is there a way to download the player so it's local on my own machine just in case your server goes down?
 

Laope

Member
hello
i got rtmp working with monaserver, but i dont know why rtmfp doesnt work.

my configuration is:

obs gaming pc:
rtmfp://192.168.1.17/live
key: test

obs streaming pc:
rtmfp://localhost/live/test

-
this doesnt work
if i change the protocol from rtmfp to rtmp in the Streaming pc, i got image, but thats because the rtmp TCP its working. but i want to use UDP, and that doesnt work.

i changed the default port for rtmfp to 1985 in monaserver.ini, and added the port in the gaming pc, but that doesnt work either.

can you help me thomas?
 

zanmat0

New Member
2ZFOk
Hi, thank you for your guide. I am getting this error upon starting Mona on Windows 10:


04/05 15:52:42.7 WARN 4668 Server.cpp[96] No TLS/SSL server protocols, no cert.pem file
04/05

https://i.imgur.com/GBYFols.png

Do I need to create my own SSL key or something?

When I click start streaming in OBS with the settings from your guide, I get "failed to connect to server".

Thanks for your help.
 

psy_9

New Member
I am having a problem. The MonaServer starts just fine, but when I try to stream to it from OBS I get the following error.

Mona/Decoder/h[163] HTTPDecoder, Unknown HTTP command

There are also 4 characters of gibberish that follow.
BuEJWNg.png
 

Attachments

  • MonaServer_2017-06-10_14-01-18.png
    MonaServer_2017-06-10_14-01-18.png
    10.9 KB · Views: 164

SeikoTheWiz

New Member
Hi there !
First of all, thanks a lot for this great tool ! I've been making tests today and managed to do what I wanted to do : expend the number of webcam used for my streaming.

So right now the setup I'm testing is:
2 webcams on a computer simultaneously, then those 2 are sent with monaserver in rtmp to another computer to serve as a specific view in OBS.

The idea is to lower the charge of the computer and multiply the webcam inputs. An example here : https://youtu.be/dfhbsyB94yc?t=1349 the 2 players have their own webcam showing them, and there is another one for the commentators and, of course, one to show the game. This was done using a powerfull computer with an ICYBox but I can't reproduce this setting when I'm with only my own stuff.

So thanks to you I can now have the 2 players on cam on a second computer sending the images to my first one. Everything with OBS :)


I still have 2 questions.

1. I'll often be on special networks in convention like for exemple soon in http://www.japan-expo-paris.com/en/programme . Is there things to know for it to work in a place like this? Maybe it's too heavy on the network, or maybe it should have a special configuration to work properly ? I should be wired, not over wifi.

2. The second was about latency, I have the same issue as above, which is about 5-6 secondes delay. It's not the end of the world in my case, but if I can help it a little, it would be nice.

Thanks again for your precious help !
 

thomasJ

Member
2ZFOk
Hi, thank you for your guide. I am getting this error upon starting Mona on Windows 10:


04/05 15:52:42.7 WARN 4668 Server.cpp[96] No TLS/SSL server protocols, no cert.pem file
04/05

https://i.imgur.com/GBYFols.png

Do I need to create my own SSL key or something?

When I click start streaming in OBS with the settings from your guide, I get "failed to connect to server".

Thanks for your help.

Hi zanmat,

I see that you are using MonaServer2 (MonaTiny).

This is just a warning, you can ignore it or copy the 2 ".pem" file from MonaTiny directory to the directory where MonaTiny belongs. These file are just for testing purpose, if you need SSL encryption (like with RTMPS) you should create your own key files.

Hmm if the url is correct in your settings you should see some logs into MonaTiny, start it with the maximum log level and send us your logs :
./MonaTiny --log=8

Regards

Thomas
 

thomasJ

Member
I am having a problem. The MonaServer starts just fine, but when I try to stream to it from OBS I get the following error.

Mona/Decoder/h[163] HTTPDecoder, Unknown HTTP command

There are also 4 characters of gibberish that follow.

Hi psy_9,

You have to change your settings in OBS to an RTMP url (set the "Stream>Stream Type>Custom Streaming server" option before), you are using HTTP which does not support publishing for now.

Regards
 

thomasJ

Member
Hi there !
First of all, thanks a lot for this great tool ! I've been making tests today and managed to do what I wanted to do : expend the number of webcam used for my streaming.

So right now the setup I'm testing is:
2 webcams on a computer simultaneously, then those 2 are sent with monaserver in rtmp to another computer to serve as a specific view in OBS.

The idea is to lower the charge of the computer and multiply the webcam inputs. An example here : https://youtu.be/dfhbsyB94yc?t=1349 the 2 players have their own webcam showing them, and there is another one for the commentators and, of course, one to show the game. This was done using a powerfull computer with an ICYBox but I can't reproduce this setting when I'm with only my own stuff.

So thanks to you I can now have the 2 players on cam on a second computer sending the images to my first one. Everything with OBS :)


I still have 2 questions.

1. I'll often be on special networks in convention like for exemple soon in http://www.japan-expo-paris.com/en/programme . Is there things to know for it to work in a place like this? Maybe it's too heavy on the network, or maybe it should have a special configuration to work properly ? I should be wired, not over wifi.

2. The second was about latency, I have the same issue as above, which is about 5-6 secondes delay. It's not the end of the world in my case, but if I can help it a little, it would be nice.

Thanks again for your precious help !

Hi Seiko,

1. I see that you are going the the Japan Expo, I hope you'll have a great trip! If you are working on a local wired network you shouldn't have issues no, this is the best possible configuration to get low latency and avoid connection issues.

2. About latency this is an issue with OBS, could you search or create a post to improve the RTMP delay? This is a known problem and it is still there since a long time ago. If you do this please copy the link here so we can follow the progress.

Regards

Thomas
 

TacoChublets

New Member
Hey guys. I'm having some trouble getting my stream to work, using OBS as my encoder and VLC to preview the stream. While I can get the preview up and running, I'm unable to see the stream from other PCs connected to different routers.

I'm kinda ignorant to this kind of stuff, and would appreciate any help you can do.
 

thomasJ

Member
Hi,

You should ensure that your server is available from the other PCs. For this you can try a "ping" command.

The best way to make your server available is to use a public address (like raspi.monaserver.ovh for my raspberry server). If your server is behind a router it will not work unless that you use port forwarding (this is what I do with raspi.monaserver.ovh ).

Regards
 

bunchofsage

New Member
@thomasJ
  1. Your tutorial uses a stream key: how and where do I set this key? (empty key works with default MonaServer installation - like suggested here. But when I used test123 in OBS and try to connect OBS gives an error)
  2. Where can I set the server-IP? By default MonaServer says 0.0.0.0 in Command Line and in OBS I can connect to 127.0.0.1 and it works. My internal LAN ip works too
  3. What are the steps to make my stream accessible from the WWW (that's also where the stream key comes handy I guess) - if it's port forwarding: do I need to forward UDP 1985 and TCP 1935?
 

thomasJ

Member
Hi

1) In "Settings>Stream>Stream key". Which error do you have in OBS? In older versions of OBS you had to set an application name in the rtmp url like rtmp://localhost/applicationame/test123, but this is not needed in current OBS Studio version.

2) 0.0.0.0 is the wildcard ip, in general you don't need to change it, it will handle all ip sources. Though if you really need to bind a specific ip you can set it into MonaServer.ini file using "host" option (see configuration here).

3) It depends on your environment, if you have a public ip you don't have to do anything, otherwise if you are behind a router and have a private IP (given by dhcp for example) you'll have to forward the UDP and TCP port 1935 (or any other if you change it in the configuration or if you also need WS or HTTP).

Also now you can try MonaTiny now, this is the up-to-date version of MonaServer (but without lua script).
 

bunchofsage

New Member
Thanks @thomasJ - I'm using MonaTiny now

Things I learned along the way:
  • connecting via VLC does not always work on different PC in LAN (using rtmp://192.168.178.122/ )
    I fixed this by stopping an restarting MonaTiny (btw: this means clicking Start streaming in OBS as well)
    Then VLC on the other machine can open my stream (first with 20s delay, after restarting MonaTiny it was just 3 seconds)
  • However http://raspi.monaserver.ovh/MonaClients/VideoPlayer/?fit&url=rtmfp://192.168.178.122:1935/ does not connect on the other machine but works on the streaming machine - how can that be if VLC worked? (I also tried omitting the f and go for rtmp:// as this was what I used for VLC on the specatator machine)
    Update: Ha, on the spectator machine the final trailing slash / was missing and after adding this and connecting again it happily worked!
  • I ran into `unknown RTMPF Session 2` but I just used MonaTiny without any configuration -> not sure if this is related therefore https://github.com/MonaSolutions/MonaServer/issues/47 Update: that's because I had an open Mona VideoPlayer browser tab but stopped Streaming in VLC
I even got WWW Streaming running now - will edit this post later with details
 

Maff

New Member
I can stream on my network without a problem. I have set http to use 8082 in the ini file and I've set up port forwarding, but I cannot access this externally (I use VLC), I've tried:
HTTP://EXTERNAL_IPADDRESS:8082
RTMP://EXTERNAL_IPADDRESS:8082
RTMP://EXTERNAL_IPADDRESS

but none of these work. Any idea what I can do to get this working outside the network please?

thank you
 

Tarumes

Member
If you want record/push your stream

Windows
Download ffmpeg binary for windows and copy it in your Monaserver folder

then create a Server Application
http://www.monaserver.ovh/serverapp.html#create-a-server-application

copy the following code inside your main.lua
and edit ffmpeg to your settings

Code:
function onConnection(client)

    function client:onPublish(publication)
        filename = os.time ()
        print("start of stream " .. filename)
        handle = io.popen("ffmpeg -i rtmp://127.0.0.1/live/stream -acodec copy -vcodec copy www/live/" .. filename .. ".mp4")
    end
   
    function client:onUnpublish(publication)
        print("end of stream")
    end
   
end

dirty but it works
 
Top