MPEG-2 TS
From version 0.10.4, MPEG-2 TS input is supported as a beta version. The supported codecs are H.264, AAC(ADTS). Supported codecs will continue to be added. And the current version only supports basic MPEG-2 TS with 188 bytes packet size. Since the information about the input stream is obtained using PAT and PMT, the client must send this table information as required.
This version supports MPEG-2 TS over UDP. MPEG-2 TS over TCP or MPEG-2 TS over SRT will be supported soon.

Configuration

To enable MPEG-2 TS, you must bind the ports fist and map the bound ports and streams.

Bind

To use multiple streams, it is necessary to bind multiple ports, so we provide a way to bind multiple ports as in the example below. You can use the dash to specify the port as a range, such as Start port-End port, and multiple ports using commas.

Stream mapping

First, name the stream and map the port bound above. The macro ${Port} is provided to map multiple streams at once. Check out the example below.
1
<Server>
2
...
3
<Bind>
4
<Providers>
5
<MPEGTS>
6
<!--
7
Listen on port 4000,4001,4004,4005
8
This is just a demonstration to show that you can configure the port in several ways
9
-->
10
<Port>4000-4001,4004,4005/udp</Port>
11
</MPEGTS>
12
</Providers>
13
</Bind>
14
...
15
<VirtualHosts>
16
<VirtualHost>
17
<Application>
18
<Providers>
19
<MPEGTS>
20
<StreamMap>
21
<!--
22
Set the stream name of the client connected to the port to "stream_${Port}"
23
For example, if a client connets to port 4000, OME creates a "stream_4000" stream
24
-->
25
<Stream>
26
<Name>stream_${Port}</Name>
27
<Port>4000-4001,4004</Port>
28
</Stream>
29
<Stream>
30
<Name>stream_name_for_4005_port</Name>
31
<Port>4005</Port>
32
</Stream>
33
</StreamMap>
34
</MPEGTS>
35
</Providers>
36
<Application>
37
</VirtualHost>
38
</VirtualHosts>
39
</Server>
Copied!

Publish

This is an example of publishing using FFMPEG.
1
# Video / Audio
2
ffmpeg.exe -re -stream_loop -1 -i <file.ext> -c:v libx264 -bf 0 -x264-params keyint=30:scenecut=0 -acodec aac -pes_payload_size 0 -f mpegts udp://<IP>:4000?pkt_size=1316
3
# Video only
4
ffmpeg.exe -re -stream_loop -1 -i <file.ext> -c:v libx264 -bf 0 -x264-params keyint=30:scenecut=0 -an -f mpegts udp://<IP>:4000?pkt_size=1316
5
# Audio only
6
ffmpeg.exe -re -stream_loop -1 -i <file.ext> -vn -acodec aac -pes_payload_size 0 -f mpegts udp://<IP>:4000?pkt_size=1316
Copied!
Giving the -pes_payload_size 0 option to the AAC codec is very important for AV synchronization and low latency. If this option is not given, FFMPEG bundles several ADTSs and is transmitted at once, which may cause high latency and AV synchronization errors.

Streaming URL

If you use the default configuration, you can stream with the following streaming URLs when you start broadcasting to OBS:
    WebRTC ws://192.168.0.1:3333/app/stream_4000
    HLS http://192.168.0.1:8080/app/stream_4000/playlist.m3u8
    MPEG-DASHhttp://192.168.0.1:8080/app/stream_4000/manifest.mpd
Last modified 5d ago