diff --git a/src/views/Edit/Sources/Network.js b/src/views/Edit/Sources/Network.js
index 2c04eb6..cbdb638 100644
--- a/src/views/Edit/Sources/Network.js
+++ b/src/views/Edit/Sources/Network.js
@@ -45,6 +45,7 @@ const initSettings = (initialSettings, config) => {
password: '',
push: {},
rtsp: {},
+ srt: {},
http: {},
general: {},
...initialSettings,
@@ -67,6 +68,11 @@ const initSettings = (initialSettings, config) => {
settings.rtsp.transport = 'udp';
}
+ settings.srt = {
+ latency: 20,
+ ...settings.srt,
+ };
+
settings.http = {
readNative: true,
forceFramerate: false,
@@ -214,7 +220,7 @@ const createInputs = (settings, config, skills) => {
if (name === config.channelid) {
name += '.stream';
}
- input.address = getLocalSRT(name);
+ input.address = getLocalSRT(name, settings.srt.latency);
} else {
input.address = '';
}
@@ -346,12 +352,11 @@ const createInputs = (settings, config, skills) => {
}
if (skills.protocols.input.includes('playout')) {
- console.log("playout enabled");
if (settings.extentions.liveguard === 'video') {
- input.address = `playout:${input.address}`
+ input.address = `playout:${input.address}`;
input.options.push('-playout_audio', '0');
} else if (settings.extentions.liveguard === 'video_audio') {
- input.address = `playout:${input.address}`
+ input.address = `playout:${input.address}`;
input.options.push('-playout_audio', '1');
}
}
@@ -477,6 +482,8 @@ const getSRTAddress = (host, name, token, passphrase, publish) => {
url += '&passphrase=' + encodeURIComponent(passphrase);
}
+ url += '&latency=120000';
+
return url;
};
@@ -508,8 +515,8 @@ const getLocalRTMP = (name) => {
return '{rtmp,name=' + name + '}';
};
-const getLocalSRT = (name) => {
- return '{srt,name=' + name + ',mode=request}';
+const getLocalSRT = (name, latency) => {
+ return '{srt,name=' + name + ',mode=request,latency=' + latency * 1000 + '}';
};
const isValidURL = (address) => {
@@ -580,6 +587,27 @@ function AdvancedSettings({ settings = {}, onChange = function (settings) {} })
)}
+ {protocolClass === 'srt' && settings.mode == 'push' && (
+
+
+
+ SRT
+
+
+
+ Latency (milliseconds)}
+ value={settings.srt.latency}
+ onChange={onChange('srt', 'latency')}
+ />
+
+ Internal SRT latency in milliseconds.
+
+
+
+ )}
{protocolClass === 'http' && (
@@ -818,9 +846,15 @@ function ExtentionSettings({ settings = {}, skills = {}, onChange = function (se
value={settings.extentions.liveguard}
onChange={onChange('extentions', 'liveguard')}
>
-
-
-
+
+
+
@@ -965,11 +999,27 @@ function Push({
{settings.push.type === 'rtmp' && (
-
+
)}
{settings.push.type === 'hls' && }
{settings.push.type === 'srt' && (
-
+
)}
);
@@ -1220,6 +1270,8 @@ function Source({
} else {
settings.rtsp[what] = value;
}
+ } else if (section === 'srt') {
+ settings.srt[what] = value;
} else if (section === 'general') {
if (['copyts', 'start_at_zero', 'use_wallclock_as_timestamps'].includes(what)) {
settings.general[what] = !settings.general[what];