Coder Social home page Coder Social logo

webrtc-forwarder's Introduction

WebRTC Forwarder

Utility for webrtc-cdn to forward WebRTC to other protocol, like RTMP.

It uses FFMpeg for the protocol remuxing, and the pion/webrtc for WebRTC connectivity.

Compilation

In order to install dependencies, type:

go get github.com/AgustinSRG/webrtc-forwarder

To compile the code type:

go build

The build command will create a binary in the currenct directory, called webrtc-forwarder, or webrtc-forwarder.exe if you are using Windows.

Usage

You can use the program from the command line:

webrtc-forwarder [OPTIONS]

OPTIONS (Required)

Here is a list of the required options:

Option Description
--input, -i <input-url> Sets the input URL. Example: ws://localhost/stream-id
--video-port, -vp <port> Port to forward video RTP packets.
--audio-port, -ap <port> Port to forward audio RTP packets.
--sdp-file, -sdp <file.sdp> File to use to forward the stream. After the connection is stablished, you can use this file as an input of FFMPEG.
--forward-mode, -fm <mode> Forward mode, check the section below for mode details.

Forward modes

The available forward modes are the following:

Mode Description
TEST Just setups the SDP file and lets you test it by yourself.
RTMP Forwards to RTMP using the envirinment variable RTMP_FORWARD_URL. Example: rtmp://live.twitch.tv/app/$STREAM_KEY
CUSTOM Run a custom command to forward or process the stream. The command must be set in CUSTOM_FORWARD_COMMAND environment variable.

OPTIONS (Optional)

Here is a list of the rest of the options:

Option Description
--help, -h Shows the command line options
--version, -v Shows the version
--debug Enables debug mode (prints more messages)
--ffmpeg-path <path> Sets the FFMpeg path. By default is /usr/bin/ffmpeg. You can also change it with the environment variable FFMPEG_PATH
--auth, -a <auth-token> Sets auth token for the source.
--secret, -s <secret> Provides secret to generate authentication tokens.

WebRTC options

You can configure WebRTC configuration options with environment variables:

Variable Name Description
STUN_SERVER STUN server URL. Example: stun:stun.l.google.com:19302
TURN_SERVER TURN server URL. Set if the server is behind NAT. Example: turn:turn.example.com:3478
TURN_USERNAME Username for the TURN server.
TURN_PASSWORD Credential for the TURN server.

webrtc-forwarder's People

Contributors

agustinsrg avatar

Stargazers

 avatar

Watchers

 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.