Giter Club home page Giter Club logo

rtmp-janus's Introduction

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)

rtmp-janus's People

Contributors

jprjr avatar

Watchers

 avatar

Forkers

tommyteavee

rtmp-janus's Issues

cgo-gcc linke-issue

command-line-arguments

/tmp/go-build151217969/b001/_x002.o: In function _cgo_658371149a58_Cfunc_aac_decoder_decode': /tmp/go-build/cgo-gcc-prolog:66: undefined reference to aac_decoder_decode'
/tmp/go-build151217969/b001/_x002.o: In function _cgo_658371149a58_Cfunc_aac_decoder_new': /tmp/go-build/cgo-gcc-prolog:83: undefined reference to aac_decoder_new'
/tmp/go-build151217969/b001/_x002.o: In function _cgo_658371149a58_Cfunc_aac_decoder_open': /tmp/go-build/cgo-gcc-prolog:104: undefined reference to aac_decoder_open'
/tmp/go-build151217969/b001/_x002.o: In function _cgo_658371149a58_Cfunc_audio_fifo_load': /tmp/go-build/cgo-gcc-prolog:136: undefined reference to audio_fifo_load'
/tmp/go-build151217969/b001/_x002.o: In function _cgo_658371149a58_Cfunc_audio_fifo_new': /tmp/go-build/cgo-gcc-prolog:155: undefined reference to audio_fifo_new'
/tmp/go-build151217969/b001/_x002.o: In function _cgo_658371149a58_Cfunc_audio_fifo_open': /tmp/go-build/cgo-gcc-prolog:176: undefined reference to audio_fifo_open'
/tmp/go-build151217969/b001/_x002.o: In function _cgo_658371149a58_Cfunc_audio_fifo_read': /tmp/go-build/cgo-gcc-prolog:196: undefined reference to audio_fifo_read'
/tmp/go-build151217969/b001/_x002.o: In function _cgo_658371149a58_Cfunc_audio_fifo_size': /tmp/go-build/cgo-gcc-prolog:215: undefined reference to audio_fifo_size'
/tmp/go-build151217969/b001/_x002.o: In function _cgo_658371149a58_Cfunc_opus_encoder_encode': /tmp/go-build/cgo-gcc-prolog:266: undefined reference to opus_encoder_encode'
/tmp/go-build151217969/b001/_x002.o: In function _cgo_658371149a58_Cfunc_opus_encoder_new': /tmp/go-build/cgo-gcc-prolog:285: undefined reference to opus_encoder_new'
/tmp/go-build151217969/b001/_x002.o: In function _cgo_658371149a58_Cfunc_aac_decoder_close': /tmp/go-build/cgo-gcc-prolog:49: undefined reference to aac_decoder_close'
/tmp/go-build151217969/b001/_x002.o: In function _cgo_658371149a58_Cfunc_audio_fifo_close': /tmp/go-build/cgo-gcc-prolog:119: undefined reference to audio_fifo_close'
/tmp/go-build151217969/b001/_x002.o: In function _cgo_658371149a58_Cfunc_opus_encoder_close': /tmp/go-build/cgo-gcc-prolog:250: undefined reference to opus_encoder_close'
/tmp/go-build151217969/b001/_x003.o: In function _cgo_658371149a58_Cfunc_aac_decoder_init': /tmp/go-build/cgo-gcc-prolog:52: undefined reference to aac_decoder_init'
collect2: error: ld returned 1 exit status

Could you add the build process for this project ? thanks

dtls error

Hi,
when push media to rtmp janus server hangup auto, janus print dtls issue

Handshake error: error:1409017F:SSL routines:ssl3_get_server_certificate:wrong certificate type

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.