[Live-devel] RSTP Live streaming from USB camera (Ross Finlayson)

Giovanni Iamonte giovanni.iamonte at quintetto.it
Wed Nov 19 08:30:02 PST 2014


Hi Ross.

Thank for your suggestion, after we set the reuseFirstSource to true
everything works as we expect.

Anyway, before this change, when more clients were connected to the
server, the begin sequence that they receiving was SPS, PPS, keyframe,
slice, ..., slice. 
Now when several clients were connected to the server, only the first
one receives the sequence SPS, PPS, Key frames, all the others one
receiving a
slice, slice, ..., SPS, PPS, keyframe.

While maintaining a single live source,  is there  a way for which,
each new client  can always receive a  sequence beginning with  SPS, PPS
and key frames?

This is not a blocking issue, because normally the client discards the
first few slices and snap the correct sequence. Anyway we will
appreciate any suggestions.

Bye




Message: 1
Date: Thu, 13 Nov 2014 06:42:45 -1000
From: Ross Finlayson <finlayson at live555.com>
To: LIVE555 Streaming Media - development & use
	<live-devel at ns.live555.com>
Subject: Re: [Live-devel] RSTP Live streaming from USB camera
Message-ID: <61AC82EC-4D8F-42C6-8945-32781EEA2891 at live555.com>
Content-Type: text/plain; charset="utf-8"

> The only problem that we have is due to fact that we can only have a 
> limited number of connections (client vlc) and this number is related
to the source's resolution.
> If you exceed this number all the VLC clients begin to display
artifacts.
>  
> Source's resolution 320 x 240 allows just  6 VLC connections.
> Source's resolution 640 x 480 allows just 3 VLC connections.
> Source's resolution 1920 x 1080 allows just 1 VLC connection.

Issues like this are almost always caused by running resource
limitations (CPU and/or network), rather than any inherent problem with
the LIVE555 software.

Note also that (based on the experience of others) running more than one
copy of VLC on the same computer tends to perform very poorly, so if
you?re testing multiple VLC clients, you should do so on separate
computers (separate *physical* computers, not separate ?virtual
machines?).

(Also, a reminder (yet again) that VLC is not our software.  The best
way to test RTSP client connections is to begin with our ?openRTSP?
software: <http://www.live555.com/openRTSP/
<http://www.live555.com/openRTSP/>>.  Then, and only then, should you
use a media player (such as VLC).)


> The OS is windows.

That may well  be (at least part of) your problem :-(  Windows is simply
not a serious operating system for running server software.  (It?s 2014;
noone should be doing this anymore.)


>  Below, what we did:
>  
> 1) We used ffmpeg to capture the images from the camera and convert 
> them to  H264 + AAC frames (avcoded)
> 2) These frames were pushed in a circular queue
> 3) In a thread we created a RTP Server, the media session and two 
> subsession, one for the video and the other one  audio (see the code 
> below)
> 4) Starting from the DeviceSource.cpp we created a source that reads
the frames from the circular queue.
>  
> 5) When a client connects to the RTPserver, we create a 
> NewStreamSource and a NewRTPSink. As you can see in the code below,
for the video StreamSource we create a H264VideoStreamDiscreteFramer for
the audio we leave as it is.
>  
> Regarding the RTPSink, for the video, we create an H264VideoRTPSink
and  for the audio we create MPEG4GenericRTPSink.

This all looks good.  One more thing.  Because you?re streaming from a
?live source?, make sure that your ?Live555ServerMediaSubsession?
constructor - when it calls the ?OnDemandServerMediaSubsession?
constructor - sets the ?reuseFirstSource? parameter to True.  (That way,
your input source will never be instantiated more than once
concurrently, regardless of how many RTSP clients you have.)


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.live555.com/pipermail/live-devel/attachments/20141113/1c60
bf02/attachment-0001.html>




More information about the live-devel mailing list