-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/datarhei/restreamer-ui into dev
- Loading branch information
Showing
18 changed files
with
132 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,18 @@ import '@testing-library/jest-dom'; | |
|
||
import * as Network from './Network'; | ||
|
||
const $skills_ffmpeg6 = { | ||
ffmpeg: { | ||
version: '6.1.1', | ||
}, | ||
formats: { | ||
demuxers: ['rtsp'], | ||
}, | ||
protocols: { | ||
input: ['http', 'https', 'rtmp', 'rtmps', 'srt'], | ||
}, | ||
}; | ||
|
||
const $skills_ffmpeg5 = { | ||
ffmpeg: { | ||
version: '5.1.2', | ||
|
@@ -29,6 +41,7 @@ const $skills_ffmpeg4 = { | |
}; | ||
|
||
const $config = { | ||
channelid: 'external', | ||
rtmp: { | ||
enabled: true, | ||
app: '/live', | ||
|
@@ -64,9 +77,17 @@ test('source:network pull', async () => { | |
|
||
expect(queryByText(`This protocol is unknown or not supported by the available FFmpeg binary.`)).toBeInTheDocument(); | ||
|
||
rerender(<Source settings={$settings} skills={$skills_ffmpeg4} onChange={handleChange} />); | ||
|
||
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} />); | ||
|
||
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} />); | ||
|
||
expect(queryByText(`This protocol is unknown or not supported by the available FFmpeg binary.`)).toBe(null); | ||
}); | ||
|
||
const pullmatrix = { | ||
|
@@ -205,6 +226,56 @@ pullmatrix.tests = [ | |
options: ['-fflags', '+genpts', '-thread_queue_size', 512], | ||
}, | ||
}, | ||
{ | ||
name: 'RTSP', | ||
settings: { ...pullmatrix.settings, address: 'rtsp://127.0.0.1/live/stream' }, | ||
skills: $skills_ffmpeg6, | ||
input: { | ||
address: 'rtsp://admin:[email protected]/live/stream', | ||
options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-timeout', 5000000, '-rtsp_transport', 'tcp'], | ||
}, | ||
}, | ||
{ | ||
name: 'RTMP', | ||
settings: { ...pullmatrix.settings, address: 'rtmp://127.0.0.1/live/stream' }, | ||
skills: $skills_ffmpeg6, | ||
input: { | ||
address: 'rtmp://admin:[email protected]/live/stream', | ||
options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-analyzeduration', 3000000], | ||
}, | ||
}, | ||
{ | ||
name: 'HTTP', | ||
settings: { ...pullmatrix.settings, address: 'http://127.0.0.1/live/stream.m3u8' }, | ||
skills: $skills_ffmpeg6, | ||
input: { | ||
address: 'http://admin:[email protected]/live/stream.m3u8', | ||
options: [ | ||
'-fflags', | ||
'+genpts', | ||
'-thread_queue_size', | ||
512, | ||
'-analyzeduration', | ||
20000000, | ||
'-re', | ||
'-r', | ||
25, | ||
'-user_agent', | ||
'foobaz/1', | ||
'-referer', | ||
'http://example.com', | ||
], | ||
}, | ||
}, | ||
{ | ||
name: 'SRT', | ||
settings: { ...pullmatrix.settings, address: 'srt://127.0.0.1?mode=caller&streamid=foobar' }, | ||
skills: $skills_ffmpeg6, | ||
input: { | ||
address: 'srt://127.0.0.1?mode=caller&streamid=foobar', | ||
options: ['-fflags', '+genpts', '-thread_queue_size', 512], | ||
}, | ||
}, | ||
]; | ||
|
||
test.each(pullmatrix.tests)('source:network pull $name input with ffmpeg $skills.ffmpeg.version', async (data) => { | ||
|
@@ -231,6 +302,7 @@ test('source:network push', async () => { | |
mode: 'push', | ||
push: { | ||
type: 'rtmp', | ||
name: 'external', | ||
}, | ||
}; | ||
const handleChange = (settings) => { | ||
|
@@ -244,16 +316,25 @@ test('source:network push', async () => { | |
|
||
expect(queryByText(`The available FFmpeg binary doesn't support any of the required protocols.`)).toBeInTheDocument(); | ||
|
||
rerender(<Source settings={$settings} skills={$skills_ffmpeg4} onChange={handleChange} />); | ||
|
||
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} />); | ||
|
||
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} />); | ||
|
||
expect(queryByText(`The available FFmpeg binary doesn't support any of the required protocols.`)).toBe(null); | ||
}); | ||
|
||
test('source:network push RTMP', async () => { | ||
let $settings = { | ||
mode: 'push', | ||
push: { | ||
type: 'rtmp', | ||
name: 'external', | ||
}, | ||
}; | ||
const handleChange = (settings) => { | ||
|
@@ -278,6 +359,7 @@ test('source:network push SRT', async () => { | |
mode: 'push', | ||
push: { | ||
type: 'srt', | ||
name: 'external', | ||
}, | ||
}; | ||
const handleChange = (settings) => { | ||
|
@@ -302,6 +384,7 @@ const pushmatrix = { | |
mode: 'push', | ||
push: { | ||
type: '', | ||
name: 'external', | ||
}, | ||
}, | ||
tests: [], | ||
|
@@ -348,6 +431,26 @@ pushmatrix.tests = [ | |
options: ['-fflags', '+genpts', '-thread_queue_size', 512], | ||
}, | ||
}, | ||
{ | ||
name: 'RTMP', | ||
settings: { ...pushmatrix.settings, push: { ...pushmatrix.push, type: 'rtmp' } }, | ||
skills: $skills_ffmpeg6, | ||
config: $config, | ||
input: { | ||
address: '{rtmp,name=external.stream}', | ||
options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-analyzeduration', 3000000], | ||
}, | ||
}, | ||
{ | ||
name: 'SRT', | ||
settings: { ...pushmatrix.settings, push: { ...pushmatrix.push, type: 'srt' } }, | ||
skills: $skills_ffmpeg6, | ||
config: $config, | ||
input: { | ||
address: '{srt,name=external.stream,mode=request}', | ||
options: ['-fflags', '+genpts', '-thread_queue_size', 512], | ||
}, | ||
}, | ||
]; | ||
|
||
test.each(pushmatrix.tests)('source:network push $name input with ffmpeg $skills.ffmpeg.version', async (data) => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.