[Live-devel] Fwd: Live555 is not sending the frame

Edimartin Martins edimartin at gmail.com
Wed Jun 19 04:46:41 PDT 2013


Hi. I need use live555 to send a x264 frame from my Camera to the VLC.

I use openCV to get the camera frame and convert from BGR to YUV.
I use x264 to convert the frame.
But the live555 is not sending the frame.


I create a RTSPServer

lookupServerMediaSession(char const* streamName){
	 //
	 //lookUp for the session with the name
	 ServerMediaSession* sms = RTSPServer::lookupServerMediaSession(streamName);
	 if (!sms){
		 //create the session if this is't exist
		 sms = ServerMediaSession::createNew(envir(), streamName,"send
server","sending the camera");
		 if (sms){
			 //add a subsession
			 sms->addSubsession( CameraServerMediaSubsession::createNew(envir(),true) );
		 }
	 }
	 return sms;
 }



The subsession create a FramedSource and VideoRTPSink

FramedSource* CameraServerMediaSubsession::createNewStreamSource(unsigned
clientSessionId,
					      unsigned& estBitrate)

{
	//
	return new CameraStream(this->envir());
}
RTPSink* CameraServerMediaSubsession::createNewRTPSink(Groupsock* rtpGroupsock,
				    unsigned char rtpPayloadTypeIfDynamic,
				    FramedSource* inputSource){
	//
	return CameraVideoRTPSink::createNew(this->envir(),
					rtpGroupsock,
					rtpPayloadTypeIfDynamic);
}



And I write the CameraStream (FramedSource) using this example:

http://www.live555.com/liveMedia/doxygen/html/DeviceSource_8cpp-source.html

Here is the code.

void CameraStream::doGetNextFrame(){
	//
	if (!isCurrentlyAwaitingData()) return; // we're not ready for the data yet

	//get the size of the x264 frame
	unsigned newFrameSize = cameraSize;
	//create the frame
	u_int8_t* newFrameDataStart = new u_int8_t[newFrameSize];

	
	//copy the frame data
	memcpy(newFrameDataStart,camera,cameraSize);

	//This I found in the example
	if (newFrameSize > fMaxSize) {
		fFrameSize = fMaxSize;
		fNumTruncatedBytes = newFrameSize - fMaxSize;
	} else {
		fFrameSize = newFrameSize;
	}

	//move the frame to FTO
	memmove(fTo, newFrameDataStart, fFrameSize);

	//Inform the reader it's now avaliable
	FramedSource::afterGetting(this);

}



The server run the doGetNextFrame function in CameraStream. But the frame
is not sent.
How can I set the live555 to send the frame?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130619/858fd013/attachment-0001.html>


More information about the live-devel mailing list