Git Product home page Git Product logo

janus-gateway-live's Introduction

Janus-gateway live

janus-gateway-live compliant

Make janus-gateway more useful

This repository may be used in the scenarios: ?Your client rtmp living is not stable because of the not stable network; ?You may use janus-gateway's plugins, and want a standard rtmp/http-flv/hls for sharing.

This repository support now:

  • webrtc(opus + h264) ------(push)------> rtmp (only h264)
  • webrtc(opus + h264) ------(push)------> rtmp (aac + h264)
  • webrtc(opus + h264) <------(pull)------- rtmp (aac + h264)
  • webrtc(opus + h264) ---(multi mix + push)---> rtmp (aac + h264)

Table of Contents

Background

Janus-gateway is a wonderful webrtc gateway with many media scenarios, such as sip,videoroom,record and so on. Plugin record has record/playback api, so we can use the api for rtmp publish/play like record's record/playback.

Proposal: Don't make rtp2rtmp as a plugin, because any plugin may use the function just like record

The goals for this repository are:

  1. An example. May help someone for project using.
  2. Purpose Make more thing happen using janus.

Install

Preparation

First you should make sure that you can install the original janus-gateway successfully with --enable-post-processing. Because if enable-post-processing works, representing your ENV has Opus and FFmpeg, which will be used later.

# My environment is macOS High Sierra(version 10.13.6)
$ git clone https://github.com/meetecho/janus-gateway.git
$ git checkout a7d7991a

# make some janus-gateway prebuild for janus-gateway README.md

$ ./autogen.sh
$ ./configure --prefix=/your/path/janus PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig  --enable-post-processing
$ make -j8 && make install && make configs

# Then you can use janus-gateway's record plugin for record and play testing.

Patch

Patch the janus-gateway-live.patch, plugin recordplay can publish video to RTMP server or CDN.

$ cp live.h live.c janus-gateway-live.patch   /your/janus/source/path
$ cd /your/janus/source/path
$ patch -p1 < janus-gateway-live.patch
$ ./configure --prefix=/your/path/janus PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig  --enable-post-processing
$ make -j8 && make install && make configs

RTMP server or CDN

In the janus-gateway-live.patch, I use local RTMP server for video publish. You can modify the RTMP server yourself in conf/janus.plugin.recordplay.jcfg.sample.in with CDN. If you just want to use local RTMP server for testing, here it is:

$ git clone https://github.com/nginx/nginx.git
$ git clone https://github.com/arut/nginx-rtmp-module.git
$ git clone https://github.com/openssl/openssl.git
$ cd nginx && ./auto/configure --prefix=/path/nginx --with-debug --add-module=/path/nginx-rtmp-module --with-openssl=/path/openssl
$ make -j8 && make install
$ cp nginx.conf /path/nginx/conf && cp /path/nginx && ./sbin/nginx -c conf/nginx.conf

Usage

Use python SimpleHTTPServer for html web server:

$ cd /install/janus/path/share/janus/demos && nohup python -m SimpleHTTPServer 8888 &
$ /path/janus -C /path/janus.jcfg -p /path/janus.pid -L /path/janus.log -l -R -b -D -d 7 -e -B 50

RTMP pubslish

Open the demohttp://localhost:8888/ , Record start!
Then you can play the rtmp url with ffplay rtmp://localhost:1935/qixi/recording-id

Maintainers

@Bepartofyou.

Contributing

Feel free to dive in! Open an issue or submit PRs.

Standard Readme follows the Contributor Covenant Code of Conduct.

License

MIT Bepartofyou (七曦)

janus-gateway-live's People

Contributors

bepartofyou avatar

Watchers

James Cloos 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.