[Live-devel] livemedia lib throughput speed limitations

Tao Wu lanlantao at gmail.com
Fri May 21 15:43:49 PDT 2010


Hi,

I am trying to figure out the H264 throughput speed of livemedia library. As
I know, the library uses durationInMicroseconds in
H264FUAFragmenter::afterGettingFrame, which finally passes the value to
MultiFramedRTPSink::sendPacketIfNecessary() to determine the when to send
next frame.
(
    struct timeval timeNow;
    gettimeofday(&timeNow, NULL);
    int uSecondsToGo;
    if (fNextSendTime.tv_sec < timeNow.tv_sec
    || (fNextSendTime.tv_sec == timeNow.tv_sec && fNextSendTime.tv_usec <
timeNow.tv_usec)) {
      uSecondsToGo = 0; // prevents integer underflow if too far behind
    } else {
      uSecondsToGo = (fNextSendTime.tv_sec - timeNow.tv_sec)*1000000 +
(fNextSendTime.tv_usec - timeNow.tv_usec);
    }

    // Delay this amount of time:
    nextTask() = envir().taskScheduler().scheduleDelayedTask(uSecondsToGo,
                        (TaskFunc*)sendNext, this);

).
So I adjusted the value of durationInMicroseconds from 33 ms to 1 ms to
observe how fast the library can stream a file. In the experiments, I chose
a small 2MB file to eliminate the impacts of the hard drive (the library
reads the file in memory before streaming). The average size of h264 frames
is around 20KB. openRTSP is used as the client to receive the file.
When the durationInMicroseconds goes to about 1 ms, a significant packet
loss is observed (from the received file size by openRTSP).
Now the question is what cause the packet loss. Is the UDP over network
(network or Linux can not handle it) or the library itself drops the RTP
packet because the CPU can not process that fast (from the above
fNextSendTime, timeNow, I believe a lots of delayed task events will set
uSecondsToGo=0)?
If I want to stream a file very fast and reasonably reliable, what is best
direction to go?

Thanks for any comments.

Tao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20100521/7e768d2d/attachment.html>


More information about the live-devel mailing list