mirror of
https://gitee.com/xia-chu/ZLMediaKit.git
synced 2026-05-20 00:37:49 +08:00
新增帧合并开关,优化国标流秒开速度
Some checks failed
Android / build (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Docker / build (push) Has been cancelled
Linux / build (push) Has been cancelled
macOS / build (push) Has been cancelled
Windows / build (push) Has been cancelled
Some checks failed
Android / build (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Docker / build (push) Has been cancelled
Linux / build (push) Has been cancelled
macOS / build (push) Has been cancelled
Windows / build (push) Has been cancelled
This commit is contained in:
parent
897d127099
commit
57b5c82495
@ -342,6 +342,8 @@ rtp_g711_dur_ms = 100
|
|||||||
#udp接收数据socket buffer大小配置
|
#udp接收数据socket buffer大小配置
|
||||||
#4*1024*1024=4196304
|
#4*1024*1024=4196304
|
||||||
udp_recv_socket_buffer=4194304
|
udp_recv_socket_buffer=4194304
|
||||||
|
#ps/ts解析后是否等待下一帧以判断本帧是否完整,开启后提高兼容性,但是可能增加延时
|
||||||
|
merge_frame=1
|
||||||
|
|
||||||
[rtc]
|
[rtc]
|
||||||
#rtc播放推流、播放超时时间
|
#rtc播放推流、播放超时时间
|
||||||
|
|||||||
@ -366,6 +366,7 @@ const string kOpusPT = RTP_PROXY_FIELD "opus_pt";
|
|||||||
const string kGopCache = RTP_PROXY_FIELD "gop_cache";
|
const string kGopCache = RTP_PROXY_FIELD "gop_cache";
|
||||||
const string kRtpG711DurMs = RTP_PROXY_FIELD "rtp_g711_dur_ms";
|
const string kRtpG711DurMs = RTP_PROXY_FIELD "rtp_g711_dur_ms";
|
||||||
const string kUdpRecvSocketBuffer = RTP_PROXY_FIELD "udp_recv_socket_buffer";
|
const string kUdpRecvSocketBuffer = RTP_PROXY_FIELD "udp_recv_socket_buffer";
|
||||||
|
const std::string kMergeFrame = RTP_PROXY_FIELD "merge_frame";
|
||||||
|
|
||||||
static onceToken token([]() {
|
static onceToken token([]() {
|
||||||
mINI::Instance()[kDumpDir] = "";
|
mINI::Instance()[kDumpDir] = "";
|
||||||
@ -378,6 +379,7 @@ static onceToken token([]() {
|
|||||||
mINI::Instance()[kGopCache] = 1;
|
mINI::Instance()[kGopCache] = 1;
|
||||||
mINI::Instance()[kRtpG711DurMs] = 100;
|
mINI::Instance()[kRtpG711DurMs] = 100;
|
||||||
mINI::Instance()[kUdpRecvSocketBuffer] = 4 * 1024 * 1024;
|
mINI::Instance()[kUdpRecvSocketBuffer] = 4 * 1024 * 1024;
|
||||||
|
mINI::Instance()[kMergeFrame] = 1;
|
||||||
});
|
});
|
||||||
} // namespace RtpProxy
|
} // namespace RtpProxy
|
||||||
|
|
||||||
|
|||||||
@ -563,6 +563,8 @@ extern const std::string kGopCache;
|
|||||||
extern const std::string kRtpG711DurMs;
|
extern const std::string kRtpG711DurMs;
|
||||||
// udp recv socket buffer size
|
// udp recv socket buffer size
|
||||||
extern const std::string kUdpRecvSocketBuffer;
|
extern const std::string kUdpRecvSocketBuffer;
|
||||||
|
// ps/ts解析后是否等待下一帧以判断本帧是否完整,开启后提高兼容性,但是可能增加延时
|
||||||
|
extern const std::string kMergeFrame;
|
||||||
} // namespace RtpProxy
|
} // namespace RtpProxy
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
#include "Decoder.h"
|
#include "Decoder.h"
|
||||||
#include "PSDecoder.h"
|
#include "PSDecoder.h"
|
||||||
#include "TSDecoder.h"
|
#include "TSDecoder.h"
|
||||||
|
#include "Common/config.h"
|
||||||
#include "Extension/Factory.h"
|
#include "Extension/Factory.h"
|
||||||
|
|
||||||
#if defined(ENABLE_RTPPROXY) || defined(ENABLE_HLS)
|
#if defined(ENABLE_RTPPROXY) || defined(ENABLE_HLS)
|
||||||
@ -122,8 +123,9 @@ void DecoderImp::onDecode(int stream, int codecid, int flags, int64_t pts, int64
|
|||||||
WarnL << "Unsupported codec :" << getCodecName(codec);
|
WarnL << "Unsupported codec :" << getCodecName(codec);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
GET_CONFIG(bool, merge_frame, RtpProxy::kMergeFrame)
|
||||||
auto frame = Factory::getFrameFromPtr(codec, (char *)data, bytes, dts, pts);
|
auto frame = Factory::getFrameFromPtr(codec, (char *)data, bytes, dts, pts);
|
||||||
if (getTrackType(codec) != TrackVideo) {
|
if (getTrackType(codec) != TrackVideo || !merge_frame) {
|
||||||
onFrame(stream, frame);
|
onFrame(stream, frame);
|
||||||
if (_last_is_keyframe && _video_merge) {
|
if (_last_is_keyframe && _video_merge) {
|
||||||
// 上次是关键帧,收到音频后,说明帧收齐了
|
// 上次是关键帧,收到音频后,说明帧收齐了
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user