[Live-devel] Streaming from a live camera

Martin Morissette martin.morissette at gmail.com
Sun Feb 20 21:49:57 PST 2005


Hi,

I am having a few problems trying to stream video from a firewire
camera. Here is how I currently do it:

void MpegSource::doGetNextFrame()
{
   actualSize = encoder->encodeFrame(fTo);
   deliverFrame();

   nextTask() = envir().taskScheduler().scheduleDelayedTask(0,
(TaskFunc*)afterGetting, this);
}

void MpegSource::deliverFrame()
{
   if(actualSize > fMaxSize)
   {
      fNumTruncatedBytes = actualSize - fMaxSize;
      fFrameSize = fMaxSize;
   }
   else
   {
      fNumTruncatedBytes = 0;
      fFrameSize = actualSize;
   }
   
   fPresentationTime = actualTime;
   
}

The encoder variable is an XviD MPEG4 video encoder that encodes the
frames from my camera, settnig fTo to the encoded frame and returning
the size of the encoded frame.

Unfortunetely this does not work. Do you see anything wrong? 

Also, is it possible with LIVE.com to dynamically add streams to the
RTSP server. Let me explain myself ;-).
Currently, I have a acquisition server running that grabs frames from
2 cameras and applies different vision algorithm. Live runs in it's
own Thread (common c++ thread). Only one other thread communicates
with the LIVE thread. Is it possible to have one RTSP server running
and adding (or removing) a stream (let's say the output of a certain
vision algorithm) to it whenever a client request it (the request will
be managed by my acquisition server wich will then communicate with
the LIVE thread). Can I simply create a SMS for each requested stream
and add it to the rtsp server using:
rtspServer->addServerMediaSession(sms)
? If there is no SMS added to the rtsp server, will it work correctly?
Do I absolutely need a SMS?

I hope my questions were clear...

Thank you
Martin


More information about the live-devel mailing list