[Live-devel] Streaming Stops for larger frameBuff size Issue

Ashfaque ashfaque at iwavesystems.com
Mon Apr 9 00:55:34 PDT 2012


Hi Ross,

I am facing a typical problem where the streaming stops after some time if the encoded frame buffer size is more. If I keep the buffer size less (ActualSize/8), streaming goes normal.

I had implemented my own H264Source subclass of FramedSource (to read frames at 30fps from USB camera and encodes using VPU encoder).
I am triggering the streaming thread at every 20ms and using testProgs/testRTSPClient for testing the reception of streams. 

below is the code:

void H264Source::deliverFrame() {

    if (!isCurrentlyAwaitingData()) return;

    u32 EncFrameSize = 0;
    u32& newFrameSize  = EncFrameSize;
    static int k = 0;

    printf("Reading Frames: k = %d\r\n", k++);

    /* Get the frames from the camera */
    CameraDevice::getInstance()->GetFrame(m_pu8RawFrameBuff, m_u16RawBuffLen);

    /* encode the frames with hardware encoder */
    m_pEncoder->EncodeFrameBuff(m_pu8RawFrameBuff, m_u16RawBuffLen, m_pu8EncFrameBuff, newFrameSize);
    // After encoding newFrameSize can be maximum of 640 * 480 = 307200 */
   
    if (newFrameSize > fMaxSize) {
        fFrameSize = fMaxSize;
        fNumTruncatedBytes = newFrameSize - fMaxSize;
    } else {
        fFrameSize = newFrameSize;
    }

    gettimeofday(&fPresentationTime, NULL);
    memmove(fTo, m_pu8EncFrameBuff, fFrameSize);

    FramedSource::afterGetting(this);

    m_bProcessingDone = true;
}

Is the problem with newFrameSize being too large or any other reason?

Is my way to getting the frames and processing is correct or Any other better way to accomplish this? What is the maximum size of frames that is supported ? I need to pass complete frames only for compatibility with the receiver application.

Thanks in advance.

Ashfaque
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120409/0492f23d/attachment.html>


More information about the live-devel mailing list