gohls

A server that exposes a directory for video streaming via web interface

Github星跟蹤圖

Golang HLS Streamer

CircleCI

Simple server that exposes a directory for video streaming via HTTP Live Streaming (HLS). Uses ffmpeg for transcoding.

This project is cobbled together from all kinds of code I had lying around so it's pretty crappy all around. It also has some serious shortcomings.

Running it

Important: You need the ffmpeg and ffprobe binaries in your PATH. The server will not start without them. You can find builds most operating systems at https://ffmpeg.org/download.html.

1. Download the binary for your operating system

You can find the latest release on the releases page https://github.com/shimberger/gohls/releases or just download a current snapshot:

2. Create a configuration file

The configuration is stored in JSON format. Just call the file gohls-config.json or whatever you like. The format is as follows:

{
	"folders": [
		{
			"path": "~/Videos",
			"title": "My Videos"
		},
		{
			"path": "~/Downloads",
			"title": "My Downloads"
		}
	]
}

This will configure which directories on your system will be made available for streaming. See the screenshot for details:

3. Run the server

Execute the command gohls serve -config <path-to-config> e.g. gohls serve -config gohls-config.json to serve the videos specified by the config file. To make the server listen on another port or address just use the serve command with --listen like so (the example uses port 7000 on all interfaces): gohls serve --listen :7000 -config <path-to-config>

4. Open a web browser

Visit the URL http://127.0.0.1:8080 to access the web interface.

Contributing

Requirements

  • go installed
  • npm installed
  • bash

Initial setup

  1. Clone the repository git@github.com:shimberger/gohls.git
  2. Build frontend cd ui/ && npm install && npm run build && cd ..
  3. Install go-bindata go install -v -i github.com/jteeuwen/go-bindata/go-bindata
  4. Run go-bindata -pkg api -o ./internal/api/bindata.go -prefix ui/build/ ui/build/...

Running server

To then run the development server execute: ./scripts/run.sh serve

License

See LICENSE.txt

主要指標

概覽
名稱與所有者shimberger/gohls
主編程語言Go
編程語言Go (語言數: 5)
平台
許可證Other
所有者活动
創建於2015-07-19 14:51:17
推送於2023-03-24 08:03:08
最后一次提交2023-03-24 08:57:06
發布數7
最新版本名稱snapshot (發布於 )
第一版名稱v0.1.0 (發布於 )
用户参与
星數574
關注者數24
派生數83
提交數156
已啟用問題?
問題數56
打開的問題數10
拉請求數21
打開的拉請求數2
關閉的拉請求數2
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?