Live555:MultiFramedRTPSink::afterGettingFrame1(): The input frame data was too large for our buffer

live555直播h264异常优化:

MultiFramedRTPSink::afterGettingFrame1(): The input frame data was too large for our buffer size (61140).  21339 bytes of trailing data was dropped!  Correct this by increasing "OutPacketBuffer::maxSize" to at least 81339, *before* creating this 'RTPSink'.  (Current value is 60000.)

 

优化:

  1. 在“live/liveMedia/StreamParser.cpp”中扩展帧解析buffer大小,即BANK_SIZE,默认值为150k,根据传输的H264数据帧大小,至少设置为300k。否则超出大小,可能会被Live555抛弃。
  2. 在“live/liveMedia/MediaSink.cpp”中增加OutPacketBuffer::maxSize大小,同样为了容纳超大帧数据,否则可能会导致数据丢失,设置为 600000。
  3. 在“live/liveMedia/MultiFramedRTPsource.cpp”中--129行,增加socket发送缓冲区大小,即increaseSendBufferTo函数的参数值--increaseRecieveBufferTo(env, RTPgs-> socketNUm(), 2000000)”

在调度方面的优化:MultiFramedRTPSink::sendPacketIfNecessary--402行

#if 0
    // We have more frames left to send.  Figure out when the next frame
    // is due to start playing, then make sure that we wait this long before
    // sending the next packet.
    struct timeval timeNow;
    gettimeofday(&timeNow, NULL);
    int secsDiff = fNextSendTime.tv_sec - timeNow.tv_sec;
    int64_t uSecondsToGo = secsDiff*1000000 + (fNextSendTime.tv_usec - timeNow.tv_usec);
    if (uSecondsToGo < 0 || secsDiff < 0) { // sanity check: Make sure that the time-to-delay is non-negative:
      uSecondsToGo = 0;
    }

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

  • 3
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值