Skip to content

How do I capture MPEG-TS video, write it on disk, and stream it via HLS?

How do I capture an MPEG-TS stream, write it to an archive on disk, and then deliver via the HLS or any other protocol?

How do I obtain MPEG-TS

MPEG-TS can be captured via UDP from satellite headend or from a DVB capture card.

Learn more about receiving MPEG-TS via HTTP or UDP in Data Source Types. And the following section tells about how to capture video from DVB cards directly to Flussonic.

In any case, you should enter an appropiate URL as a stream source when you add a stream to Flussonic. To do so, open the Flussonic UI and click Add next to Streams, and then enter the stream name and its URL.

In the example, we create a stream having a UDP source, name it ort, and add a source URL udp://239.0.0.1:1234:

MPEG-TS ingest

For detailed explanations about multicast ingest and related issues, see Multicast Receiving.

How to configure the DVR

With Flussonic Media Server, you can record video streams to the archive on disk and then play the recorded video. We call this functionality DVR (digital video recording).

Flussonic allows maintaining a specific archive depth (duration, for example, in days) and disk usage limit. DVR is ideal for Catchup services, surveillance tasks, and embedded autonomous solutions.

Note

Flussonic stores recorded video streams in its internal representaion, independent of any specific video protocol. You can access a recorded stream via various protocols. The only thing you need is to enable DVR by adding a special option to the stream settings, and then use a special URL to play it back.

To start recording an archive, click a stream in the list in Media, go to the DVR section, and in the Path box specify the path to the directory on the server to store the recordings. You can also enable the archive manually through the configuration file. For details, see the guide on how to configure DVR (Digital Video Recording).

Flussonic DVR

How to check that the archive is recorded all right

You can check the operation of the archive in the Flussonic UI on the DVR tab in stream settings. This tab opens the DVR player. The same player is opened by the URL http://FLUSSONIC-HOSTNAME/STREAMNAME/embed.html?dvr=true.

Alternatively, you can open the link for HLS playback (see below) in any Middleware. For example, Stalker can generate such links, and many other middlewares can too.

How to play a stream's archive via HLS

To choose the output protocol, you should know which codec is supported by the majority of devices that your audience will use to watch the stream. See the list of supported formats for live streams

The guide on how to access the archive via various protocols gives you the examples of URLs for playing the recorded video stream.

There are a number of ways and protocols to access the archive. Let's look at some of them.

HLS URL

To access the archive via HLS, add the following URL to the player or Middleware that you use:

http://FLUSSONIC-IP/STREAM_NAME/archive-TIME-DURATION.m3u8

Here, TIME is the beginning of the extract, in Unix Timestamp in the UTC time zone, and DURATION is the duration of the extract in seconds. Example: archive-1350274200-4200.m3u8

Learn more about HLS playback

embed.html

Use the Flussonic's player embed.html.

With the ago option, the player will play live and allow rewinding back for the specified number of seconds:

http://FLUSSONIC-HOSTNAME/STREAMNAME/embed.html?ago=7200

Learn more about embed.html?ago=SECONDS

With the dvr=true option, the player will play archive and offer navigation tools:

http://FLUSSONIC-HOSTNAME/STREAMNAME/embed.html?dvr=true

Learn more about embed.html?dvr=true

Save as a .ts file

Request the specified part of the archive and save it as a .ts or .mp4 file. Learn more