[Libwebsockets] Video streaming

Andy Green andy at warmcat.com
Sun Oct 11 07:28:06 CEST 2020

On 10/11/20 5:25 AM, Ernesto Messina wrote:
> Hi!
> I would like to see an example of how to stream video to the connected
> clients. The scenario would be a camera streaming.

That's a lot of work for a specific stack, atm I have no reason to stop 
what I am doing and work on that.  But it sounds like you have a reason, 
so if you want to work on it and contribute it I will try to help.  If 
you just want freebies, well, no freebies today for that one.

The client work is already done by WebRTC already in all the browsers, 
because of that what you probably want is a WebRTC headless proxy, so 
the source of the video data is also browser that has already taken care 
of the capture and encoding, and other browsers can join the same 
session at the server and consume copies of the stream.  AFAICS the 
other parts of the job are

1) create a minimal RFC7118 ws protocol (it's SIP in ws messages) for 
bulk data connection management aka "signalling"


this is reasonably simple in itself and lws can do it as user code fine 

2) You need to assist clients for real implementations with STUN + TURN 
service, there seems to be standalone projects for this, eg 

3) Manage distribution of the bulk video data between consuming clients, 
this is usually over UDP, which lws also supports.  lws_sul 
high-resolution scheduler was designed to support UDP short-interval 
retries so this should all work inside lws user code semantics as well.


More information about the Libwebsockets mailing list