livego README

The project's README from github.com/gwuhaolin/livego. As one markdown file: README.md.

中文

Test Release CodeQL Advanced

Simple and efficient live broadcast server:

Supported transport protocols

Supported container formats

Supported encoding formats

Installation

After directly downloading the compiled binary file, execute it on the command line.

Boot from Docker

Run docker run -p 1935:1935 -p 7001:7001 -p 7002:7002 -p 8090:8090 -d gwuhaolin/livego to start

Compile from source

  1. Download the source code git clone https://github.com/gwuhaolin/livego.git
  2. Go to the livego directory and execute go build or make build

Use

  1. Start the service: execute the livego binary file or make run to start the livego service;
  2. Get a channelkey(used for push the video stream) from http://localhost:8090/control/get?room=movie and copy data like your channelkey.
  3. Upstream push: Push the video stream to rtmp://localhost:1935/{appname}/{channelkey} through the RTMP protocol(default appname is live), for example, use ffmpeg -re -i demo.flv -c copy -f flv rtmp://localhost:1935/{appname}/{channelkey} push(download demo flv);
  4. Downstream playback: The following three playback protocols are supported, and the playback address is as follows:
    • RTMP:rtmp://localhost:1935/{appname}/movie
    • FLV:http://127.0.0.1:7001/{appname}/movie.flv
    • HLS:http://127.0.0.1:7002/{appname}/movie.m3u8
  5. Use hls via https: generate ssl certificate(server.key, server.crt files), place them in directory with executable file, change "use_hls_https" option in livego.yaml to true (false by default)

all options:

./livego  -h
Usage of ./livego:
      --api_addr string       HTTP manage interface server listen address (default ":8090")
      --config_file string    configure filename (default "livego.yaml")
      --flv_dir string        output flv file at flvDir/APP/KEY_TIME.flv (default "tmp")
      --gop_num int           gop num (default 1)
      --hls_addr string       HLS server listen address (default ":7002")
      --hls_keep_after_end    Maintains the HLS after the stream ends
      --httpflv_addr string   HTTP-FLV server listen address (default ":7001")
      --level string          Log level (default "info")
      --read_timeout int      read time out (default 10)
      --rtmp_addr string      RTMP server listen address

Use with flv.js

Interested in Golang? Please see Golang Chinese Learning Materials Summary

livego (gwuhaolin/livego)

Searching Database…

10.2K ·GitHub
What is this?livego is a simple, efficient live video streaming server written in pure Go: you push a video stream into it, and it re-serves that stream to viewers over RTMP, HTTP-FLV and HLS.
Is it a server I run myself, or a library I code against?A standalone server you self-host: start the livego binary, fetch a channelkey from its HTTP API, and it handles stream ingest and playback for you — no coding required.
How do I get it running?Fastest is Docker: docker run -p 1935:1935 -p 7001:7001 -p 7002:7002 -p 8090:8090 -d gwuhaolin/livego. You can also download a prebuilt binary and execute it, or build from source with go build or make build.
Do I need to install anything besides livego?No — it is one self-contained pure-Go binary. You only bring an encoder to push with (the README example uses ffmpeg) and a player that speaks RTMP, FLV or HLS.
Which protocols and codecs can it handle — anything it won't serve?It covers the common live stack: RTMP, AMF, HLS and HTTP-FLV for transport, FLV and TS containers, H264 video with AAC or MP3 audio. Formats outside that list are not supported.
Do I need to know Go to use it?No — running it is just executing a binary or a Docker command. Go only matters if you want to compile it yourself from source.
How do I publish a stream and play it back?Get a channelkey from the running server, push your stream to rtmp://localhost:1935/{appname}/{channelkey} (default appname is 'live'), then watch via the RTMP, FLV or HLS playback URLs the README lists.
Which ports does it listen on?The Docker command exposes four: 1935 for RTMP, plus 7001, 7002 and 8090, which carry the HTTP-based endpoints — the channelkey API and HTTP-FLV/HLS playback.
Can the HLS output be served over HTTPS?Yes: generate an SSL certificate (server.key and server.crt), place both files next to the livego executable, and switch usehlshttps to true in livego.yaml — it is false by default.
Why did the author build livego?The README's stated goal is a live broadcast server that is very simple to install and use: pure Go for high performance and cross-platform runs, with the common streaming protocols built in.
Creator
gwuhaolin
Size
2.6 MB
Stars
10.2K
Age
9y
Commits · 90 Days