GithubHelp home page GithubHelp logo

rtmp-go-away's Introduction

RTMP Go Away

Real Time Messaging Protocol (RTMP) is a popular media streaming protocol that uses TCP persistent connections. When a connection between a live streaming client and the platform is interrupted, data from the live event is usually lost until the client can reconnect to a new server. RTMP Go Away is a new mechanism that allows for the live server to send a signal to the client indicating that it needs to terminate the existing connection. This allows the client to create a new connection at a logical media boundary, incurring zero data loss.

The purpose of this repository is to provide the RTMP Specifications required to implement this feature in both streaming clients and live servers. Additionally, a reference client implementation in FFmpeg is provided below.

Design Overview

  1. The streaming client will announce to the server that it supports the new feature upon connection. This will be done by adding a field to the RTMP connect packet object. The live server will parse this new field on connection and save the result for later use.
  2. Before the live server shuts down (e.g. for maintenance) it sends a new RTMP Go Away packet to the client. The live server should only send the Go Away packet to clients that support the feature.
  3. Upon receiving the Go Away packet, the streaming client will wait until the next logical media boundry (e.g. IDR frame), disconnect without the usual unpublish / deletestream teardown in order to facilitate reuse of the logical stream, and create a new connection to a new server. Once a new connection is established, the client can resume streaming from the logical boundry without experiencing any data loss.

RTMP Specification

The RTMP connect packet will indicate support of the feature with new field supportsGoAway set to true.

NetConnection Command {
   "CommandName": "connect",
   "CommandObject": {
     "flashVer": "...",
     "supportsGoAway": 1
   }
}

Before the live server shuts down it sends a new RTMP Go Away packet to the client using messageTypeId 32.

Protocol Control Message {
   "messageTypeId": 32
}

Reference Implementation

A working client implementation in FFmpeg is provided here as reference. This patch has been submitted to FFmpeg for consideration and review.

References

License

RTMP Go Away is licensed under the MIT license.

rtmp-go-away's People

Contributors

ac130uspectre avatar jdw2159 avatar jordicenzano avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.