Skip to content

简介

支持录制格式 :目前支持flv和ts切片录制及dash(m4s)录制

m3u8及mpd生成延时 : 录制的m3u8及mpd的生成,需要等到超时时间到了,关闭了source,才会生成

配置

  1. 首先需要在顶层配置文件mms.yaml中配置录制目录:
yaml
log_level: debug
record_root_path: /data/record

/data/record一开始没创建也没关系,程序将根据录制路径自动创建多级目录

  1. 在推流域名如: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                   #接入点名称
    record:
      enabled: false
      types: 
        - ts
        - flv
        - m4s

推流

使用obs或者ffmpeg推流:rtmp://test.publish.com/app/test

录制文件路径

根据mms.yaml中的配置,录制根路径为/data/record,那么:

  • flv的路径为:/data/record/域名/app名称/流名称/flv/流名称_unix时间戳.flv

  • ts的路径为:/data/record/域名/app名称/流名称/ts/录制开始unix时间戳/创建unix时间戳_ts序号_ts时长_开始pts.ts

  • m3u8的路径为:/data/record/域名/app名称/流名称/ts/录制开始unix时间戳/创建unix时间戳.m3u8

  • dash的路径为:/data/record/域名/app名称/流名称/dash/录制开始unix时间戳/manifest.mpd

结合静态文件服务器播放录制

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

如果要播放录制flv,可以通过以下路径,播放flv:

shell
ffplay http://服务器ip:80/static/record/test.publish.com/app/test/flv/test_1747928859444.flv

如果要播放录制m3u8,可以通过以下路径,播放m3u8:

shell
ffplay http://服务器ip:80/static/record/test.publish.com/app/test/ts/1747928859444/test_1747928859444.m3u8

如果要播放录制dash,可以通过以下路径,播放dash:

shell
ffplay http://服务器ip:80/static/record/test.publish.com/app/test/ts/1747928859/manifest.mpd

Released under the MIT License.