[Live-devel] [Mirasys] Live555 RTSP server questions

Victor Vitkovskiy victor.vitkovskiy at mirasys.com
Wed Jan 26 04:39:57 PST 2022


Hello Ross, 

Yes, I know that OutPacketBuffer::maxSize=30000 is not enough for handling 56Kb frame, I just trying to handle a situation when OutPacketBuffer::maxSize is set to lower value then a frame that we need to send.
I am trying to use fNumTruncatedBytes to proceed somehow big frames according to the information you proposed earlier.

I have something like this:
    auto frame = mFramesQueue.front();
    auto frameLength = frame->GetDataLen() - mLastFrameOffset;

    if (frameLength > fMaxSize) {
        memcpy_s(fTo, fMaxSize, frame->GetData() + mLastFrameOffset, fMaxSize);
        // Update offset
        mLastFrameOffset += fMaxSize;
        // Update num of truncated bytes
        fNumTruncatedBytes = frameLength - fMaxSize;
        // Set frame size
        fFrameSize = fMaxSize;
    }
    else {
        memcpy_s(fTo, fMaxSize, frame->GetData() + mLastFrameOffset, frameLength);
        // Remove frame from the queue
        mFramesQueue.pop();
        // Set frame time
        gettimeofday(&fPresentationTime, NULL);
        // Reset num of truncated bytes
        fNumTruncatedBytes = 0;
        // Reset offset
        mLastFrameOffset = 0;
        // Set frame size
        fFrameSize = frameLength;
    }

So, I take frame from the queue and if output buffer size is not enough to copy whole frame - I copy only fMaxSize bytes to output buffer and save mLastFrameOffset to proceed other part of frame in next doGetNextFrame call. 
But this approach fails with error described earlier just after the first part of the frame is copied to output buffer.

Best regards,
-----------------------------------------
Victor Vitkovskiy
Senior software developer
mailto: victor.vitkovskiy at mirasys.com
www.mirasys.com


-----Original Message-----
From: live-devel <live-devel-bounces at us.live555.com> On Behalf Of Ross Finlayson
Sent: Wednesday, 26 January 2022 14:03
To: LIVE555 Streaming Media - development & use <live-devel at us.live555.com>
Subject: Re: [Live-devel] [Mirasys] Live555 RTSP server questions

EXTERNAL


> On Jan 26, 2022, at 10:28 PM, Victor Vitkovskiy <victor.vitkovskiy at mirasys.com> wrote:
>
> Hello Ross,
>
> Thank you for information.
>
> I have tried like you said, but I have this error:
> MultiFramedRTPSink::afterGettingFrame1(): The input frame data was too 
> large for our buffer size (30480).  26917 bytes of trailing data was dropped!  Correct this by increasing "OutPacketBuffer::maxSize" to at least 56917, *before* creating this 'RTPSink'.  (Current value is 30000.) I have set OutPacketBuffer::maxSize to 30000 and frame in this case is 56917.
> I copied 30000 bytes to fTo buffer and set fFrameSize to fMaxSize value (30000), also fNumTruncatedBytes is 26917.
>
> Seems that we need to add also RTP header data to this 30000 buffer (480 bytes) and that’s why I have an error, is this correct?

No.  Our software automatically takes the size of the RTP header (which, BTW, is 12 bytes, note 480 bytes) into account.  You don’t have to care about this.

Your problem is that your value of "OutPacketBuffer::maxSize” is too low.  I suggest setting it to 300000, as is done in “testOnDemandRTSPServer.cpp”.


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


_______________________________________________
live-devel mailing list
live-devel at lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel



More information about the live-devel mailing list