[Live-devel] Frames are corrupted

Jeff Shanab jshanab at jfs-tech.com
Tue Apr 15 09:23:13 PDT 2014


Check Byte Alignment,Pixel format, and encoder slices.

How are you encodeing them? If the frames are large, then the encoder may
spit out more than one frame with the same timestamp and differnt sequence
number.
Nal units may be [7][8][5][5][5][1][1][1]... instead of simply
[7][8][5][1][1][1]....

There is also the original sampling pixle buffer stuff Is it YUV 4:2:2 or
4:4:1

http://www.fourcc.org/yuv.php

Since this determines the layout in memory for each frame it could show up
this way.

Just looking at the images. it almost looks like the byte alignment is not
being honoured and the frame is cut off. I do not see loss of color levels
which happens when you get all the Y and miss the end of the frame that is
packed [ydata][udata][vdata]

It looks instead like first the lines are not an exact power of two in
length and the pading is missed causeing the image to shear to the right a
bit each line. It can cause you to run out of pixels if they are off in
some byte-alignment off-screen area and then the rest of the image just
shows tha last known pixels over and over.




On Tue, Apr 15, 2014 at 7:17 AM, Vikram Singh <vikram at vizexperts.com> wrote:

> 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(&currentTime,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.
>
>
>
> _______________________________________________
> live-devel mailing list
> live-devel at lists.live555.com
> http://lists.live555.com/mailman/listinfo/live-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20140415/99487b2d/attachment.html>


More information about the live-devel mailing list