mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
optimize SDP input probing for video streams
Set max_ts_probe and fpsprobesize to 0 for SDP video to reduce stream initialization latency. Change-Id: Idfda66cfc72cb1a9d45c6da4e13c73f82859b1de
This commit is contained in:
@ -175,11 +175,14 @@ MediaDemuxer::openInput(const DeviceParams& params)
|
||||
}
|
||||
|
||||
// Ask FFmpeg to open the input using the options set above
|
||||
av_opt_set_int(
|
||||
inputCtx_,
|
||||
"fpsprobesize",
|
||||
1,
|
||||
AV_OPT_SEARCH_CHILDREN); // Don't waste time fetching framerate when finding stream info
|
||||
if (params.disable_dts_probe_delay && params.format == "sdp") {
|
||||
av_opt_set_int(inputCtx_, "max_ts_probe", 0, AV_OPT_SEARCH_CHILDREN);
|
||||
av_opt_set_int(inputCtx_, "fpsprobesize", 0, AV_OPT_SEARCH_CHILDREN);
|
||||
} else {
|
||||
// Don't waste time fetching framerate when finding stream info
|
||||
av_opt_set_int(inputCtx_, "fpsprobesize", 1, AV_OPT_SEARCH_CHILDREN);
|
||||
}
|
||||
|
||||
int ret = avformat_open_input(&inputCtx_, input.c_str(), iformat, options_ ? &options_ : NULL);
|
||||
|
||||
if (ret) {
|
||||
|
@ -52,6 +52,8 @@ struct DeviceParams
|
||||
int fd {}; // file descriptor for PipeWire (only relevant on Wayland)
|
||||
std::string node {}; // node id for PipeWire
|
||||
int is_area {};
|
||||
// Skip DTS delay while finding stream info when PTS is sufficient
|
||||
bool disable_dts_probe_delay = false;
|
||||
};
|
||||
|
||||
} // namespace jami
|
||||
|
@ -138,6 +138,8 @@ VideoReceiveThread::setup()
|
||||
videoDecoder_->setIOContext(&sdpContext_);
|
||||
}
|
||||
|
||||
args_.disable_dts_probe_delay = true;
|
||||
|
||||
if (videoDecoder_->openInput(args_)) {
|
||||
JAMI_ERR("Unable to open input \"%s\"", args_.input.c_str());
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user