From 5949365d8419d0c4869773fe3b8b70e0452aaa72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81u=20Ma?= Date: Sun, 21 Mar 2021 14:25:21 +0100 Subject: [PATCH 1/2] - changed to self-contained dockers. Just run docker-compose up --- Makefile | 11 +++-------- README.md | 12 ++++-------- docker-compose.yml | 17 +++++++++++++++++ gst_test/Dockerfile | 12 ++++++++++++ gst_test.sh => gst_test/run.sh | 2 +- 5 files changed, 37 insertions(+), 17 deletions(-) create mode 100644 docker-compose.yml create mode 100644 gst_test/Dockerfile rename gst_test.sh => gst_test/run.sh (85%) diff --git a/Makefile b/Makefile index 19a2032..841dc05 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,5 @@ TEMPLATE_NAME ?= janus -run: image - @docker run -it -p 8188:8188 -p 8189:8189 -p 6000:6000/udp -p 6001:6001/udp -p 6002:6002/udp $(TEMPLATE_NAME) - -shell: image - @docker run -it -p 8188:8188 -p 8189:8189 -p 6000:6000/udp -p 6001:6001/udp -p 6002:6002/udp $(TEMPLATE_NAME) /bin/bash - -image: - @docker build -t $(TEMPLATE_NAME) . +run-demo: + docker-compose up + @echo "open brower at http://localhost:8000 port" diff --git a/README.md b/README.md index d0e8d2f..9f4de58 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,8 @@ Run up a [janus-gateway](https://github.com/meetecho/janus-gateway) instance usi ## Streaming test -1. Install docker and GStreamer 1.0. +1. install docker-compose +2. run `docker-compose up` +3. open browser at http://localhost:8000 -2. Build this image with `make image` - -3. Run the Janus server with `make run`. This will forward some ports: 8088/tcp (HTTP), 8188/tcp (WebSocket), 6000/udp (RTP) - -4. Run `./gst_test.sh` to start sending RTP to Janus. - -5. Start an HTTP server in `webapps/` and browse to the index. You should see a test pattern. +you should see a test pattern diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a033156 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,17 @@ +version: '3.1' +services: + webapp: + image: python:3.9 + ports: + - "8000:8000" + command: python3 -m http.server --directory=/webapp + volumes: + - ./webapp:/webapp + janus: + build: . + ports: + - "8188:8188" + - "8189:8189" + - "6000-6002:6000-6002/udp" + videosrc: + build: gst_test diff --git a/gst_test/Dockerfile b/gst_test/Dockerfile new file mode 100644 index 0000000..3c2673d --- /dev/null +++ b/gst_test/Dockerfile @@ -0,0 +1,12 @@ +FROM ubuntu:20.04 + + +RUN apt-get update -y # TODO: merge it with rest of commands +RUN apt-get install -y gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-plugins-rtp +RUN apt-get install -y gstreamer1.0-tools +# TODO: cleanup of files + + +ADD run.sh /run.sh + +CMD /run.sh diff --git a/gst_test.sh b/gst_test/run.sh similarity index 85% rename from gst_test.sh rename to gst_test/run.sh index 629c785..91b686f 100755 --- a/gst_test.sh +++ b/gst_test/run.sh @@ -10,4 +10,4 @@ gst-launch-1.0 -v videotestsrc is-live=true \ ! queue \ ! vp8enc deadline=33333 cpu-used=16 target-bitrate=$BITRATE keyframe-max-dist=90 max-quantizer=24 \ ! rtpvp8pay \ -! udpsink host=127.0.0.1 port=6000 sync=false qos=true +! udpsink host=janus port=6000 sync=false qos=true From 2a184d03d0b8bea3c3f80eae487cbd835fab5927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81u=20Ma?= Date: Sun, 28 Mar 2021 11:18:55 +0200 Subject: [PATCH 2/2] - apt-clean in Dockerfile --- gst_test/Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gst_test/Dockerfile b/gst_test/Dockerfile index 3c2673d..4081104 100644 --- a/gst_test/Dockerfile +++ b/gst_test/Dockerfile @@ -1,10 +1,9 @@ FROM ubuntu:20.04 - -RUN apt-get update -y # TODO: merge it with rest of commands -RUN apt-get install -y gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-plugins-rtp -RUN apt-get install -y gstreamer1.0-tools -# TODO: cleanup of files +RUN apt-get update -y && \ + apt-get install -y gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-plugins-rtp \ + gstreamer1.0-tools && \ + apt-get clean -y ADD run.sh /run.sh