A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Haivision/srt/commit/545700fd81d3c121ec807ea4c6310dad3eb95eea below:

[docs] Added and updated description of useful test applications (#2191) · Haivision/srt@545700f · GitHub

1 -

## srt-multiplex

1 +

# srt-test-multiplex

2 2 3 -

**srt-multiplex** (formerly called "SIPLEX") is a sample program that can send

4 -

multiple streams in one direction. This tool demonstrates two SRT features:

3 +

**srt-test-multiplex** (formerly called "SIPLEX") is a sample program that can

4 +

send multiple streams in one direction. This tool demonstrates two SRT features:

5 5

- the ability to use a single UDP link (a source and destination pair

6 6

specified by IP address and port) for multiple SRT connections

7 7

- the use of the `streamid` socket option to identify multiplexed resources

8 8 9 -

NOTE: due to changes in the common code that can't be properly handled in the

10 -

current form of srt-multiplex, this application is temporarily blocked. Instead

11 -

the `srt-test-multiplex` application was added with the same functionality,

12 -

although it's recommended for testing purposes only.

9 +

NOTE: To make this application compiled, you need the `-DENABLE_TESTING=1`

10 +

cmake option.

13 11 14 -

#### Usage

12 +

Note also that this application is intended for demonstration only. It can

13 +

simply exit with error message in case of wrong usage or broken connection.

15 14 16 -

`srt-multiplex <SRT-URI> -i <INPUT-URI1>[id] <INPUT-URI2>[id]...`

17 15 18 -

- Multiplexes data from one or more input URIs to transmit as an SRT stream.

19 -

The application reads multiple streams (INPUT URIs), each using a separate SRT

20 -

connection. All of the traffic from these connections is sent through the

21 -

same UDP link.

16 +

## Usage

22 17 23 -

`srt-multiplex <SRT-URI> -o <OUTPUT-URI1>[id] <OUTPUT-URI2>[id]...`

18 +

`srt-test-multiplex <SRT-URI> -i <INPUT-URI1>[id1] <INPUT-URI2>[id2]...`

19 + 20 +

- Reads all given input streams and sends them each one over a separate

21 +

SRT connection, all using the same remote address and source port (hence

22 +

using the same UDP link).

23 + 24 +

`srt-test-multiplex <SRT-URI> -o <OUTPUT-URI1>[id] <OUTPUT-URI2>[id]...`

24 25 25 26

- Transmits data from a multiplexed SRT stream to the specified output URI(s).

26 27

@@ -29,41 +30,41 @@ options. When `-i` is specified, the URIs provided are used as input, and will

29 30

be output over the `<SRT URI>` socket. The reverse is true for any output URIs

30 31

specified by `-o`.

31 32 32 -

Separate connections will be created for every specified URI, although all will

33 -

be using the same UDP link. When SRT is in caller mode, the SRT socket created

34 -

for transmitting data for a given URI will be set to the `streamid` socket option

35 -

from this URI's `id` parameter. When SRT is in listener mode, the `streamid`

36 -

option will already be set on the accepted socket, and will be matched with a

37 -

URI that has the same value in its `id` parameter.

38 - 39 -

This `streamid` is the SRT socket option (`SRTO_STREAMID` in the API). The idea

40 -

is that it can be set on a socket used for connecting. When a listener is

41 -

getting an accepted socket for that connection, the `streamid` socket option

42 -

can be read from it, with the result that it will be the same as was set on

43 -

the caller side.

44 - 45 -

So, in caller mode, for every stream media URI (input or output) there will be

46 -

a separate SRT socket created. This socket will have its `socketid` option

47 -

set to the value that is given by user as the `id` parameter attached to a

48 -

particular URI. In listener mode this happens in the opposite direction — the

49 -

value of the `streamid` option is extracted from the accepted socket, and then

50 -

matched against all ids specified with the stream media URIs:

33 +

If SRT-URI is caller mode, then for every declared input or output medium a

34 +

separate connection will be made, each one using the same source port (if

35 +

specified, the same will be used for all connections, otherwise the first one

36 +

will be automatically selected and then reused for all next ones) and with the

37 +

`streamid` socket option set to the value extracted from the medium's

38 +

`id` specified parameter:

51 39

```

52 40

URI1?id=a --> s1(streamid=a).connect(remhost:2000)

53 41

URI2?id=b --> s2(streamid=b).connect(remhost:2000)

54 42

URI3?id=c --> s3(streamid=c).connect(remhost:2000)

55 43

```

56 -

And on the listener side:

44 + 45 +

If SRT-URI is listener mode, then it will extract the value from `streamid`

46 +

socket option and every accepted connection will be matched against the `id`

47 +

parameter of the specified input or output medium.

57 48

```

58 49

(remhost:2000) -> accept --> s(SRT socket) --> in URI array find such that uri.id == s.streamid

59 50

```

60 51 61 -

#### Examples

52 +

Note that the rendezvous mode is not supported because you cannot make

53 +

multiple connections over the same UDP link in rendezvous mode.

54 + 55 +

This `streamid` is the SRT socket option (`SRTO_STREAMID` in the API). The idea

56 +

is that it can be set on a socket used for connecting. When a listener is

57 +

getting an accepted socket for that connection, the `streamid` socket option

58 +

can be read from it, with the result that it will be the same as was set on

59 +

the caller side.

60 + 61 + 62 +

## Examples

62 63 63 64

- **Sender:**

64 -

- `srt-multiplex srt://remhost:2000 -i udp://:5000?id=low udp://:6000?id=high`

65 +

- `srt-test-multiplex srt://remhost:2000 -i udp://:5000?id=low udp://:6000?id=high`

65 66

- **Receiver:**

66 -

- `srt-multiplex srt://:2000 -o output-high.ts?id=high output-low.ts?id=low`

67 +

- `srt-test-multiplex srt://:2000 -o output-high.ts?id=high output-low.ts?id=low`

67 68 68 69

In this example a Sender is created which will connect to `remhost` port 2000

69 70

using multiple SRT sockets, all of which will be using the same outgoing port.

@@ -72,7 +73,7 @@ sockets will reuse that port. Alternatively you can enforce the outgoing port

72 73

using the `port` parameter with the `<SRT URI>`.

73 74 74 75

- **Sender:**

75 -

- `srt-multiplex srt://remhost:2000?port=5555 ...`

76 +

- `srt-test-multiplex srt://remhost:2000?port=5555 ...`

76 77 77 78

A separate connection is made for every input resource. An appropriate resource

78 79

ID will be set to each socket assigned to that resource according to the `id`

@@ -90,9 +91,9 @@ port=5555 -| --------- ( multiplexed UDP stream ) ---------- |- port=2000

90 91

+-- --+

91 92

```

92 93

When a socket is accepted on the listener side (the Receiver in this example),

93 -

srt-multiplex will search for the resource ID among the registered resources

94 +

srt-test-multiplex will search for the resource ID among the registered resources

94 95

(input/output URIs) and set an ID that matches the one on the caller side. If

95 96

the resource is not found, the connection is closed immediately.

96 97 97 -

The srt-multiplex program works the same way for connections initiated by a

98 +

The srt-test-multiplex program works the same way for connections initiated by a

98 99

caller or a listener.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4