首页 > 其他 > 详细

live555 x264参数修改

时间:2020-09-17 18:31:13      阅读:68      评论:0      收藏:0      [点我收藏+]

以640*480为例

live555/liveMedia/StreamParsercpp.cpp:
define BANK_SIZE 15000 改为:
define BANK_SIZE 3000000

live555/mediaServer/DynamicRTSPServer.cpp:
OutPacketBuffer::maxSize一共有4处全部改为
OutPacketBuffer::maxSize = 2000000;

live555/liveMedia/MediaSink.cpp:
unsigned OutPacketBuffer::maxSize = 60000;改为
unsigned OutPacketBuffer::maxSize = 2000000;

继承framedSource之后

unsigned H264FramedLiveSource::maxFrameSize() const
{
  return 1024*180;
}

 

MediaSink.cpp
114行:
unsigned OutPacketBuffer::maxSize = 30000;

StreamParser.cp
宏定义:
#define BANK_SIZE 150000,改为2400000;

MultiFramedRTPSink.cpp
47行:
setPacketSizes(1000, 8192);


RTPInterface.cpp
129行:
increaseSendBufferTo(envir(), fGS->socketNum(), 512*1024);
//数据累积发送,不再单独发送
//注释掉332行,修改为以下:
//if (!sendDataOverTCP(socketNum, framingHeader, 4, False)) break;
//if (!sendDataOverTCP(socketNum, packet, packetSize, True)) break;
struct iovec iov[2];
iov[0].iov_base = framingHeader;
iov[0].iov_len = 4;
iov[1].iov_base = packet;
iov[1].iov_len = packetSize;
writev(socketNum, iov, 2);

帧率改为30,直播延迟就由5延迟慢慢减少到1秒不到,不知道为什么会这样,如果是24帧,直播延迟会越来越大

encoder->x264_parameter->i_fps_num = 30;//码率分子
encoder->x264_parameter->i_fps_den = 1;//码率分母

 

live555 x264参数修改

原文:https://www.cnblogs.com/leocc325/p/13686038.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!