[Live-devel] MPEG4 streaming using ffmpeg as encoder
Ross Finlayson
finlayson at live555.com
Fri Oct 18 15:17:03 PDT 2013
> Thank you for the clarification. I will try to send this extra data as first packet. I have another confusion. if i send this packet as first packet when there was no client attached to it and later on client attached to it than how will that client get this packet
As long as you deliver this extra data as the first frame - when you do your first delivery - then it will get remembered (as special 'configuration data') by the downstream "MPEG4VideoStreamDiscreteFramer" object. No problem.
I assume that your "ServerMediaSubsession" subclass (for your RTSP server) is similar to the code for "MPEG4VideoFileServerMediaSubsession", in that you are implementing not only the virtual functions "createNewStreamSource()" and "createNewRTPSink()", but also the virtual function "getAuxSDPLine()" (in the same way as is done in "MPEG4VideoFileServerMediaSubsession.cpp").
> Right now the way I am using FrameSource is:
>
> /****************************************************************/
> void MyStreamingDeviceSource::streamPacket(AVPacket pkt)
> {
> m_queue.putPacket(&pkt);
> envir().taskScheduler().triggerEvent(m_eventID, this);
> }
> /***************************************************************/
>
> so it does not matter if a client is attached or not I keep on sending the data to network.
OK, so you'll need to add this line to the start of your "deliverFrame()" function:
if (!isCurrentlyAwaitingData()) return; // we're not ready for the data yet
(see the example in "DeviceSource.cpp")
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/20131018/a4925c72/attachment-0001.html>
More information about the live-devel
mailing list