Low latency Video streaming using node.js and gstreamer

Mark Howell mark-sub1 at hypgnosys.org
Thu Oct 24 15:44:06 PDT 2013


On 10/04/2013 01:39 PM, sms_1190 wrote:
> Hello,
>
> I am trying to create node.js server which will use gstreamer to capture
> video from webcam and publish that video to some link. Clients will connect
> to that server and can stream video using video tag. How can I get less than
> 1 second delay in streaming? How to set parameters for gstreamer? If any one
> can help me with that, I would be grateful.
>

[snip]

Well I see a few different non-trivial topics here.

I can't comment on working with GStreamer from node/v8, but it can be 
done with python and gobject introspection, and therefore I surmise it 
could be done with a js impl that works with gobject introspection, such 
as https://github.com/creationix/node-gir.

Another topic is how to stream... h.264 over RTSP? M-JPEG over HTTP? 
VP8? etc. For the former, you could try try gst-rtsp-server. That is not 
yet conveniently packaged *with introspection* in the cerbero gstreamer 
SDK build system, but the current code gst-rtsp-server will build and 
work in the GStreamer 1.2 environment. (There is no blessed/tagged 
release for the 1.0 environment AFAICT, which is a mild bummer). I have 
gst-rtsp-server building in cerbero in my sandbox with introspection so 
I can use it from python (mostly need to bring gobject-introspection 
into cerbero and update some other recipes to enable introspection).

There might be a node package for RTSP etc, I dunno. M-JPEG over HTTP I 
expect you could do within your node web app if there aren't already 
toys to do it.

Another topic is how to get low latency. When you first try this with, 
say, the x264enc element with default settings you might get several 
seconds of latency, but with the right x264 option kung-fu (and client 
side configuration) you can get < 1 sec latency. See 
http://x264dev.multimedia.cx/archives/249 and be prepared to experiment.

Cheers,

Mark.


More information about the gstreamer-devel mailing list