Note that there are some explanatory texts on larger screens.

plurals
  1. PONodeJS and RED 5 media server via RTMP
    primarykey
    data
    text
    <p>This is more a conceptual question rather than a direct "how to do this". </p> <p><em>Is it generally possible to implement a flash-like solution to stream the audio (independent of where we get the stream data from, e.g. webRTC or other) in HTML5 and nodeJS/binaryJS. If so, how would you go about this?</em></p> <p>There has been only one inquire on stackoverflow <a href="https://stackoverflow.com/questions/11891818/rtmp-implementation-in-nodejs-is-possible">found here</a> and its from 2010. NodeJS and HTML5 have grown and matured since then.</p> <p><strong>What people usually do:</strong> When using multimedia streaming (i.e. video or audio) to a server, there is definitely nothing that beats Flash at the current point in time till the full arrival of <a href="http://dev.w3.org/2011/webrtc/editor/getusermedia.html" rel="nofollow noreferrer">getUserMedia()</a> - which quite honestly might <a href="http://caniuse.com/#search=getusermedia" rel="nofollow noreferrer">take a while</a> till 99% of the browser users will get to use it at all.</p> <p>General practice to stream data to the server is by using a client Flash or Flex application which is then connecting to a RTMP protocol powered media server like <a href="http://www.red5.org/" rel="nofollow noreferrer">RED5</a>, <a href="http://www.adobe.com/products/adobe-media-server-family.html" rel="nofollow noreferrer">FMS</a> or <a href="http://www.wowza.com" rel="nofollow noreferrer">Wowza</a>. For example, the client app sending the microphone input over RTMP could look like (simplified version)</p> <pre><code>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); </code></pre> <p>Together with a server application one is easibly able to stream data to the server.</p> <p><strong>What I would like to do:</strong> Have an app server running on <a href="http://nodejs.org/" rel="nofollow noreferrer">nodeJS</a> (possibly implementing <a href="http://socket.io/" rel="nofollow noreferrer">socketIO</a> and <a href="http://binaryjs.com/" rel="nofollow noreferrer">binaryJS</a>) that catches the incoming RTMP stream. Something like</p> <pre><code>//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); }); </code></pre> <p>Possibly it might be better to use socketIO to differentiate between user interactions via eventEmitters.</p> <p><strong>What might be the advantages:</strong> Generally speaking it seems like a bit overhead to make this kind of approach, but for me there might be advantages and I'd also like you to comment on this.</p> <ul> <li>easy validation of user interaction by running e.g. <a href="http://expressjs.com/" rel="nofollow noreferrer">express</a> and socketIO</li> <li>hybrid implementation of a flash (via RTMP) and getUserMedia() (via binary transport mechanisms by adding binaryJS and the Mozilla AudioAPI)</li> <li>if getUserMedia() gets fully supported, flash implementations can be dropped easily</li> <li>more control over the rtmp followup and user interaction in general</li> <li>easier implementation into server frameworks</li> </ul> <p><strong>UPDATE:</strong> I've talked to Mr. Malcontenti-Wilson who is responsible for the <a href="https://github.com/adammw/node-rtmp" rel="nofollow noreferrer">only node-rtmp package</a> that was written but discontinued 8 months ago as it was poorly written and he hit a roadblock. Anyone who used this or was able to check the code?</p> <p><strong>UPDATE 2:</strong> Mr. Malcontenti-Wilson just send me a mail to get my attention to <a href="https://github.com/nalply/mtrude" rel="nofollow noreferrer">node-mtrude</a> (kind of an odd name) which is doing kind of what we would probably want. Has anyone work with this kind of package?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload