Skip to content

Commit

Permalink
Add rtsp2webrtc
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Nov 11, 2020
1 parent 0fed3d7 commit c3fc53e
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
17 changes: 17 additions & 0 deletions rtsp2webrtc/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ARG BUILD_FROM
FROM $BUILD_FROM

RUN apk add --no-cache unzip go jq

WORKDIR /app

RUN curl -L https://github.com/deepch/RTSPtoWebRTC/archive/master.zip -o master.zip \
&& unzip master.zip \
&& mv RTSPtoWebRTC-master/* . \
&& go build \
&& rm -R RTSPtoWebRTC-master master.zip

COPY run.sh /
RUN chmod a+x /run.sh

CMD [ "/run.sh" ]
24 changes: 24 additions & 0 deletions rtsp2webrtc/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "RTSP2WebRTC",
"version": "0.1.0",
"slug": "rtsp2webrtc",
"description": "RTSP to WebRTC proxy",
"url": "https://github.com/AlexxIT/hassio-addons/tree/master/rtsp2webrtc",
"arch": ["armhf", "armv7", "aarch64", "amd64", "i386"],
"startup": "system",
"boot": "auto",
"webui": "http://[HOST]:[PORT:8083]/",
"host_network": true,
"options": {
"streams": [{
"name": "Sonoff",
"url": "rtsp://rtsp:[email protected]:554/av_stream/ch0"
}]
},
"schema": {
"streams": [{
"name": "str",
"url": "url"
}]
}
}
9 changes: 9 additions & 0 deletions rtsp2webrtc/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/with-contenv bashio

cat /data/options.json | jq "
{server: {http_port: \":8083\"}, streams: [.streams[] | {(.name): {url: .url}}] | add}
" > /app/config.json

cat /app/config.json

/app/RTSPtoWebRTC

0 comments on commit c3fc53e

Please sign in to comment.