Deployment(docker) and demo of Open WebRTC Toolkit (OWT) Server

https://github.com/open-webrtc-toolkit/owt-server
https://hub.docker.com/r/dyhexl/owt-server

env

  • docker
  • postman
  • vscode (optional)

build

create container

docker run --rm -it \
--name owt-server \
dyhexl/owt-server:4.3.x bash
# waiting for getting into conntainer

scripts/keyutil.sh && \
# enter passphrase of key
# verify passphrase of key
# enter passphrase of key
# enter passphrase of certificate
# verify passphrase of certificate
scripts/build.js -t all --check && \
scripts/pack.js -t all --install-module --sample-path /owt-client-javascript/dist/samples/conference && \
cd dist && \
pushd management_api && node initcert.js && \
# enter passphrase of certificate
popd && \
pushd portal && node initcert.js && \
# enter passphrase of certificate
popd && \
pushd webrtc_agent && node initcert.js && \
# enter passphrase of certificate
popd && \
pushd management_console && node initcert.js && \
# enter passphrase of certificate
popd && \
cp -f ../cert/certificate.pfx extras/basic_example/cert/ && \
pushd extras/basic_example && node initcert.js && \
# enter passphrase of certificate
popd && \
./bin/init-all.sh --deps --hardware

config

Maybe you should install vim in container or use vscode with Remote-Containers extension in order to edit file

vi dist/portal/portal.toml
# config hostname with your own public hostname
# or config ip_address with your own public ip address

vi dist/extras/basic_example/public/scripts/index.js
# disable audio to play stream without audio
# refer https://github.com/hexray-newbee/owt-client-javascript/commit/b471586775e3270a36359e8feab592949d662987

save container to image

docker commit owt-server owt-server:runtime

run

docker run -d \
--restart always \
--net host \
--device /dev/dri/renderD128:/dev/dri/renderD128 \
owt-server:runtime \
sh -c "service mongodb start && \
service rabbitmq-server start && \
cd dist && \
./bin/init-all.sh --hardware && \
./bin/start-all.sh && \
sleep infinity"

test

start source

docker run --rm -it -p 8554:8554/tcp dyhexl/gst-rtsp-server:v1.16 ./test-launch "( videotestsrc ! x264enc ! rtph264pay name=pay0 pt=96 )"

docker run --rm -it -p 8554:8554/tcp dyhexl/gst-rtsp-server:v1.16 ./test-launch "( videotestsrc is-live=true ! video/x-raw, width=1280, height=720, framerate=24/1 ! x264enc bitrate=4096 tune=zerolatency ! video/x-h264, profile=constrained-baseline ! rtph264pay name=pay0 pt=96 )"

# usbcam with h264 output
docker run --rm -it --device /dev/video0:/dev/video0 -p 8554:8554/tcp dyhexl/gst-rtsp-server:v1.16 ./test-launch "( v4l2src ! video/x-h264, width=1280, height=720, framerate=24/1 ! rtph264pay name=pay0 pt=96 )"

add streaming

use postman

Create Room

refer https://software.intel.com/sites/products/documentation/webrtc/restapi/index.html#RESTAPIsection5_1_1

POST https://localhost:3004/rooms

{
    "name": "sample"
}

note sample room id

Start Streaming-in

refer https://software.intel.com/sites/products/documentation/webrtc/restapi/index.html#RESTAPIsection5_4_1

POST https://localhost:3004/rooms/${sampleRoomId}/streaming-ins

{
    "url": "rtsp://localhost:8554/test",
    "media": {
        "audio": false,
        "video": true
    },
    "transport": {
        "protocol": "udp",
        "bufferSize": 524288
    }
}

view sample

https://localhost:3004/?forward=true&publish=false&room=${sampleRoomId}

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐