Resource icon

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

thomasJ

Member
Hi @UJIb, thank your for the report, I am working on it.
I am installing the latest headless raspbian distribution on the raspberry pi because older versions where always waiting for a monitor to be connected before starting correctly (so every time the raspberry pi was reseted it was waiting for a monitor).
It should be available later this day. For now you can use our samples by downloading them from github here.

Thanks
 

amar.mashruwala

New Member
Hi Thomas / All,

I am new at installing and working with MonServer, working in a windows 10 PC. I have started reading the installation guide but i am finding it a bit confusing. Is there a tutorial video on the installation and functionality of MonaServer. I'm very keen to get this application. thanks
 

thomasJ

Member
Hi Amar,

Welcome to MonaServer. I am sorry but we cannot build a new tutorial video on this subject now.
Though I can explain you in few steps how to install MonaServer :
  1. Download MonaServer from this link
  2. Uncompress it and run MonaServer.exe
That's all ;)

Then you can watch the video tutorial on how to broadcast with MonaServer and OBS or try to use a different publisher like VideoPublisher (it's hosted by an https server now because of chrome restrictions) and play it with our custom VideoPlayer.

Now about features of MonaServer all is written in the documentation. The main thing to understand is that you write a main.lua code into the www directory (or a subdirectory like www/MonaClients/) of MonaServer to customize the behavior of your applications like you should do with a php server but for all protocols (RTMP, RTMFP, HTTP, WebSocket).

I hope it will help you!

Regards
 

RADRaze2KX

Member
ThomasJ I've been helping people use Monaserver as much as possible :) Can you tell me if there's a way to remove the control bar from displaying at the bottom of the local SWF you provided me? Currently I call the HTML file directly in OBS like this:

<html>
<title>PixelXL</title>
<body>
<iframe src="http://raspi.monaserver.ovh/MonaCli...//127.0.0.1:1935/pixelxl/test?unbuffered=true" style="border:none;" height="98%" width="98%"></iframe>
<body>
</html>

But a semi-transparent control bar appears at the bottom. Is there a way to have that bar appear below the video instead of on top of it?
 

thomasJ

Member
I used to have this working fine before I had to re-install Windows. I have port 1935 forwarded to my PC on my router. I have been reading & watching tutorials, but I'm now stuck.
I have downloaded Mona server, run it so it created a www folder for me, in there I have added a folder called 'test', closed & re-run mona server.
The window has:

Code:
Mona/Protocols.h[102] RTMFP server started on 0.0.0.0:1935 (UDP)
Mona/Protocols.h[102] RTMP server started on 0.0.0.0:1935 (TCP)
Mona/Protocols.h[102] HTTP server started on 0.0.0.0:80 (TCP)
Mona/Protocols.h[102] RTSP server started on 0.0.0.0:554 (TCP)

In OBS (same PC), I have set stream URL to rtmp://127.0.0.1 and stream key to 'test', clicked "start streaming" which gives readout like this:
Code:
20/09 09:25:45.8  ERROR    Server(12128)    sources\FlashMainStream.cpp[160]  Method 'releaseStream' not found on application
20/09 09:25:45.8  ERROR    Server(12128)    sources\FlashMainStream.cpp[160]  Method 'FCPublish' not found on application
20/09 09:25:45.8  INFO    Server(12128)    sources\Publication.cpp[87]  Publication test started
20/09 09:25:45.8  WARN    Server(12128)    sources\AMFWriter.cpp[228]  Mixed object in AMF0 are not supported, switch to AMF3
20/09 09:25:45.8  INFO    Server(12128)    sources\Publication.cpp[253]  Write test publication properties
20/09 09:25:47.7  NOTE    Server(12128)    RTMP\RTMPSession.cpp[279]  Sending ACK : 134514 bytes (_unackBytes: 134514)
20/09 09:25:47.7  INFO    Server(12128)    sources\Server.cpp[144]  1 clients

Then in VLC, on my phone (4G) I try to connect to: rtmp://<servername>/test, or, rtmp://127.0.0.1/test on my PC, the log then says:
Code:
20/09 09:28:26.4  ERROR    Server(8440)    sources\FlashMainStream.cpp[160]  Method 'getStreamLength' not found on application /test
20/09 09:28:26.4  INFO    Server(8440)    sources\FlashStream.cpp[112]  setBufferTime 3000ms on stream 1
20/09 09:28:26.7  NOTE    Server(8440)    RTMP\RTMPSession.cpp[279]  Sending ACK : 1063982 bytes (_unackBytes: 134985)
20/09 09:28:27.1  NOTE    Server(8440)    RTMP\RTMPSession.cpp[279]  Sending ACK : 1197039 bytes (_unackBytes: 133057)
20/09 09:28:27.4  INFO    Server(8440)    sources\Server.cpp[144]  2 clients

I know it's something simple that I've figured out before, but I cannot remember what it is!
Can anyone assist?

Thank you

Copy/paste of the answer from github :

Hi maffbm,

Just create a new directory in the "www" directory of MonaServer (like "www/live" for example) and when you connect from vlc or another player add this directory in your url (for example "rtmp://localhost/live/test").
librtmp and ffmpeg add this constraint (to add an application/directory) for publishing or playing a stream, this is not true for flash, for example you can play your stream with VideoPlayer using this url : http://raspi.monaserver.ovh/MonaClients/VideoPlayer/?fit&url=rtmp://localhost/test

Also do you know that we are working on MonaServer2? There are a lot of new features like http live streaming (you can now publish and play using http), mp4 and ts support, publishing from a movie file, recording etc...
This project will replace MonaServer as soon as we add lua support (for now we cannot focus on this but it will be our priority when we have time).
 

Maff

New Member
Thanks Thomas, sorry I deleted my post as you replied on GitHub and I didn't see your reply here!

Another issue I'm having now if anyone knows how to help...
If I set OBS to 2000 kbps or higher it stutters and goes black for a few seconds every 5 seconds or so., 1,500 or less and it's ok.

Thing is, I have 19mbps upload, I'm able to stream Plex to 4 people at once without an issue (minimum 2000). Now if I use Mona, even with no one connected to that, then Plex says "source too slow" for anyone (even if only one person on Plex).

OBS is only using around 5% cpu. Plex around the same.

Cheers
 

Maff

New Member
I have MonaServer2 up and running (Windows 10), thanks to Mathieu yesterday. Using http server, however I cannot get video to play in a browser on iOS. It's fine on Windows & Android, but I have access to an iPad 2 (with Safari) and a new iPhone (Safari and Chrome).

If I open the url (e.g. http://myexternalIP:8084/video.mp4) it shows a play icon with a line through it. If I put the URL into VLC on the same iOS devices then it plays fine. No issues at all on Android/PC. I'm not sure if it's an OBS issue or MonaServer2 or some restriction put in place by Apple, can anyone assist?

Thank you.
 

thomasJ

Member
Thanks Thomas, sorry I deleted my post as you replied on GitHub and I didn't see your reply here!

Another issue I'm having now if anyone knows how to help...
If I set OBS to 2000 kbps or higher it stutters and goes black for a few seconds every 5 seconds or so., 1,500 or less and it's ok.

Thing is, I have 19mbps upload, I'm able to stream Plex to 4 people at once without an issue (minimum 2000). Now if I use Mona, even with no one connected to that, then Plex says "source too slow" for anyone (even if only one person on Plex).

OBS is only using around 5% cpu. Plex around the same.

Cheers
Could you tell us exactly how to reproduce your issue? I am not sure to understand your configuration.
And you say that with Plex server instead of MonaServer you don't have this issue?
 

CorniliuS

New Member
Hello. Thank you for this excellent software. Today I notice something strange. Recordings with 60Fps stream produces variable frame rate. I’ve been using monatiny about two years but I always streamed (locally) and recorded in 50fps, and 50fps always produces constant fps. Today I tried 60fps and stumbled in to this problem. This is not some hardware problem, or frame dropping, because if I just record to my hard drive I get constant 60fps. I stream with obs, to my second pc and record with ffmpeg (ffmpeg -nostats -i rtmp://intel/live -y -c: copy).
 

Attachments

  • obs.PNG
    obs.PNG
    55.4 KB · Views: 242

Xiam

New Member
Hello, I can see my stream on your webplayer but I can't see the stream on VLC, whenever I try to connect using VLC MonaServer throws this error:

Code:
sources\FlashMainStream.cpp[160] Method client 'getStreamLength' not found in application /test
sources\FlashStream.cpp[112] setBufferTime 3000ms on stream 1
sources\Server.cpp[144] 1 clients
 

thomasJ

Member
Hi all, sorry for the late reply,

The 'getStreamLength' error can be ignored, this is normal with VLC.
I guess your problem is that you don't see the video, right? In this case you should try to add an application name in the path, for example if you want to play the stream 'test' in VLC with rtmp you should try the following link : rtmp://localhost/live/test
(replace 'test' by the name of your stream publication and 'live' by any other application name, it does not matter)

You can also try to view the stream with HTTP live streaming, for this just open the following link http://localhost/test.mp4 in VLC to play an existing stream 'test'.
 

RADRaze2KX

Member
@thomasJ I am so glad you're still around supporting this project. Can you tell me how to embed the local copy of the videoplayer.swf into a file and make it work? I've had issues with this. Also, I'd like to send you some money, where can I donate to support this project?
 
Top