rtmp-janus

command module
v0.0.0-...-5a7c413 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2020 License: MIT Imports: 20 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

RTMP to Janus Videoroom

Warning I am not a Go programmer

This is very much in the work-in-progress/proof-of-concept phase!

I really don't know go, I learned just enough so I could make use of the pion/webrtc library.

This is adapted from the Janus example in Pion's example-webrtc-applications repo.

Usage

rtmp-janus <listen host:port> ws://janus-host:port

# example: rtmp-janus :1935 ws://127.0.0.1:8188

What does this do?

When launched, this app:

  • Starts listening for incoming RTMP sessions.
  • Connects to Janus gateway via websocket, establishes a session.

When an RTMP connection is received, it parses the RTMP "key" for a room ID.

Example: rtmp://127.0.0.1:1935/live/1234 - the 1234 part of that URL becomes the room ID.

The live part of the URL (the application name) can be whatever you'd like, it's ignored.

The app then joins the janus videoroom and establishes a WebRTC session.

I'm assuming all incoming RTMP sessions are using H264 for video and AAC for audio.

H264 data is re-packed from FLV format into Annex-B format, but otherwise passed as-is (no decoding/encoding).

AAC audio is resampled to 48000kHz, stereo audio and encoded to Opus using ffmpeg.

TODO

  • Figure out what events from Janus I should handle (I just blast audio/video).
  • Check more sources for timing info (like the SPS NAL).
  • Support more audio samplerates (maybe?).
  • Generalize audio decoding, support more input audio codecs.

LICENSE

MIT (see LICENSE)

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL