Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
6177e62
added webrtc as paraller pipeline
Irakus Sep 1, 2025
7c5afce
moved webrtc to separate pipeline
Irakus Sep 1, 2025
c4c5d7b
trying to add iframe
Irakus Sep 2, 2025
17b3805
added
Irakus Sep 3, 2025
78eed94
start using js script from mediamtx
Irakus Sep 3, 2025
199c53d
checkpoint
Irakus Sep 3, 2025
df1980d
revert dockrfile format
Irakus Sep 3, 2025
02c5e4c
trying to fix server
Irakus Sep 3, 2025
e56ec39
added certs
Irakus Sep 4, 2025
f7bc82a
working embeded video
Irakus Sep 5, 2025
064b93c
removed old dlstreamer source
Irakus Sep 8, 2025
f9b39da
Merge branch 'main' of https://github.com/open-edge-platform/scenesca…
Irakus Sep 8, 2025
e9a3587
move everything into 1 pipeline
Irakus Sep 8, 2025
7a8ac49
clean scene
Irakus Sep 8, 2025
cc6a84d
clean pr
Irakus Sep 8, 2025
cd1f559
clean red marks on cameras
Irakus Sep 9, 2025
113d1e2
removed mqtt feed from web app
Irakus Sep 9, 2025
501612b
changed video format
Irakus Sep 10, 2025
c8290d3
videos replaced with webrtc - need change of trigger in calibration page
Irakus Sep 11, 2025
db104c9
working fine, but slow
Irakus Sep 11, 2025
ac2725d
still slow
Irakus Sep 11, 2025
cad52fe
optimized
Irakus Sep 11, 2025
dafc7be
checkpoint
Irakus Sep 11, 2025
1deb16b
optimized stream loading:
Irakus Sep 12, 2025
1435fed
remove logging rtc connections
Irakus Sep 12, 2025
72ce7af
checkpoint
Irakus Sep 15, 2025
aac76ab
added video as fallback
Irakus Sep 15, 2025
fe5e11e
Merge branch 'main' into ITEP-68945-webrtc-raw
Irakus Sep 15, 2025
60396d5
Merge branch 'main' into ITEP-68945-webrtc-raw
Irakus Sep 16, 2025
a107107
checkpoint
Irakus Sep 16, 2025
dbc1844
Merge branch 'ITEP-68945-webrtc-raw' of https://github.com/open-edge-…
Irakus Sep 16, 2025
47602bb
fixed autocalibration
Irakus Sep 16, 2025
65de5d7
fixed long loading of videos
Irakus Sep 16, 2025
70f1412
cleanup
Irakus Sep 16, 2025
8294734
removed ip from config
Irakus Sep 17, 2025
e13f63d
Merge branch 'main' into ITEP-68945-webrtc-raw
Irakus Sep 17, 2025
c91316d
updated licenses and docs
Irakus Sep 17, 2025
e9c16dc
reformatted dockerfile
Irakus Sep 17, 2025
a8e69fc
update dls configs
Irakus Sep 17, 2025
e489c2d
update perf config
Irakus Sep 17, 2025
7500fa8
prettrier write
Irakus Sep 17, 2025
b4b545e
clean docs
Irakus Sep 17, 2025
2d90496
Merge branch 'main' into ITEP-68945-webrtc-raw
Irakus Sep 18, 2025
7a2bdc9
revert calibration fix
Irakus Sep 18, 2025
6b211b2
newline
Irakus Sep 18, 2025
c4e354f
Merge branch 'main' into ITEP-68945-webrtc-raw
Irakus Sep 19, 2025
fe2abf7
Merge branch 'main' into ITEP-68945-webrtc-raw
Irakus Sep 22, 2025
7e23d74
Merge branch 'main' of https://github.com/open-edge-platform/scenesca…
Irakus Oct 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions dlstreamer-pipeline-server/queuing-config-webrtc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"config": {
"logging": {
"C_LOG_LEVEL": "INFO",
"PY_LOG_LEVEL": "INFO"
},
"pipelines": [
{
"name": "qcam2",
"source": "gstreamer",
"pipeline": "multifilesrc loop=TRUE location=/home/pipeline-server/videos/qcam2.ts name=source ! decodebin ! videoconvert ! video/x-raw,format=BGR ! gvapython class=PostDecodeTimestampCapture function=processFrame module=/home/pipeline-server/user_scripts/gvapython/sscape/sscape_adapter.py name=timesync ! gvadetect model=/home/pipeline-server/models/intel/person-detection-retail-0013/FP32/person-detection-retail-0013.xml model-proc=/home/pipeline-server/models/object_detection/person/person-detection-retail-0013.json ! gvametaconvert add-tensor-data=true name=metaconvert ! gvametapublish name=destination ! appsink sync=true",
"auto_start": true,
"parameters": {
"type": "object",
"properties": {
"ntp_config": {
"element": {
"name": "timesync",
"property": "kwarg",
"format": "json"
},
"type": "object",
"properties": {
"ntpServer": {
"type": "string"
}
}
},
"camera_config": {
"element": {
"name": "datapublisher",
"property": "kwarg",
"format": "json"
},
"type": "object",
"properties": {
"cameraid": {
"type": "string"
},
"metadatagenpolicy": {
"type": "string",
"description": "Meta data generation policy, one of detectionPolicy(default),reidPolicy,classificationPolicy"
},
"publish_frame": {
"type": "boolean",
"description": "Publish frame to mqtt"
}
}
}
}
},
"payload": {
"destination": {
"metadata": {
"type": "file",
"path": "/tmp/results.jsonl",
"format": "json-lines"
},
"frame": {
"type": "webrtc",
"peer-id": "cam"
}
},
"parameters": {
"ntp_config": {
"ntpServer": "ntpserv"
},
"camera_config": {
"cameraid": "atag-qcam2",
"metadatagenpolicy": "detectionPolicy"
}
}
}
}
]
}
}
2 changes: 1 addition & 1 deletion dlstreamer-pipeline-server/queuing-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@
}
]
}
}
}
105 changes: 54 additions & 51 deletions manager/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"]
RUN : \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
libboost-python-dev \
libegl1 \
libgl1 \
libglib2.0 \
python3-dev \
libboost-python-dev \
libegl1 \
libgl1 \
libglib2.0 \
python3-dev \
&& rm -rf /var/lib/apt/lists/*

# ---------- Manager Runtime Stage ------------------
Expand All @@ -42,38 +42,38 @@ ENV SCENESCAPE_HOME=/home/$WSUSER/SceneScape
ARG FORCE_VAAPI

RUN : \
&& apt-get update \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
ca-certificates \
curl \
ca-certificates \
&& install -d /usr/share/postgresql-common/pgdg \
&& curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc \
&& echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
apache2 \
bindfs \
bzip2 \
libegl1 \
libgl1 \
libapache2-mod-wsgi-py3 \
libapache2-mod-qos \
libglib2.0-0 \
libgomp1 \
mosquitto-clients \
netcat \
postgresql-15 \
python-is-python3 \
python3-pip \
sudo \
apache2 \
bindfs \
bzip2 \
libegl1 \
libgl1 \
libapache2-mod-wsgi-py3 \
libapache2-mod-qos \
libglib2.0-0 \
libgomp1 \
mosquitto-clients \
netcat \
postgresql-15 \
python-is-python3 \
python3-pip \
sudo \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Runtime dependencies
COPY ./manager/requirements-runtime.txt /tmp
RUN pip3 install --upgrade --no-cache-dir \
--extra-index-url https://download.pytorch.org/whl/cpu \
-r /tmp/requirements-runtime.txt
--extra-index-url https://download.pytorch.org/whl/cpu \
-r /tmp/requirements-runtime.txt

RUN : \
; PSQLVER=$(ls /etc/postgresql) \
Expand All @@ -83,19 +83,19 @@ RUN : \

RUN : \
; a2dismod -f \
auth_basic \
authn_core \
authn_file \
authz_host \
authz_user \
autoindex \
status \
auth_basic \
authn_core \
authn_file \
authz_host \
authz_user \
autoindex \
status \
; a2enmod \
allowmethods \
headers \
proxy \
proxy_wstunnel \
ssl \
allowmethods \
headers \
proxy \
proxy_wstunnel \
ssl \
; a2ensite default-ssl \
;

Expand Down Expand Up @@ -155,12 +155,15 @@ RUN chmod -R u=rwX,go=rX $SCENESCAPE_HOME/manager/static/bootstrap/
RUN OPENCV_SHA=$(openssl dgst -sha256 -binary "$SCENESCAPE_HOME/manager/static/assets/opencv.js" | openssl base64) && \
sed -i "s|sha256-opencv|sha256-${OPENCV_SHA}|g" /etc/apache2/sites-available/000-default.conf

RUN READER_SHA=$(openssl dgst -sha256 -binary "$SCENESCAPE_HOME/manager/static/assets/reader.js" | openssl base64) && \
sed -i "s|sha256-reader|sha256-${READER_SHA}|g" /etc/apache2/sites-available/000-default.conf

COPY ./manager/config/user_access_config.json $SCENESCAPE_HOME

COPY ./manager/config/webserver-init \
./manager/config/database-init \
./manager/config/scenescape-init \
/usr/local/bin/
./manager/config/database-init \
./manager/config/scenescape-init \
/usr/local/bin/

HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD pgrep postgres || exit 1
Expand All @@ -176,20 +179,20 @@ RUN : \
; apt-get update \
; install -d -m 0755 /etc/apt/keyrings \
; apt-get install -y --no-install-recommends \
wget \
libpci-dev \
libnss3-tools \
software-properties-common \
unzip \
xserver-xephyr \
xvfb \
wget \
libpci-dev \
libnss3-tools \
software-properties-common \
unzip \
xserver-xephyr \
xvfb \
; wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null \
; echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null \
; echo -e ' \n\
Package: * \n\
Pin: origin packages.mozilla.org \n\
Pin-Priority: 1000 \n\
' | tee /etc/apt/preferences.d/mozilla \
Package: * \n\
Pin: origin packages.mozilla.org \n\
Pin-Priority: 1000 \n\
' | tee /etc/apt/preferences.d/mozilla \
; apt-get update && apt-get install -y --no-install-recommends firefox \
; rm -rf /var/lib/apt/lists/*

Expand Down
6 changes: 6 additions & 0 deletions manager/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ jslibraries: \
$(JSLIBDIR)/assets/axios.min.js.map \
$(JSLIBDIR)/assets/doxygen-awesome.css \
$(JSLIBDIR)/assets/jszip.min.js \
$(JSLIBDIR)/assets/reader.js \

$(JSLIBDIR)/assets/jquery-3.6.0.min.js:
URL=https://code.jquery.com && PKG=$$(basename $@) \
Expand Down Expand Up @@ -135,6 +136,11 @@ $(JSLIBDIR)/assets/glfx.min.js:
&& echo "$${URL}/$${PKG}" >> $(BUILD_DIR)/$(IMAGE)-downloaded-deps.txt \
&& curl -f $(CURL_FLAGS) --location --create-dirs --output $@ $${URL}/$${PKG}

$(JSLIBDIR)/assets/reader.js:
URL=https://raw.githubusercontent.com/bluenviron/mediamtx/refs/tags/v1.14.0/internal/servers/webrtc/reader.js \
&& echo https://raw.githubusercontent.com/bluenviron/mediamtx/refs/tags/v1.14.0/internal/servers/webrtc/reader.js >> $(BUILD_DIR)/$(IMAGE)-downloaded-deps.txt \
&& curl -f $(CURL_FLAGS) --location --create-dirs --output $@ https://raw.githubusercontent.com/bluenviron/mediamtx/refs/tags/v1.14.0/internal/servers/webrtc/reader.js

$(JSLIBDIR)/bootstrap-4.6.1-dist.zip:
VERSION=$$(echo $@ | sed -E -e 's/.*bootstrap-([0-9]+[.][0-9]+[.][0-9]+)-.*/\1/') \
URL=https://github.com/twbs/bootstrap/releases/download/v$${VERSION} \
Expand Down
2 changes: 1 addition & 1 deletion manager/config/000-default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ ServerTokens Prod
ServerSignature Off
TraceEnable Off

Header set Content-Security-Policy "frame-ancestors 'none'; form-action 'self'; script-src 'self' 'sha256-opencv' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src 'none';"
Header set Content-Security-Policy "frame-ancestors 'none'; form-action 'self'; script-src 'self' 'sha256-opencv' 'sha256-reader' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src 'self' https://10.123.233.203:8889; upgrade-insecure-requests;"
Header set Strict-Transport-Security "max-age=1024000; includeSubDomains"

2 changes: 1 addition & 1 deletion manager/src/django/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = os.getenv('DJANGO_DEBUG', 'False').lower() in ['true', '1', 't']
DEBUG = True

ALLOWED_HOSTS = ['*']
DEFAULT_CHARSET = "utf-8"
Expand Down
4 changes: 2 additions & 2 deletions manager/src/management/commands/waitfordb.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def handle(self, *args, **options):
log.info("Database ready")
break

except psycopg2.OperationalError:
log.error("Server not online")
except psycopg2.OperationalError as er:
log.error("Server not online", er)
time.sleep(2)

except Exception as ex:
Expand Down
3 changes: 2 additions & 1 deletion manager/src/static/js/sscape.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ async function checkBrokerConnections() {
$("#connect").on("click", function () {
console.log("Attempting to connect to " + broker.value);
var client = mqtt.connect(broker.value);
var webRTCClient = null
sessionStorage.setItem("connectToMqtt", true);

client.on("connect", function () {
Expand Down Expand Up @@ -259,7 +260,7 @@ async function checkBrokerConnections() {
.stop()
.show()
.css("opacity", 1)
.animate({ opacity: 0.6 }, 5000, function () {})
.animate({ opacity: 0.6 }, 5000, function () { })
.prevAll(".cam-offline")
.hide();
}
Expand Down
44 changes: 44 additions & 0 deletions manager/src/static/js/video.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// SPDX-FileCopyrightText: (C) 2024 - 2025 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

/**
* @file camcanvas.js
* @description This file defines the CamCanvas class for displaying video frames.
*/

"use strict";


function playVideo() {
const video = document.getElementById('whepVideo');
let defaultControls = false;
let reader = null;

const loadAttributesFromQuery = () => {
video.controls = false;
video.muted = true;
video.autoplay = true;
video.playsInline = true;
video.disablepictureinpicture = true;
};

window.addEventListener('load', () => {
loadAttributesFromQuery();

reader = new MediaMTXWebRTCReader({
url: new URL('whep', 'http://10.123.233.203:8889/cam'),
onError: (err) => {
console.log(err)
},
onTrack: (evt) => {
video.srcObject = evt.streams[0];
},
});
});

window.addEventListener('beforeunload', () => {
if (reader !== null) {
reader.close();
}
});
}
Loading
Loading