Remove camera-ustreamer as it isn't ready for use

This commit is contained in:
Fredrik Baberg 2024-02-04 17:48:13 +01:00
parent 0f5cdd3f5e
commit f35b265770
11 changed files with 0 additions and 305 deletions

View File

@ -1,3 +0,0 @@
# Documentation
@TODO

View File

@ -1,96 +0,0 @@
ARG BUILD_FROM="ghcr.io/home-assistant/amd64-base"
ARG JANUS_GATEWAY_VERSION="1.1.3"
ARG USTREAMER_VERSION="5.38"
FROM ${BUILD_FROM} AS builder
ARG JANUS_GATEWAY_VERSION
ARG USTREAMER_VERSION
ENV LANG C.UTF-8
# Janus
RUN apk add -U --virtual .build-deps-janus \
build-base \
autoconf \
automake \
libtool \
libconfig-dev \
glib-dev \
libnice-dev \
jansson-dev \
openssl-dev \
zlib-dev \
libsrtp-dev \
curl-dev \
libogg-dev \
libwebsockets-dev \
libusrsctp-dev
RUN wget -qO- https://github.com/meetecho/janus-gateway/archive/v${JANUS_GATEWAY_VERSION}.tar.gz | tar xz -C /tmp
WORKDIR /tmp/janus-gateway-${JANUS_GATEWAY_VERSION}
RUN sh autogen.sh
RUN ./configure --prefix=/opt/janus
RUN make
RUN make install
RUN make configs
# Ustreamer
RUN apk add -U --virtual .build-deps-ustreamer \
sed \
build-base \
libevent-dev \
libbsd-dev \
libjpeg-turbo-dev \
musl-dev \
alsa-lib-dev \
speexdsp-dev \
opus-dev \
glib-dev \
jansson-dev
RUN wget -qO- https://github.com/pikvm/ustreamer/archive/v${USTREAMER_VERSION}.tar.gz | tar xz -C /tmp
WORKDIR /tmp/ustreamer-${USTREAMER_VERSION}
RUN ln -s /opt/janus/include/janus /usr/include/janus
RUN sed --in-place --expression 's|^#include "refcount.h"$|#include "../refcount.h"|g' /usr/include/janus/plugins/plugin.h
RUN make WITH_PTHREAD_NP=0 WITH_JANUS=1
RUN make install
RUN mv janus/libjanus_ustreamer.so /opt/janus/lib/janus/plugins/libjanus_ustreamer.so
FROM ${BUILD_FROM} AS final
ENV LANG C.UTF-8
COPY --from=builder /opt/janus /opt/janus
COPY --from=builder /usr/local/bin/ustreamer /usr/local/bin/ustreamer
RUN apk add -U \
alsa-lib \
curl \
glib \
glib \
jansson \
jansson \
libbsd \
libconfig \
libevent \
libjpeg-turbo \
libnice \
libogg \
libsrtp \
libtool \
libusrsctp \
libwebsockets \
musl \
openssl \
opus \
speexdsp \
zlib \
caddy \
vim \
screen
COPY rootfs/ /
RUN cp /opt/janus/share/janus/javascript/janus.js /server
WORKDIR /
# Make files executable
RUN chmod +x /etc/cont-init.d/*.sh
RUN chmod +x /etc/services.d/*/*

View File

@ -1,7 +0,0 @@
# ustreamer
**Work in progress!**
Provides camera stream through `ustreamer`, to be used by e.g. OctoPrint addon.
Instructions are provided in the tab "Docs".

View File

@ -1,28 +0,0 @@
name: "Camera-ustreamer"
version: "2023.3.0-rc1"
slug: "camera-ustreamer"
description: "Camera streaming addon for Home Assistant, based on ustreamer."
url: "https://github.com/fredrikbaberg/ha-3dprinter-addons/tree/main/camera-ustreamer"
ingress: true
ingress_stream: true
panel_icon: mdi:camera
panel_title: ustreamer
arch:
- armv7
- amd64
- armhf
- aarch64
- i386
stage: experimental
init: false
video: true
usb: true
ports:
80/tcp: null
ports_description:
80/tcp: Web-based interface (Not required for Ingress)
# options:
# mjpg_input: "input_uvc.so -n"
# schema:
# mjpg_input: "str"
image: ghcr.io/fredrikbaberg/ha-addon-camera-ustreamer-{arch}

View File

@ -1,19 +0,0 @@
# Ingress
:8099 {
# @blocked not remote_ip 172.30.32.2
# respond @blocked "This is only for access through Ingress" 403
handle_path /janus/* {
reverse_proxy localhost:8188 # Janus API
}
reverse_proxy 127.0.0.1:8080 # ustreamer
}
# External access
:80 {
# root * /opt/janus/share/janus/demos
root * /server
handle_path /janus/* {
reverse_proxy localhost:8188 # Janus API
}
file_server # Janus demo
}

View File

@ -1,22 +0,0 @@
# #!/usr/bin/with-contenv bashio
# # ==============================================================================
# # Add-on: aiortc
# # Configures NGINX for use with aiortc
# # ==============================================================================
# # Generate Ingress configuration
# bashio::var.json \
# interface "$(bashio::addon.ip_address)" \
# port "^$(bashio::addon.ingress_port)" \
# | tempio \
# -template /etc/nginx/templates/ingress.gtpl \
# -out /etc/nginx/servers/ingress.conf
# # Generate direct access configuration, if enabled.
# if bashio::var.has_value "$(bashio::addon.port 80)"; then
# bashio::var.json \
# port "^$(bashio::addon.port 80)" \
# | tempio \
# -template /etc/nginx/templates/direct.gtpl \
# -out /etc/nginx/servers/direct.conf
# fi

View File

@ -1,9 +0,0 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Add-on: camera-ustreamer
# Runs janus
# ==============================================================================
bashio::log.info "Starting janus.."
exec /opt/janus/bin/janus --configs-folder /opt/janus/etc/janus/ --plugins-folder /opt/janus/lib/janus/plugins/

View File

@ -1,8 +0,0 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Add-on: camera-ustreamer
# Runs the proxy daemon
# ==============================================================================
bashio::log.info "Starting proxy..."
exec caddy run -config /etc/caddy/Caddyfile

View File

@ -1,10 +0,0 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Add-on: mjpg-streamer
# Runs mjpg-streamer
# ==============================================================================
bashio::log.info "Starting mjpg-streamer.."
# mjpg_streamer -i "$(bashio::config 'mjpg_input')" -o "output_http.so -w /www_mjpg -p 80"
exec ustreamer --host=127.0.0.1 --h264-sink demo::ustreamer::h264 --h264-sink-mode 660 --h264-sink-rm

View File

@ -1,3 +0,0 @@
memsink: {
object = "demo::ustreamer::h264"
}

View File

@ -1,100 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>µStreamer H.264 demo</title>
<script src="https://webrtc.github.io/adapter/adapter-8.1.0.js"></script>
<!-- janus.js is the JavaScript client library of Janus, as specified above in
the prerequisites section of the client setup. You might need to change
the `src` path, depending on where you serve this file from. -->
<script src="janus.js"></script>
<style>
video {
height: 100%;
width: 100%;
object-fit: contain;
}
</style>
</head>
<body>
<video id="webrtc-output" autoplay playsinline muted></video>
<script type="text/javascript">
// Initialize Janus library.
Janus.init({
// Turn on debug logs in the browser console.
debug: true,
// Configure Janus to use standard browser APIs internally.
dependencies: Janus.useDefaultDependencies(),
});
// Establish a WebSockets connection to the server.
const janus = new Janus({
// Specify the URL of the Janus servers WebSockets endpoint.
server: `ws://${window.location.hostname}/janus/`,
// Callback function if the client connects successfully.
success: attachUStreamerPlugin,
// Callback function if the client fails to connect.
error: console.error,
});
let uStreamerPluginHandle = null;
function attachUStreamerPlugin() {
// Instruct the server to attach the µStreamer Janus plugin.
janus.attach({
// Qualifier of the plugin.
plugin: "janus.plugin.ustreamer",
// Callback function, for when the server attached the plugin
// successfully.
success: function (pluginHandle) {
uStreamerPluginHandle = pluginHandle;
// Instruct the µStreamer Janus plugin to initiate streaming.
uStreamerPluginHandle.send({ message: { request: "watch", params: {audio: true} } });
},
// Callback function if the server fails to attach the plugin.
error: console.error,
// Callback function for processing messages from the Janus server.
onmessage: function (msg, jsepOffer) {
// If there is a JSEP offer, respond to it. This starts the WebRTC
// connection.
if (jsepOffer) {
uStreamerPluginHandle.createAnswer({
jsep: jsepOffer,
// Prevent the client from sending audio and video, as this would
// trigger a permission dialog in the browser.
media: { audioSend: false, videoSend: false },
success: function (jsepAnswer) {
uStreamerPluginHandle.send({
message: { request: "start" },
jsep: jsepAnswer,
});
},
error: console.error,
});
}
},
// Callback function, for when a media stream arrives.
onremotetrack: function (mediaStreamTrack, mediaId, isAdded) {
if (isAdded) {
// Attach the received media track to the video element. Cloning the
// mediaStreamTrack creates a new object with a distinct, globally
// unique stream identifier.
const videoElement = document.getElementById("webrtc-output");
if (videoElement.srcObject === null) {
videoElement.srcObject = new MediaStream();
}
videoElement.srcObject.addTrack(mediaStreamTrack.clone());
}
},
});
}
</script>
</body>
</html>