marksverdhei commited on
Commit
9864ea4
·
verified ·
1 Parent(s): 6e20182

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. Dockerfile +1 -1
  2. go2rtc.yaml +4 -0
  3. web/index.html +4 -1
Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
  FROM debian:bookworm-slim
2
 
3
  RUN apt-get update && \
4
- apt-get install -y --no-install-recommends wget ca-certificates && \
5
  rm -rf /var/lib/apt/lists/*
6
 
7
  RUN wget -O /usr/local/bin/go2rtc \
 
1
  FROM debian:bookworm-slim
2
 
3
  RUN apt-get update && \
4
+ apt-get install -y --no-install-recommends wget ca-certificates ffmpeg && \
5
  rm -rf /var/lib/apt/lists/*
6
 
7
  RUN wget -O /usr/local/bin/go2rtc \
go2rtc.yaml CHANGED
@@ -5,6 +5,10 @@ api:
5
 
6
  streams:
7
  live: []
 
 
 
 
8
 
9
  webrtc:
10
  candidates:
 
5
 
6
  streams:
7
  live: []
8
+ test: ffmpeg:testsrc -re -f lavfi -i testsrc=size=1280x720:rate=30 -c:v libx264 -preset ultrafast -tune zerolatency -g 30 -f flv {output}
9
+
10
+ ffmpeg:
11
+ bin: ffmpeg
12
 
13
  webrtc:
14
  candidates:
web/index.html CHANGED
@@ -24,9 +24,12 @@
24
  let bufferQueue = [];
25
  let reconnectTimer;
26
 
 
 
 
27
  function connect() {
28
  const proto = location.protocol === 'https:' ? 'wss:' : 'ws:';
29
- ws = new WebSocket(`${proto}//${location.host}/api/ws?src=live`);
30
  ws.binaryType = 'arraybuffer';
31
 
32
  ws.onopen = () => {
 
24
  let bufferQueue = [];
25
  let reconnectTimer;
26
 
27
+ // Use ?src= from URL hash, default to "test" for demo, "live" for real stream
28
+ const streamSrc = location.hash.replace('#', '') || 'test';
29
+
30
  function connect() {
31
  const proto = location.protocol === 'https:' ? 'wss:' : 'ws:';
32
+ ws = new WebSocket(`${proto}//${location.host}/api/ws?src=${streamSrc}`);
33
  ws.binaryType = 'arraybuffer';
34
 
35
  ws.onopen = () => {