[Live-devel] QTKit QTCaptureSession as a DeviceSource

Austin Snow asnow at pathfindertv.net
Wed Dec 31 07:42:25 PST 2008


Hello All,
I having some difficulty on getting samples out of a QTCaptureSession  
into MPEG4VideoStreamDiscreteFramer.

The DeviceSource::doNextFrame is only being called every 1 to 1.5  
seconds, the delay is not in  
MPEG4VideoStreamDiscreteFramer::doGetNextFrame().

A binary file of the QTCaptureSession output can be seen at the  
following link;
http://www.pathfindertv.net/555/stream-from-qt.bin

I think there may be something missing in the bit stream from QT that  
is causing MPEG4VideoStreamDiscreteFramer not to be able to parse the  
incoming stream.

modulo_time_base and vop_time_increment are always zero.

Every call to DeviceSource::deliverFrame the data starts with  
000001B6......  the vop start code.  There is not any  
000001B3xxx000001B6..... (group of vop start code) or 000001B0....  
(visual object sequence start code) in the QTCaptureSession output.

I tried to use MPEG4VideoStreamFramer but it needs the 000001B0....  
(visual object sequence start code) in order to accepted the stream.

My input is defined and used as below;

  MPEG4VideoStreamDiscreteFramer* videoSource;
.
.
   DeviceParameters params;
   fileSource = DeviceSource::createNew(*env, params);
.
.
   FramedSource* videoES = fileSource;
   videoSource = MPEG4VideoStreamDiscreteFramer::createNew(*env,  
videoES);
	
   // Finally, start playing:
   *env << "Beginning to read from file...\n";
   videoSink->startPlaying(*videoSource, afterPlaying, videoSink);
.
.

The rest of the code is based in testMPEG4VideoStreamer.cpp

I have modified DeviceSource.cpp deliverFrame to deliverFrame(void  
*data, int len) to pass data into it.  And in the deliverFrame  
function follows;

  if (!isCurrentlyAwaitingData()) return; // we're not ready for the  
data yet

    // Deliver the data here:
	if(fMaxSize < len){
		fNumTruncatedBytes = len - fMaxSize;
		len = fMaxSize;		
		printf("Frame size truncated\n");		
	}
	fDurationInMicroseconds = dura;
	fFrameSize = len;	
	memcpy(fTo, data, len);

   // After delivering the data, inform the reader that it is now  
available:
   FramedSource::afterGetting(this);

Any help would be great.

Thanks
Austin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20081231/afcbc532/attachment-0001.html>


More information about the live-devel mailing list