mirror of
https://github.com/horgh/videostreamer.git
synced 2025-09-26 12:31:18 +08:00
Merge pull request #23 from fpaupier/master
add: support for docker-compose
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
|
||||
|
15
README.md
15
README.md
@@ -32,6 +32,21 @@ website.
|
||||
* Run the daemon. Its usage output shows the possible flags. There is no
|
||||
configuration file.
|
||||
|
||||
## Running with docker-compose
|
||||
|
||||
1. Copy the provided example environment file `.env.example`
|
||||
```shell
|
||||
cp .env.example .env
|
||||
```
|
||||
2. Edit the `.env` environment file with your config, especially the path towards your source input.
|
||||
|
||||
3. Run the app with docker-compose
|
||||
```shell
|
||||
docker-compose up
|
||||
# docker-compose up --build # if you wish to rebuild the docker image
|
||||
```
|
||||
|
||||
4. Use your favorite browser to open the `index.html` and you're good!
|
||||
|
||||
## Components
|
||||
* `videostreamer`: The daemon.
|
||||
|
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