http-rtmp-multiplex-server

command module
v0.0.0-...-c0075e1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2018 License: MIT Imports: 12 Imported by: 0

README

HTTP and RTMP Multiplexed Server

Example is showing how its possible to run HTTP and RTMP server on same port.

Useful when we are limited to run our service on single port.

That example would not be possible without two awesome libraries;

  • cmux - connection multiplexer for Go
  • joy4 - audio/video library and streaming server for Go

Running Server

go get -u -v github.com/jkuri/http-rtmp-multiplex-server
cd $GOPATH/src/github.com/jkuri/http-rtmp-multiplex-server
dep ensure
go run main.go

Server will start on port 8300.

Example Usage

First run the server, then

ffmpeg -re -i movie.flv -c copy -f flv rtmp://localhost:8300/movie # stream movie from file
ffmpeg -f avfoundation -i "0:0" .... -f flv rtmp://localhost:8300/screen # stream screen in MacOS

Play the live stream:

mpv http://localhost:8300/movie # play movie
ffplay http://localhost:8300/screen # play screen

License

MIT

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