Skip to main content
Skip table of contents

Arсhitecture of Mediasever

Mediaserver is a powerful media data processing and management platform that consists of several key modules, each responsible for performing specific functions. On this documentation page, we explore the Mediaserver architecture and the features of each of its modules: Capture, Streaming, and DVR, as well as the Web service.

In this article

The architectural scheme

13.png

The Mediaserver architecture

Capture

The Capture module is designed to maintain a connection with a camera or another type of stream source and perform the following main functions:

  • Provide API for modules (internal clients) to capture streams.

  • Capture RTSP streams via TCP and UDP protocols.

  • Process RTP packages.

The Capture module contains the handlers to perform its functions:

  • Streamer. In the Capture module, a separate Streamer handler is created each time when a stream is added. This handler provides the interface that processes stream RTP packages and forwards them for further streaming.

  • Recorder. In the Capture module, this handler is created when recording of a stream is enabled. This handler provides the interface that processes stream RTP packages and forwards RTP packages to DVR/Archive.

Streaming

The Streaming module provides comprehensive management of video streams, encompassing multiple formats and protocols.

  • RTSP Live streaming – video live streaming via the RTSP protocol.

  • RTSP Archive/DVR streaming – streaming of archived video via the RTSP protocol.

  • HLS Live streaming – video live streaming via the HLS protocol.

  • HLS Archive/DVR streaming – streaming of archived video via the HLS protocol.

  • WebRTC Live streaming – video live streaming via WebRTC.

  • WebRTC Archive/DVR streaming – streaming of archived video via WebRTC.

  • Export of archived recordings as a separate archive in fMP4.

  • Export of archived recordings as a separate TAR archive.

To perform its functions, the Streaming module interacts with the following Live/DVR player handlers:

  • HLS Live / RTSP Live / WebRTC Live. These handlers process requests to view video in live mode.

  • HLS DVR / RTSP DVR / WebRTC DVR. These handlers process requests to view video from Archive/DVR.

  • The DVR player service is designed to load all the RTP packages from the Archive/DVR according to the specified stream (Stream UID) within a specific time stamp (Time stamp).

DVR

The DVR module within Mediaserver enables video stream recording and video archive management. Digital Video Recording (DVR) provides flexible options for configuring video stream recording, storage, and subsequent archive utilization for each stream. This approach ensures adaptable video data management for various scenarios and system conditions, enabling efficient storage control.

DVR provides the following capabilities. Recording and storage of a stream with regard to the set requirements:

  • By default, DVR recordings are created in 2-minute segments. However, when setting up a stream in the Controller, you can adjust the recording duration to suit your needs.

  • The system automatically archives data to a local storage within a specified directory and retains it for a defined period. After this period expires, older recordings are automatically deleted, ensuring continuous storage of new data. Additionally, the option to completely delete the archive upon client request is provided.

  • The system allows for continuous archiving, meaning video is recorded non-stop for a full, unbroken record. However, you can also configure partial recording to conserve resources, with options to customize that are based on specific criteria:

    • Recording on demand – recording starts and stops at the client's request.

    • Event-based recording – recording is activated by a specific event, for example, motion detection in a frame.

    • Scheduled recording – video recording is activated according to a set timetable.

    • Thinned recording – stream recording is performed with various thinning options:

      • Continuous – only the key frames of the stream (IDR frames) are recorded.

      • On demand – recording starts at the client's request.

      • Scene activity-based – if there are no changes in the frame, only IDR frames are recorded. When changes occur in the frame, an event is triggered, and the video stream is fully recorded.

The archive export feature enables you to save videos in different formats, each optimized for different purposes and offering its own set of advantages:

  • MP4 is one of the most popular video formats, widely compatible with various devices and software. This makes MP4 a great option for convenient playback and sharing of video files.

  • fMP4 is an MP4 variant designed for adaptive streaming. It enables video to dynamically adjust to the user's internet connection speed, providing smooth playback and low latency even when the network changes.

  • Snapshot (MP4) – a snapshot in MP4 format. This format is excellent for quick access to key moments in a video, making it easy to find and view important events.

  • Preview (MP4) – a short clip of the video material in MP4 format, allowing for quick content assessment before full viewing.

  • Raw archive – this format preserves the uncompressed and unedited video stream, allowing for comprehensive post-processing and analysis. By retaining the original data, it's ideal for professional applications requiring meticulous video examination.

Streaming and playback of DVR recordings:

  • Remote access to DVR recordings is streamlined using RTSP, HLS, and fMP4. These technologies deliver high-quality, adaptive streaming, ensuring compatibility across a wide range of devices, including computers, smartphones, and tablets.

  • Playback of DVR recordings without capture. One of the significant functions of a DVR is the ability to view recorded video streams without the need to recapture them. This is particularly relevant for video surveillance systems, where quick access to archived recordings is required.

Web

The Web service offers functionalities to manage data streams, handle requests, and ensure system failure tolerance through the following mechanisms:

  • HTTP/HTTPS API to manage streams (CRUD): add, delete, authorize, and create tokens.

  • HTTP/HTTPS proxy API to redirect requests to specified addresses.

  • Cluster API. This is an API for clusters to ensure the system failure tolerance mechanism.

  • Webhooks/Websockets. This is a mechanism to inform the Controller about the events. For example, a stream was added, its status was changed, etc. For details, refer to the Configuration of Webhook and notifications documentation section.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.