live555: The input frame data was too large for our buffer size 解决方法

 

  在做live555 直播的时候,输入的图片尺寸是320*240 的时候,live555 输出的RTSP数据流可以正常解码,运行没有出现异常现象,但是把图片尺寸改为640*480的时候,就出现了问题:

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

    这个问题的解决方式,在国外的一个网站找到了解决的方法,其原文如下:

/BUFFER SIZE PROBLEM///
    Generally, while running HD stream, one can face packet loss due to ridiculously large NAL units. This will create an error stating something like -> 
“MultiFramedRTPSink::afterGettingFrame1(): The input frame data was too large for our buffer size (60753).  34086 bytes of trailing data was dropped!  Correct this by increasing "OutPacketBuffer::maxSize" to at least 94839, *before* creating this 'RTPSink'.  (Current value is 60000.)”

    To solve this, you need to make the following changes to your code:

    1. Go to “live/liveMedia/MultiFramedRTPsource.cpp” and change “increaseRecieveBufferTo(env, RTPgs-> socketNUm(), 2000000)”
    2. Go to “live/liveMedia/StreamParser.cpp” and increase BANK_SIZE to 300000 or 600000.
(This will also help remove StreamParser Error that you might encounter!)
    3. In “live/liveMedia/MediaSink.cpp” change the value of unsigned OutPacketBuffer::max size to 600000.
    4. In “mediaServer/DynamicRTSPServer.cpp”, change OutPacketBuffer::maxSize to 600000 at all places where it is defined.
    5. *Most importantly, you need to change the code in your own program, more so than the libraries themselves. This means that if you just do what pt.5 tells you to, you can avoid pts 1-4. Therefore, in your code change OutPacketBuffer::maxsize to 600000 (Our code file is testH264VideoStreamer.cpp so we made the above change in that. Note: testH264VideoStreamer.cpp lies in testProgs directory). You NEED to change this value in your code before you create any RTP sinks.
    6. Also to allow for more holistic changes, go to “testProgs/playCommon.cpp” and change the value of fileSinkBufferSize to 600000.
 ///WHAT ELSE CAN BE DONE
    It is more advisable to reduce the buffer size of your stream by increasing compression levels. Also you would need to increase the buffer size of vlc player to allow for smooth streaming. To do so, go to VLC-> Tools -> Preferences -> Select “Show All” -> Click on Stream Output -> Change “stream output muxer caching” to a suitable value in ms. (1500 - 3000)

    与此同时,在我做的H264 直播工程中, 还需要设置const unsigned estimatedSessionBandwidth 的值,需要把它调到一个合适大小的值。

  • 1
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

li_wen01

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值