hexcord-mediaserver

command module
v0.0.0-...-856b3f8 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

README

Hexcord mediaserver

Hexcord mediaserver is a standalone server that allows you to initiate a peer connection and forward audio and video streams via WebRTC to an rtmp endpoint.

Instructions

The mediaserver makes use of ffmpeg to forward the streams so you would need that installed. You would find installation instructions for ffmpeg here. The Pion webrtc library was used for the WebRTC implementation.

Start the server by either running go run main.go or run go build to build the binaries instead.

The server starts up at http://localhost:8090 and exposes an endpoint http://localhost:8090/webrtc/offer

Send a POST request with body

  {
    "ingestionAddress": "rtmp://RTMP_ADDRESS",
	"streamKey":        "234343sdsd-sdsfdfd-232dfdf",
	"offer":            "sdfarergehteafadfadfrrererdfdfdfd" // WebRTC offer from client
  }

Content-type for the request is application/json

The endpoint responds with a JSON body containing a webrtc session description

  {
    "type": "answer",
    "sdp": "sdsawewsdf434-dsdf34-sfdsfdgs434.sfdfdbvererasdsds" // use this as the remote description of the peer connection initiated on the client
  }

Have fun ❤️

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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