NodeJS Media Server and RED 5 via RTMP

This is more of a conceptual question than the direct "how to do it."

As a rule, it is possible to implement a flash-like solution for streaming audio (regardless of where we get the stream data from, for example, webRTC or another) in HTML5 and nodeJS / binaryJS. If so, how would you do it?

Only one object was found in stackoverflow and it has been since 2010. NodeJS and HTML5 have grown and matured since then.

What people usually do: When using streaming media (such as video or audio) to the server, there is certainly nothing that beats Flash at the current time until getUserMedia () arrives completely, which, frankly, can spend some time until 99 % of browser users will not be able to use it at all.

A common practice for transferring data to a server is to use a Flash or Flex client application, which then connects to the server powered by RTMP, such as RED5 , FMS or Wowza . For example, a client application sending microphone input via RTMP might look (simplified version)

import flash.net.NetStream; private var myMic:Microphone; private var nc:NetConnection; private var ns:NetStream nc = new NetConnection(); ns = new NetStream(nc); nc.connect(rtmp://localhost/serverApp); myMic = Microphone.getMicrophone(); ns.attachAudio(myMic); 

Together with the server application, you can easily transfer data to the server.

What I would like to do: An application server running on nodeJS (possibly implementing socketIO and binaryJS ) that captures the incoming RTMP stream. Something like

 //require var rtmp = require('node-rtmp'), var fs = require('fs'); //rtmp server address var rtmpServer = 'rtmp://localhost'; //create a binary server listening that receives stream data var RTMPServer = rtmp.RTMPServer(); var server = RTMPServer ({port: 1935}); server.on('connection', function(client){ //check if user is allowed to do so rtmp.newStream(client.stream); }); 

It might be better to use socketIO to differentiate user interactions using eventEmitters.

What may be the benefits:. Generally speaking, it seems a bit overkill to make such an approach, but there may be advantages to me, and I would also like you to comment on this.

  • simple verification of user interaction by running, for example. express and socketIO
  • hybrid flash implementation (via RTMP) and getUserMedia () (via binary transport mechanisms by adding binary JS and Mozilla AudioAPI)
  • if getUserMedia () is fully supported, Flash implementations can be easily removed.
  • more control over rtmp execution and user interaction in general
  • Simplified implementation in server infrastructure.

UPDATE: I spoke with Mr. Malcontenti-Wilson, who is only responsible for the node-rtmp package , which was written but stopped 8 months ago because it was poorly written, and it ended up at the checkpoint. Has anyone used this or were able to verify the code?

UPDATE 2: Mr. Malcontenti-Wilson will just send me a letter to draw attention to node -mtrude (a kind of odd name), which does something like what we probably want. Does anyone work with such a package?

+56
audio-streaming webrtc rtmp red5
24 Oct. '12 at 15:33
source share
3 answers

Yes, it is possible, but you have a few problems.

1) Red5 is terribly underestimated and erroneous.

2) rtmpe / rtmps

3) performance / scalability

4) 1 - 3 - these are things that you can overcome, but are not too familiar with the distribution of the media and all the problems associated with them. When you are done, you will become one of the 800 people who truly understand this. You will have to go a long way to solving unexpected problems.

+1
Apr 13 '13 at
source share

Currently, there is a platform called vertx where polygons can be created. Thus, the red bank can be enabled on your server side with existing code and can run the rtmp streaming server. On the client side, you can have something like video.js or a JW player to play the stream back and get a flash return policy. Client-side publishing, I'm not sure if there is any javascript based RTMP implementation or not.

+1
Dec 31 '14 at 12:15
source share

WCS is a hybrid implementation for Flash, WebRTC, SIP, Websockets and Wowza-compatible protocols: RTSP, RTMP.

Flow Conversion Scheme: enter image description here

0
Sep 11 '15 at 21:29
source share



All Articles