|
|
|
@ -221,7 +221,9 @@ bool LiveVideoEncoder::open(const LiveVideoConfig& config, Backend backend) { |
|
|
|
if (config.codec == STREAM_MEDIA_H265) av_dict_set(&options, "tier", "main", 0); |
|
|
|
if (config.codec == STREAM_MEDIA_H265) av_dict_set(&options, "tier", "main", 0); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (name.endsWith("_amf")) { |
|
|
|
} else if (name.endsWith("_amf")) { |
|
|
|
av_dict_set(&options, "usage", "ultralowlatency", 0); |
|
|
|
// Для трансляции HEVC используем режим remote desktop; профиль звонков сохраняет ultra-low latency.
|
|
|
|
|
|
|
|
const char* usage = !constrained && config.codec == STREAM_MEDIA_H265 ? "lowlatency" : "ultralowlatency"; |
|
|
|
|
|
|
|
av_dict_set(&options, "usage", usage, 0); |
|
|
|
av_dict_set(&options, "quality", "speed", 0); |
|
|
|
av_dict_set(&options, "quality", "speed", 0); |
|
|
|
bool asyncDepth = av_opt_find(c->priv_data, "async_depth", nullptr, 0, 0); |
|
|
|
bool asyncDepth = av_opt_find(c->priv_data, "async_depth", nullptr, 0, 0); |
|
|
|
if (asyncDepth) av_dict_set(&options, "async_depth", "1", 0); |
|
|
|
if (asyncDepth) av_dict_set(&options, "async_depth", "1", 0); |
|
|
|
@ -235,8 +237,8 @@ bool LiveVideoEncoder::open(const LiveVideoConfig& config, Backend backend) { |
|
|
|
if (config.codec == STREAM_MEDIA_H265) av_dict_set(&options, "profile_tier", "main", 0); |
|
|
|
if (config.codec == STREAM_MEDIA_H265) av_dict_set(&options, "profile_tier", "main", 0); |
|
|
|
} |
|
|
|
} |
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_VIDEO, |
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_VIDEO, |
|
|
|
"desktop AMF low latency settings name=%s usage=ultralowlatency quality=speed async_depth=%s forced_idr=%d", |
|
|
|
"desktop AMF low latency settings name=%s usage=%s quality=speed async_depth=%s forced_idr=%d", |
|
|
|
name.constData(), asyncDepth ? "1" : "driver", m->forcedKeys); |
|
|
|
name.constData(), usage, asyncDepth ? "1" : "driver", m->forcedKeys); |
|
|
|
} else if (name == "libvpx-vp9" || name == "libaom-av1") { |
|
|
|
} else if (name == "libvpx-vp9" || name == "libaom-av1") { |
|
|
|
av_dict_set(&options, "deadline", "realtime", 0); av_dict_set(&options, "cpu-used", "8", 0); |
|
|
|
av_dict_set(&options, "deadline", "realtime", 0); av_dict_set(&options, "cpu-used", "8", 0); |
|
|
|
av_dict_set(&options, "lag-in-frames", "0", 0); av_dict_set(&options, "row-mt", "1", 0); |
|
|
|
av_dict_set(&options, "lag-in-frames", "0", 0); av_dict_set(&options, "row-mt", "1", 0); |
|
|
|
|