mirror of
https://github.com/horgh/videostreamer.git
synced 2025-09-26 20:41:31 +08:00
add: support for docker-compose
Copy the .env.example into a .env file, update with your variable run `docker-compose up` https://github.com/horgh/videostreamer/issues/22
This commit is contained in:
6
.env.example
Normal file
6
.env.example
Normal file
@@ -0,0 +1,6 @@
|
||||
HOST=0.0.0.0
|
||||
PORT=8080
|
||||
FORMAT=rtsp
|
||||
FCGI=false
|
||||
SOURCE_RTSP=rtsp://rtsp.stream/pattern
|
||||
VERBOSE=true
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,5 @@
|
||||
.idea
|
||||
.env
|
||||
*.swp
|
||||
cmd/remux_example/remux_example
|
||||
videostreamer
|
||||
|
30
docker-compose.yaml
Normal file
30
docker-compose.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
version: "2.3"
|
||||
|
||||
services:
|
||||
rtsp2mp4:
|
||||
container_name: videostreamer
|
||||
image: popszer/rtsp2mp4:v0.0.1
|
||||
build: .
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- HOST=${HOST}
|
||||
- PORT=${PORT}
|
||||
- FCGI=${FCGI}
|
||||
- VERBOSE=${VERBOSE}
|
||||
- FORMAT=${FORMAT}
|
||||
- SOURCE_RTSP=${SOURCE_RTSP}
|
||||
ports:
|
||||
- "${PORT}:${PORT}"
|
||||
command:
|
||||
- /bin/bash
|
||||
- -c
|
||||
- |
|
||||
/videostreamer -host ${HOST} \
|
||||
-port ${PORT} \
|
||||
-input ${SOURCE_RTSP} \
|
||||
-verbose ${VERBOSE} \
|
||||
-fcgi ${FCGI} \
|
||||
-format ${FORMAT}
|
||||
|
||||
|
@@ -108,10 +108,10 @@ func main() {
|
||||
func getArgs() (Args, error) {
|
||||
listenHost := flag.String("host", "0.0.0.0", "Host to listen on.")
|
||||
listenPort := flag.Int("port", 8080, "Port to listen on.")
|
||||
format := flag.String("format", "pulse", "Input format. Example: rtsp for RTSP.")
|
||||
input := flag.String("input", "", "Input URL valid for the given format. For RTSP you can provide a rtsp:// URL.")
|
||||
format := flag.String("format", "rtsp", "Input format. Example: rtsp for RTSP.")
|
||||
input := flag.String("input", "rtsp://rtsp.stream/pattern", "Input URL valid for the given format. For RTSP you can provide a rtsp:// URL.")
|
||||
verbose := flag.Bool("verbose", false, "Enable verbose logging output.")
|
||||
fcgi := flag.Bool("fcgi", true, "Serve using FastCGI (true) or as a regular HTTP server.")
|
||||
fcgiVar := flag.Bool("fcgi", false, "Serve using FastCGI (true) or as a regular HTTP server.")
|
||||
|
||||
flag.Parse()
|
||||
|
||||
@@ -136,7 +136,7 @@ func getArgs() (Args, error) {
|
||||
InputFormat: *format,
|
||||
InputURL: *input,
|
||||
Verbose: *verbose,
|
||||
FCGI: *fcgi,
|
||||
FCGI: *fcgiVar,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user