Skip to content

Introduction

Supported Recording Formats: Currently supports recording in FLV and TS segment formats, and DASH(m4s) formats.

Delay in m3u8 and mpd generation: The recorded m3u8 and mpd files are only generated after the timeout period has elapsed and the source stream has been closed.

Configuration

  1. First, configure the recording directory in the top-level configuration file mms.yaml:
yaml
log_level: debug  
record_root_path: /data/record

It’s okay if the /data/record directory doesn’t exist initially; the program will automatically create the necessary directory structure based on the recording path.

  1. Configure the recording types in the stream publishing domain file (e.g., test.publish.com.yaml):
yaml
type: publish
name: test.publish.com
key_file: test.publish.com.key
cert_file: test.publish.com.crt
apps:
  - name: app                   # Entry point name
    record:
      enabled: false
      types: 
        - ts
        - flv
        - m4s

Streaming

Use OBS or FFmpeg to push the stream to: rtmp://test.publish.com/app/test

Recorded File Paths

According to the configuration in mms.yaml, if the recording root path is /data/record, then:

  • FLV path: /data/record/<domain>/<app>/<stream>/flv/<stream>_<unix_timestamp>.flv

  • TS path: /data/record/<domain>/<app>/<stream>/ts/<record_start_unix_timestamp>/<creation_unix_timestamp>_<segment_index>_<duration>_<start_pts>.ts

  • M3U8 path: /data/record/<domain>/<app>/<stream>/ts/<record_start_unix_timestamp>/<creation_unix_timestamp>.m3u8

  • DASH path: /data/record/<domain>/<app_name>/<stream_name>/dash/<record_start_unix_timestamp>/manifest.mpd

Playback of Recordings with Static File Server

yaml
http:
  enabled: true
  port: 80
  static_file_server:
    enabled: true
    path_map:
      /static/record/*: /data/record

To play a recorded FLV file, use the following path:

shell
ffplay http://<server_ip>:80/test.publish.com/app/test/flv/test_1747928859444.flv

To play a recorded M3U8 file, use the following path:

shell
ffplay http://<server_ip>:80/test.publish.com/app/test/ts/1747928859444/test_1747928859444.m3u8

To play the recorded DASH stream, you can use the following path with ffplay:

shell
ffplay http://<server_ip>:80/static/record/test.publish.com/app/test/ts/1747928859/manifest.mpd

Released under the MIT License.