[Live-devel] Frames are corrupted
Vikram Singh
vikram at vizexperts.com
Tue Apr 15 04:17:52 PDT 2014
Hi Everyone,
I am trying to stream the frames I capture from OpenGL frame buffer.
I am using LIVE555 library code for that and I am trying to stream it using
RTSP.
I encode the frames to H264 format.
I have written a custom class "LiveSourceWithx264" which derives from
"FramedSource".
This class has the function "doGetNextFrame()" and it has the following
code.
gettimeofday(¤tTime,NULL);
if(!isCurrentlyAwaitingData()) return;
void* buf = NULL;
buf = RTSPstreamQueue->getBuf( fFrameSize, false );
if ( fFrameSize > fMaxSize )
{
fNumTruncatedBytes = fFrameSize - fMaxSize;
fFrameSize = fMaxSize;
}
fPresentationTime = currentTime;
memmove(fTo, buf, fFrameSize);
RTSPstreamQueue->releaseBuf();
FramedSource::afterGetting(this);
In the above code RTSPstreamQueue function returns a pointer to the frame
and the sets the size of the frame in the variable fFrameSize.
But if fFrameSize is greater than fMaxSize then I have to truncate the data.
I think this is what that is causing the corrupted frames.
Please take a look at the attachments to get an idea how the frames are
getting corrupted.
Is there any way to get around this problem.
Any pointer would be appretiated.
Thanks
Vikram Singh.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20140415/4cab6a85/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Client.png
Type: image/png
Size: 324526 bytes
Desc: not available
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20140415/4cab6a85/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Server.png
Type: image/png
Size: 119080 bytes
Desc: not available
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20140415/4cab6a85/attachment-0003.png>
More information about the live-devel
mailing list