Fix always add probesize and analyzeduration options

This commit is contained in:
Ingo Oppermann 2024-04-19 16:40:09 +02:00
parent 8709d37738
commit a87ad7d614
No known key found for this signature in database
GPG Key ID: 2AB32426E9DD229E
3 changed files with 169 additions and 104 deletions

View File

@ -74,10 +74,10 @@ const initSettings = (initialSettings, config) => {
}; };
settings.general = { settings.general = {
analyzeduration: 5000000, analyzeduration: 5_000_000, // microseconds, 5s,
analyzeduration_rtmp: 3000000, analyzeduration_rtmp: 3_000_000, // 3s
analyzeduration_http: 20000000, analyzeduration_http: 20_000_000, // 20s
probesize: 5000000, probesize: 5_000_000, // bytes
max_probe_packets: 2500, max_probe_packets: 2500,
fflags: ['genpts'], fflags: ['genpts'],
thread_queue_size: 512, thread_queue_size: 512,
@ -220,9 +220,8 @@ const createInputs = (settings, config, skills) => {
input.options.push('-fflags', '+' + settings.general.fflags.join('+')); input.options.push('-fflags', '+' + settings.general.fflags.join('+'));
} }
input.options.push('-thread_queue_size', settings.general.thread_queue_size); input.options.push('-thread_queue_size', settings.general.thread_queue_size);
if (settings.general.probesize !== 5000000) { input.options.push('-probesize', settings.general.probesize);
input.options.push('-probesize', settings.general.probesize);
}
if (settings.general.max_probe_packets !== 2500) { if (settings.general.max_probe_packets !== 2500) {
input.options.push('-max_probe_packets', settings.general.max_probe_packets); input.options.push('-max_probe_packets', settings.general.max_probe_packets);
} }
@ -245,13 +244,9 @@ const createInputs = (settings, config, skills) => {
// analyzeduration: 20s for http and 3s for rtmp streams // analyzeduration: 20s for http and 3s for rtmp streams
if (settings.mode === 'push') { if (settings.mode === 'push') {
if (settings.push.type === 'hls') { if (settings.push.type === 'hls') {
if (settings.general.analyzeduration_http !== 5000000) { input.options.push('-analyzeduration', settings.general.analyzeduration_http);
input.options.push('-analyzeduration', settings.general.analyzeduration_http);
}
} else if (settings.push.type === 'rtmp') { } else if (settings.push.type === 'rtmp') {
if (settings.general.analyzeduration_rtmp !== 5000000) { input.options.push('-analyzeduration', settings.general.analyzeduration_rtmp);
input.options.push('-analyzeduration', settings.general.analyzeduration_rtmp);
}
if (skills.ffmpeg.version_major >= 6) { if (skills.ffmpeg.version_major >= 6) {
const codecs = []; const codecs = [];
@ -270,59 +265,14 @@ const createInputs = (settings, config, skills) => {
} }
} }
} else if (settings.push.type === 'srt') { } else if (settings.push.type === 'srt') {
if (settings.general.analyzeduration !== 5000000) { input.options.push('-analyzeduration', settings.general.analyzeduration);
input.options.push('-analyzeduration', settings.general.analyzeduration);
}
} }
} else { } else {
if (protocol === 'http') {
if (settings.general.analyzeduration_http !== 5000000) {
input.options.push('-analyzeduration', settings.general.analyzeduration_http);
}
} else if (protocol === 'rtmp') {
if (settings.general.analyzeduration_rtmp !== 5000000) {
input.options.push('-analyzeduration', settings.general.analyzeduration_rtmp);
}
if (skills.ffmpeg.version_major >= 6) {
const codecs = [];
if (skills.codecs.video.hevc?.length > 0) {
codecs.push('hvc1');
}
if (skills.codecs.video.av1?.length > 0) {
codecs.push('av01');
}
if (skills.codecs.video.vp9?.length > 0) {
codecs.push('vp09');
}
if (codecs.length !== 0) {
input.options.push('-rtmp_enhanced_codecs', codecs.join(','));
}
}
} else {
if (settings.general.analyzeduration !== 5000000) {
input.options.push('-analyzeduration', settings.general.analyzeduration);
}
}
}
if (settings.mode === 'pull') {
input.address = addUsernamePassword(input.address, settings.username, settings.password); input.address = addUsernamePassword(input.address, settings.username, settings.password);
if (protocol === 'rtsp') { if (protocol === 'http') {
if (skills.ffmpeg.version_major === 4) { input.options.push('-analyzeduration', settings.general.analyzeduration_http);
input.options.push('-stimeout', settings.rtsp.stimeout);
} else {
input.options.push('-timeout', settings.rtsp.stimeout);
}
if (settings.rtsp.udp === true) {
input.options.push('-rtsp_transport', 'udp');
} else {
input.options.push('-rtsp_transport', 'tcp');
}
} else if (protocol === 'http') {
if (settings.http.readNative === true) { if (settings.http.readNative === true) {
input.options.push('-re'); input.options.push('-re');
} }
@ -342,19 +292,44 @@ const createInputs = (settings, config, skills) => {
if (settings.http.http_proxy.length !== 0) { if (settings.http.http_proxy.length !== 0) {
input.options.push('-http_proxy', settings.http.http_proxy); input.options.push('-http_proxy', settings.http.http_proxy);
} }
} } else if (protocol === 'rtmp') {
} input.options.push('-analyzeduration', settings.general.analyzeduration_rtmp);
/*
if (skills.protocols.input.includes('playout')) {
if (protocol === 'http' || protocol === 'rtmp' || protocol === 'rtsp') {
if (!input.address.startsWith('playout:')) {
input.address = 'playout:' + input.address;
}
input.options.push('-playout_audio', '1'); if (skills.ffmpeg.version_major >= 6) {
const codecs = [];
if (skills.codecs.video.hevc?.length > 0) {
codecs.push('hvc1');
}
if (skills.codecs.video.av1?.length > 0) {
codecs.push('av01');
}
if (skills.codecs.video.vp9?.length > 0) {
codecs.push('vp09');
}
if (codecs.length !== 0) {
input.options.push('-rtmp_enhanced_codecs', codecs.join(','));
}
}
} else {
input.options.push('-analyzeduration', settings.general.analyzeduration);
if (protocol === 'rtsp') {
if (skills.ffmpeg.version_major === 4) {
input.options.push('-stimeout', settings.rtsp.stimeout);
} else {
input.options.push('-timeout', settings.rtsp.stimeout);
}
if (settings.rtsp.udp === true) {
input.options.push('-rtsp_transport', 'udp');
} else {
input.options.push('-rtsp_transport', 'tcp');
}
}
} }
} }
*/
return [input]; return [input];
}; };
@ -522,7 +497,18 @@ const isValidURL = (address) => {
function AdvancedSettings(props) { function AdvancedSettings(props) {
const settings = props.settings; const settings = props.settings;
const protocolClass = getProtocolClass(settings.address); let protocolClass = getProtocolClass(settings.address);
if (settings.mode === 'push') {
switch (settings.push.type) {
case 'rtmp':
protocolClass = 'rtmp';
break;
case 'srt':
protocolClass = 'srt';
break;
default:
}
}
return ( return (
<Grid item xs={12}> <Grid item xs={12}>

View File

@ -7,6 +7,8 @@ import * as Network from './Network';
const $skills_ffmpeg6 = { const $skills_ffmpeg6 = {
ffmpeg: { ffmpeg: {
version: '6.1.1', version: '6.1.1',
version_major: 6,
version_minor: 1,
}, },
formats: { formats: {
demuxers: ['rtsp'], demuxers: ['rtsp'],
@ -27,6 +29,8 @@ const $skills_ffmpeg6 = {
const $skills_ffmpeg5 = { const $skills_ffmpeg5 = {
ffmpeg: { ffmpeg: {
version: '5.1.2', version: '5.1.2',
version_major: 5,
version_minor: 1,
}, },
formats: { formats: {
demuxers: ['rtsp'], demuxers: ['rtsp'],
@ -39,6 +43,8 @@ const $skills_ffmpeg5 = {
const $skills_ffmpeg4 = { const $skills_ffmpeg4 = {
ffmpeg: { ffmpeg: {
version: '4.4.1', version: '4.4.1',
version_major: 4,
version_minor: 4,
}, },
formats: { formats: {
demuxers: ['rtsp'], demuxers: ['rtsp'],
@ -71,7 +77,7 @@ test('source:network pull', async () => {
}; };
const Source = Network.component; const Source = Network.component;
let { getByLabelText, queryByText, rerender } = render(<Source onChange={handleChange} />); let { getByLabelText, queryByText, rerender } = render(<Source onChange={handleChange} knownDevices={[]} />);
expect(queryByText(`This protocol is unknown or not supported by the available FFmpeg binary.`)).toBe(null); expect(queryByText(`This protocol is unknown or not supported by the available FFmpeg binary.`)).toBe(null);
@ -81,19 +87,19 @@ test('source:network pull', async () => {
expect($settings.mode).toBe('pull'); expect($settings.mode).toBe('pull');
expect($settings.address).toBe('rtsp://127.0.0.1/live/stream'); expect($settings.address).toBe('rtsp://127.0.0.1/live/stream');
rerender(<Source settings={$settings} onChange={handleChange} />); rerender(<Source settings={$settings} onChange={handleChange} knownDevices={[]} />);
expect(queryByText(`This protocol is unknown or not supported by the available FFmpeg binary.`)).toBeInTheDocument(); expect(queryByText(`This protocol is unknown or not supported by the available FFmpeg binary.`)).toBeInTheDocument();
rerender(<Source settings={$settings} skills={$skills_ffmpeg4} onChange={handleChange} />); rerender(<Source settings={$settings} skills={$skills_ffmpeg4} onChange={handleChange} knownDevices={[]} />);
expect(queryByText(`This protocol is unknown or not supported by the available FFmpeg binary.`)).toBe(null); expect(queryByText(`This protocol is unknown or not supported by the available FFmpeg binary.`)).toBe(null);
rerender(<Source settings={$settings} skills={$skills_ffmpeg5} onChange={handleChange} />); rerender(<Source settings={$settings} skills={$skills_ffmpeg5} onChange={handleChange} knownDevices={[]} />);
expect(queryByText(`This protocol is unknown or not supported by the available FFmpeg binary.`)).toBe(null); expect(queryByText(`This protocol is unknown or not supported by the available FFmpeg binary.`)).toBe(null);
rerender(<Source settings={$settings} skills={$skills_ffmpeg6} onChange={handleChange} />); rerender(<Source settings={$settings} skills={$skills_ffmpeg6} onChange={handleChange} knownDevices={[]} />);
expect(queryByText(`This protocol is unknown or not supported by the available FFmpeg binary.`)).toBe(null); expect(queryByText(`This protocol is unknown or not supported by the available FFmpeg binary.`)).toBe(null);
}); });
@ -140,7 +146,20 @@ pullmatrix.tests = [
skills: $skills_ffmpeg4, skills: $skills_ffmpeg4,
input: { input: {
address: 'rtsp://admin:foobar@127.0.0.1/live/stream', address: 'rtsp://admin:foobar@127.0.0.1/live/stream',
options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-stimeout', 5000000, '-rtsp_transport', 'tcp'], options: [
'-fflags',
'+genpts',
'-thread_queue_size',
512,
'-probesize',
5000000,
'-analyzeduration',
5000000,
'-stimeout',
5000000,
'-rtsp_transport',
'tcp',
],
}, },
}, },
{ {
@ -149,7 +168,7 @@ pullmatrix.tests = [
skills: $skills_ffmpeg4, skills: $skills_ffmpeg4,
input: { input: {
address: 'rtmp://admin:foobar@127.0.0.1/live/stream', address: 'rtmp://admin:foobar@127.0.0.1/live/stream',
options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-analyzeduration', 3000000], options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-probesize', 5000000, '-analyzeduration', 3000000],
}, },
}, },
{ {
@ -163,6 +182,8 @@ pullmatrix.tests = [
'+genpts', '+genpts',
'-thread_queue_size', '-thread_queue_size',
512, 512,
'-probesize',
5000000,
'-analyzeduration', '-analyzeduration',
20000000, 20000000,
'-re', '-re',
@ -181,7 +202,7 @@ pullmatrix.tests = [
skills: $skills_ffmpeg4, skills: $skills_ffmpeg4,
input: { input: {
address: 'srt://127.0.0.1?mode=caller&streamid=foobar', address: 'srt://127.0.0.1?mode=caller&streamid=foobar',
options: ['-fflags', '+genpts', '-thread_queue_size', 512], options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-probesize', 5000000, '-analyzeduration', 5000000],
}, },
}, },
{ {
@ -190,7 +211,20 @@ pullmatrix.tests = [
skills: $skills_ffmpeg5, skills: $skills_ffmpeg5,
input: { input: {
address: 'rtsp://admin:foobar@127.0.0.1/live/stream', address: 'rtsp://admin:foobar@127.0.0.1/live/stream',
options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-timeout', 5000000, '-rtsp_transport', 'tcp'], options: [
'-fflags',
'+genpts',
'-thread_queue_size',
512,
'-probesize',
5000000,
'-analyzeduration',
5000000,
'-timeout',
5000000,
'-rtsp_transport',
'tcp',
],
}, },
}, },
{ {
@ -199,7 +233,7 @@ pullmatrix.tests = [
skills: $skills_ffmpeg5, skills: $skills_ffmpeg5,
input: { input: {
address: 'rtmp://admin:foobar@127.0.0.1/live/stream', address: 'rtmp://admin:foobar@127.0.0.1/live/stream',
options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-analyzeduration', 3000000], options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-probesize', 5000000, '-analyzeduration', 3000000],
}, },
}, },
{ {
@ -213,6 +247,8 @@ pullmatrix.tests = [
'+genpts', '+genpts',
'-thread_queue_size', '-thread_queue_size',
512, 512,
'-probesize',
5000000,
'-analyzeduration', '-analyzeduration',
20000000, 20000000,
'-re', '-re',
@ -231,7 +267,7 @@ pullmatrix.tests = [
skills: $skills_ffmpeg5, skills: $skills_ffmpeg5,
input: { input: {
address: 'srt://127.0.0.1?mode=caller&streamid=foobar', address: 'srt://127.0.0.1?mode=caller&streamid=foobar',
options: ['-fflags', '+genpts', '-thread_queue_size', 512], options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-probesize', 5000000, '-analyzeduration', 5000000],
}, },
}, },
{ {
@ -240,7 +276,20 @@ pullmatrix.tests = [
skills: $skills_ffmpeg6, skills: $skills_ffmpeg6,
input: { input: {
address: 'rtsp://admin:foobar@127.0.0.1/live/stream', address: 'rtsp://admin:foobar@127.0.0.1/live/stream',
options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-timeout', 5000000, '-rtsp_transport', 'tcp'], options: [
'-fflags',
'+genpts',
'-thread_queue_size',
512,
'-probesize',
5000000,
'-analyzeduration',
5000000,
'-timeout',
5000000,
'-rtsp_transport',
'tcp',
],
}, },
}, },
{ {
@ -249,7 +298,18 @@ pullmatrix.tests = [
skills: $skills_ffmpeg6, skills: $skills_ffmpeg6,
input: { input: {
address: 'rtmp://admin:foobar@127.0.0.1/live/stream', address: 'rtmp://admin:foobar@127.0.0.1/live/stream',
options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-analyzeduration', 3000000, '-rtmp_enhanced_codecs', 'hvc1,av01,vp09'], options: [
'-fflags',
'+genpts',
'-thread_queue_size',
512,
'-probesize',
5000000,
'-analyzeduration',
3000000,
'-rtmp_enhanced_codecs',
'hvc1,av01,vp09',
],
}, },
}, },
{ {
@ -263,6 +323,8 @@ pullmatrix.tests = [
'+genpts', '+genpts',
'-thread_queue_size', '-thread_queue_size',
512, 512,
'-probesize',
5000000,
'-analyzeduration', '-analyzeduration',
20000000, 20000000,
'-re', '-re',
@ -281,7 +343,7 @@ pullmatrix.tests = [
skills: $skills_ffmpeg6, skills: $skills_ffmpeg6,
input: { input: {
address: 'srt://127.0.0.1?mode=caller&streamid=foobar', address: 'srt://127.0.0.1?mode=caller&streamid=foobar',
options: ['-fflags', '+genpts', '-thread_queue_size', 512], options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-probesize', 5000000, '-analyzeduration', 5000000],
}, },
}, },
]; ];
@ -294,7 +356,7 @@ test.each(pullmatrix.tests)('source:network pull $name input with ffmpeg $skills
const Source = Network.component; const Source = Network.component;
let { getByText, getByRole } = render(<Source settings={data.settings} skills={data.skills} onProbe={handleProbe} />); let { getByText, getByRole } = render(<Source settings={data.settings} skills={data.skills} onProbe={handleProbe} knownDevices={[]} />);
expect(getByText('Probe')).toBeInTheDocument(); expect(getByText('Probe')).toBeInTheDocument();
@ -318,21 +380,21 @@ test('source:network push', async () => {
}; };
const Source = Network.component; const Source = Network.component;
let { queryByText, rerender } = render(<Source settings={$settings} onChange={handleChange} />); let { queryByText, rerender } = render(<Source settings={$settings} onChange={handleChange} knownDevices={[]} />);
expect($settings.mode).toBe('push'); expect($settings.mode).toBe('push');
expect(queryByText(`The available FFmpeg binary doesn't support any of the required protocols.`)).toBeInTheDocument(); expect(queryByText(`The available FFmpeg binary doesn't support any of the required protocols.`)).toBeInTheDocument();
rerender(<Source settings={$settings} skills={$skills_ffmpeg4} onChange={handleChange} />); rerender(<Source settings={$settings} skills={$skills_ffmpeg4} onChange={handleChange} knownDevices={[]} />);
expect(queryByText(`The available FFmpeg binary doesn't support any of the required protocols.`)).toBe(null); expect(queryByText(`The available FFmpeg binary doesn't support any of the required protocols.`)).toBe(null);
rerender(<Source settings={$settings} skills={$skills_ffmpeg5} onChange={handleChange} />); rerender(<Source settings={$settings} skills={$skills_ffmpeg5} onChange={handleChange} knownDevices={[]} />);
expect(queryByText(`The available FFmpeg binary doesn't support any of the required protocols.`)).toBe(null); expect(queryByText(`The available FFmpeg binary doesn't support any of the required protocols.`)).toBe(null);
rerender(<Source settings={$settings} skills={$skills_ffmpeg6} onChange={handleChange} />); rerender(<Source settings={$settings} skills={$skills_ffmpeg6} onChange={handleChange} knownDevices={[]} />);
expect(queryByText(`The available FFmpeg binary doesn't support any of the required protocols.`)).toBe(null); expect(queryByText(`The available FFmpeg binary doesn't support any of the required protocols.`)).toBe(null);
}); });
@ -350,14 +412,14 @@ test('source:network push RTMP', async () => {
}; };
const Source = Network.component; const Source = Network.component;
let { getByText, queryByText, rerender } = render(<Source settings={$settings} skills={$skills_ffmpeg5} onChange={handleChange} />); let { getByText, queryByText, rerender } = render(<Source settings={$settings} skills={$skills_ffmpeg5} onChange={handleChange} knownDevices={[]} />);
expect($settings.mode).toBe('push'); expect($settings.mode).toBe('push');
expect($settings.push.type).toBe('rtmp'); expect($settings.push.type).toBe('rtmp');
expect(queryByText(`Enable RTMP server ...`)).toBeInTheDocument(); expect(queryByText(`Enable RTMP server ...`)).toBeInTheDocument();
rerender(<Source settings={$settings} config={$config} skills={$skills_ffmpeg5} onChange={handleChange} />); rerender(<Source settings={$settings} config={$config} skills={$skills_ffmpeg5} onChange={handleChange} knownDevices={[]} />);
expect(getByText('Probe')).toBeInTheDocument(); expect(getByText('Probe')).toBeInTheDocument();
}); });
@ -375,14 +437,14 @@ test('source:network push SRT', async () => {
}; };
const Source = Network.component; const Source = Network.component;
let { getByText, queryByText, rerender } = render(<Source settings={$settings} skills={$skills_ffmpeg5} onChange={handleChange} />); let { getByText, queryByText, rerender } = render(<Source settings={$settings} skills={$skills_ffmpeg5} onChange={handleChange} knownDevices={[]} />);
expect($settings.mode).toBe('push'); expect($settings.mode).toBe('push');
expect($settings.push.type).toBe('srt'); expect($settings.push.type).toBe('srt');
expect(queryByText(`Enable SRT server ...`)).toBeInTheDocument(); expect(queryByText(`Enable SRT server ...`)).toBeInTheDocument();
rerender(<Source settings={$settings} config={$config} skills={$skills_ffmpeg5} onChange={handleChange} />); rerender(<Source settings={$settings} config={$config} skills={$skills_ffmpeg5} onChange={handleChange} knownDevices={[]} />);
expect(getByText('Probe')).toBeInTheDocument(); expect(getByText('Probe')).toBeInTheDocument();
}); });
@ -406,7 +468,7 @@ pushmatrix.tests = [
config: $config, config: $config,
input: { input: {
address: '{rtmp,name=external.stream}', address: '{rtmp,name=external.stream}',
options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-analyzeduration', 3000000], options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-probesize', 5000000, '-analyzeduration', 3000000],
}, },
}, },
{ {
@ -416,7 +478,7 @@ pushmatrix.tests = [
config: $config, config: $config,
input: { input: {
address: '{srt,name=external.stream,mode=request}', address: '{srt,name=external.stream,mode=request}',
options: ['-fflags', '+genpts', '-thread_queue_size', 512], options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-probesize', 5000000, '-analyzeduration', 5000000],
}, },
}, },
{ {
@ -426,7 +488,7 @@ pushmatrix.tests = [
config: $config, config: $config,
input: { input: {
address: '{rtmp,name=external.stream}', address: '{rtmp,name=external.stream}',
options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-analyzeduration', 3000000], options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-probesize', 5000000, '-analyzeduration', 3000000],
}, },
}, },
{ {
@ -436,7 +498,7 @@ pushmatrix.tests = [
config: $config, config: $config,
input: { input: {
address: '{srt,name=external.stream,mode=request}', address: '{srt,name=external.stream,mode=request}',
options: ['-fflags', '+genpts', '-thread_queue_size', 512], options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-probesize', 5000000, '-analyzeduration', 5000000],
}, },
}, },
{ {
@ -446,7 +508,18 @@ pushmatrix.tests = [
config: $config, config: $config,
input: { input: {
address: '{rtmp,name=external.stream}', address: '{rtmp,name=external.stream}',
options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-analyzeduration', 3000000, '-rtmp_enhanced_codecs', 'hvc1,av01,vp09'], options: [
'-fflags',
'+genpts',
'-thread_queue_size',
512,
'-probesize',
5000000,
'-analyzeduration',
3000000,
'-rtmp_enhanced_codecs',
'hvc1,av01,vp09',
],
}, },
}, },
{ {
@ -456,7 +529,7 @@ pushmatrix.tests = [
config: $config, config: $config,
input: { input: {
address: '{srt,name=external.stream,mode=request}', address: '{srt,name=external.stream,mode=request}',
options: ['-fflags', '+genpts', '-thread_queue_size', 512], options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-probesize', 5000000, '-analyzeduration', 5000000],
}, },
}, },
]; ];
@ -468,7 +541,9 @@ test.each(pushmatrix.tests)('source:network push $name input with ffmpeg $skills
}; };
const Source = Network.component; const Source = Network.component;
let { getByText, getByRole } = render(<Source settings={data.settings} config={data.config} skills={data.skills} onProbe={handleProbe} />); let { getByText, getByRole } = render(
<Source settings={data.settings} config={data.config} skills={data.skills} onProbe={handleProbe} knownDevices={[]} />,
);
expect(getByText('Probe')).toBeInTheDocument(); expect(getByText('Probe')).toBeInTheDocument();

View File

@ -18,6 +18,8 @@ const restreamer = {
return { return {
ffmpeg: { ffmpeg: {
version: '5.1.2', version: '5.1.2',
version_major: 5,
version_minor: 1,
}, },
formats: { formats: {
demuxers: ['rtsp'], demuxers: ['rtsp'],
@ -26,7 +28,7 @@ const restreamer = {
input: ['http', 'https', 'rtmp', 'rtmps', 'srt'], input: ['http', 'https', 'rtmp', 'rtmps', 'srt'],
}, },
sources: { sources: {
network: {}, network: [],
}, },
encoders: { encoders: {
audio: ['copy', 'none', 'aac'], audio: ['copy', 'none', 'aac'],
@ -335,7 +337,7 @@ test('wizard: rtmp source video h264-aac', async () => {
let button = screen.getByRole('button', { name: 'RTMP server' }); let button = screen.getByRole('button', { name: 'RTMP server' });
fireEvent.click(button); fireEvent.click(button);
expect(screen.queryByText(/Send stream to this address:/)).toBeInTheDocument(); expect(screen.queryByText(/Address:/)).toBeInTheDocument();
button = screen.getByRole('button', { name: 'Next' }); button = screen.getByRole('button', { name: 'Next' });
expect(button).toBeEnabled(); expect(button).toBeEnabled();
@ -397,6 +399,8 @@ test('wizard: srt source video h264-aac', async () => {
let button = screen.getByRole('button', { name: 'SRT server' }); let button = screen.getByRole('button', { name: 'SRT server' });
fireEvent.click(button); fireEvent.click(button);
expect(screen.queryByText(/Address:/)).toBeInTheDocument();
button = screen.getByRole('button', { name: 'Next' }); button = screen.getByRole('button', { name: 'Next' });
expect(button).toBeEnabled(); expect(button).toBeEnabled();