[Live-devel] newbie problem delivering frames to parser

xavier nikoxan at mixmail.com
Fri Jul 16 12:40:46 PDT 2004


Hi all,
I am a newbie using live.com, and I've been trying to adapt the
testMPEG1or2AudioVideoStreamer program so as to acquire the video and audio data from the
output of my application instead of a stored file. To begin with, I started with the video
stream and left the audio stuff for the future. To simplify the client job, uncommented
the internal RTSP server with the passive media sessions.

I've written my own DeviceSource inheriting from FramedSource, it is named
RPVRFramedSource. In the main source, the MPEG1or2VideoStreamFramer videoSource calls my
RPVRFramedSource instead of the FramedSource of the demuxed from the video file. It
compiles ok, but, when executing the main loop, the BANK_SIZE sanity check of the
StreamParser warns me every three frames:

#StreamParser# store 115200, read 38400, SUM 153600 BANK_SIZE 150000
StreamParser::afterGettingBytes() warning: read 34800 bytes; expected no more than 34800

I understand that this is the point when a Bank is swapped for the other, so I thought
that this warning was not a problem at all. However, when I try to receive the stream with
my vlc, it says that no stream is being sent at all. 

I use ffmpeg libavcodec-libavformat for frame handling. 
RPVRFramedSource delivers AVFRAME 160*160 YUV12 planar images with 1 byte depth and a size
of 160*160*1.5=38400 bytes. Is there any problem with this frame format to be parsed? 

Any help would be really appreciated, as I'm really stucked at this point.

I attach the "doGetNextFrame" from my RPVRFramedSource:

static struct timezone quin;
static AVFrame *picture;
static int size;//en bytes

void RPVRFramedSource::doGetNextFrame()
{
 fTo=picture->data[0];
 fFrameSize=size;
 if(fFrameSize>fMaxSize)
	fNumTruncatedBytes=fFrameSize-fMaxSize;
   
    // We don't know a specific play time duration for this data,
    // so just record the current time as being the 'presentation time':

 gettimeofday(&fPresentationTime, &quin);
  
  
// After delivering the data, switch to another task, and inform
  // the reader that he has data:

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

Regards, 
        Xavier
---------------------------------------------------------
Este verano... ¡Aprovecha para enamorarte! Con el 2x1 de Muchagente http://www.muchagente.com
Ya.com ADSL Router Wi-Fi: Sólo 29,90 €/mes + IVA*. Router + Antivirus y firewall ¡Gratis! http://acceso.ya.com/adsl/256router



More information about the live-devel mailing list