html5 - How can I forward UDP packets to the browser (node.js? webRTC? other?) while processing it on the way there? -
i want send , later display video in browser. have application takes video camera , converts bytes, later on - sends through udp specific port. - have node.js script receives bytes:
var port = 19777; var multicast_group = "224.0.0.251"; var dgram = require("dgram"); var payload = new buffer('a wild message appears'); var client = dgram.createsocket("udp4"); client.on("message", function(message, rinfo) { console.log("received: ",message,rinfo); }); client.on("listening", function() { console.log("listening on ",client.address()); client.setbroadcast(true); client.setttl(64); client.setmulticastttl(64); client.setmulticastloopback(true); client.addmembership(multicast_group); client.send(payload, 0, payload.length, port, multicast_group, function(err,bytes) { console.log("err: "+err+" bytes: "+bytes); // client.close(); }); }); client.on("close", function() { console.log("closed"); }); client.on("error", function(err) { console.log("error: ",err); }); client.bind(19777);
and after running - see packets in console.
i need process each packet (e.g. check whether current frame) - generates video stream on other site - , - somehow - send client's browser. @ point don't know how process packets - , how stored after receiving them, if can send later browser, how play in browser (html5?), etc...
i'm total beginner when comes node.js , similar, i've read lot during last hours , found article recommends kaazing websocket gateway, i'm not sure if it's still acceptable standard that. also, found webrtc, i'm not sure if can use custom stream (since i'm not using popular video codects).
could give me hint how process now? found stackoverflow previous question, solution provided there no longer online.. i'm lost in , appreciate guys, thanks!
Comments
Post a Comment