[Live-devel] 4 bytes loss during transmission
Nikolai Vorontsov
nikolai.vorontsov at quadrox.be
Fri May 25 04:29:14 PDT 2012
Hello Ross,
could you suggest anything in the following problem:
I'm using slightly modified live555MediaServer to deliver h264 stream to
the client. It looks like 4 bytes constantly missed and I-frames is
mostly not delivered:
On the server side (frame size, fMaxSize, not-fit bytes)
Delivered 7226 (150000) bytes. Left 0 bytes
Delivered 7244 (142774) bytes. Left 0 bytes
Delivered 7001 (135530) bytes. Left 0 bytes
Delivered 7079 (128529) bytes. Left 0 bytes
Delivered 7033 (121450) bytes. Left 0 bytes
Delivered 7097 (114417) bytes. Left 0 bytes
Delivered 61350 (107320) bytes. Left 0 byte << I-frame
Delivered 9784 (45970) bytes. Left 0 bytes
Delivered 8937 (36186) bytes. Left 0 bytes
Delivered 8258 (27249) bytes. Left 0 bytes
Delivered 7798 (18991) bytes. Left 0 bytes
Delivered 7664 (11193) bytes. Left 0 bytes
Delivered 3529 (3529) bytes. Left 3819 bytes
On the client (testRTSPClient with increased
DUMMY_SINK_RECEIVE_BUFFER_SIZE and OutPacketBuffer::maxSize to 1MB):
Received 7222 bytes. Presentation time: 1337944307.315058!
Received 7240 bytes. Presentation time: 1337944307.355058!
Received 6997 bytes. Presentation time: 1337944307.395058!
Received 7075 bytes. Presentation time: 1337944307.435058!
Received 7029 bytes. Presentation time: 1337944307.475058!
Received 7093 bytes. Presentation time: 1337944307.515058!
Received 20 bytes. Presentation time: 1337944307.555058! << Oops,
where is my key frame?
Received 4 bytes. Presentation time: 1337944307.555058!
Received 9780 bytes. Presentation time: 1337944307.595058!
Received 8933 bytes. Presentation time: 1337944307.635058!
Received 8254 bytes. Presentation time: 1337944307.675058!
Received 7794 bytes. Presentation time: 1337944307.715058!
Received 7660 bytes. Presentation time: 1337944307.755058!
Received 7344 bytes. Presentation time: 1337944307.795058!
As I see, the received size is always less by 4 bytes than the sent one
and the I-frame cames as 20 and 4 bytes... Is there any obvious thing
that I missed? Like packet fragmentation or whatever?
My void CQxByteStreamSource::doGetNextFrame() do the following (I
already posted this code here couple of days ago):
if (m_nFilled > 0) // Have some (m_nFilled is the amount of data in
the "buffer" we need to transmit to the client)
{
size_t nToWrite = m_nFilled; // How much do we need to write?
if (nToWrite > fMaxSize) // Not too much
nToWrite = fMaxSize;
memcpy(fTo, m_pBuf, nToWrite); // Data
fFrameSize = nToWrite; // Update properties
fNumTruncatedBytes = 0;
if (m_nFilled > nToWrite) // Move buffer content if necessary
memmove(m_pBuf, m_pBuf + nToWrite, m_nFilled - nToWrite);
m_nFilled -= nToWrite; // Decrease amount of rest bytes
DiagLog((dbg::LOG_TRACE, 20, __FUNCTION__" Delivered %4d (%4d) bytes.
Left %4d bytes", nToWrite, fMaxSize, m_nFilled));
// Go go go!
nextTask() = envir().taskScheduler().scheduleDelayedTask(0,
(TaskFunc*)FramedSource::afterGetting, this);
return true;
}
else
return false;
Thanks in advance,
Nikolai
_________________________________________________________
Nikolai Vorontsov
Quadrox nv
Duigemhofstraat 101
3020 HERENT
Belgium
Tel: +32 16582585 <mailto:nikolai.vorontsov at quadrox.be>
Fax: +32 16582586 <http://www.quadrox.be <http://www.quadrox.be/> >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120525/9f0b06ee/attachment.html>
More information about the live-devel
mailing list