Code Monkey home page Code Monkey logo

plugin-rtmp's Introduction

RTMP插件

rtmp插件提供rtmp协议的推拉流能力,以及向远程服务器推拉rtmp协议的能力。

仓库地址

https://github.com/Monibuca/plugin-rtmp

引入

import _ "m7s.live/plugin/rtmp/v4"

推拉地址形式

rtmp://localhost/live/test
  • localhost是m7s的服务器域名或者IP地址,默认端口1935可以不写,否则需要写
  • live代表appName
  • test代表streamName
  • m7s中live/test将作为streamPath为流的唯一标识

例如通过ffmpeg向m7s进行推流

ffmpeg -i [视频源] -f flv rtmp://localhost/live/test

会在m7s内部形成一个名为live/test的流

如果m7s中已经存在live/test流的话就可以用rtmp协议进行播放

ffplay -i rtmp://localhost/live/test

配置

rtmp:
    publish:
        pubaudio: true
        pubvideo: true
        kickexist: false
        publishtimeout: 10
        waitclosetimeout: 0
    subscribe:
        subaudio: true
        subvideo: true
        iframeonly: false
        waittimeout: 10
    tcp:
        listenaddr: :1935
        listennum: 0
    pull:
        repull: 0 # 当断开后是否自动重新拉流,0代表不进行重新拉流,-1代表无限次重新拉流
        pullonstart: false # 是否在m7s启动的时候自动拉流
        pullonsubscribe: false  # 是否在有人订阅的时候自动拉流(按需拉流)
        pulllist: {} # 拉流列表,以 streamPath为key,远程地址为value
    push:
        repush: 0 # 当断开后是否自动重新推流,0代表不进行重新推流,-1代表无限次重新推流
        pushlist: {} # 推流列表,以 streamPath为key,远程地址为value
    chunksize: 4096
    keepalive: false #保持rtmp连接,默认随着stream的close而主动断开

:::tip 配置覆盖 publish subscribe 两项中未配置部分将使用全局配置 :::

API

plugin-rtmp's People

Contributors

eduardotang avatar langhuihui avatar yangchao2015 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.