Hi All,
Looking for wisdom and suggestions in order to not re-invent the wheel. I am not entirely sure if Janus is the best shot for the need, but seems to be the best for the moment.
This is little project for my sister, so no $$$ or whatsoever involved.
The need:
- On demand live stream of audio & video via browser (single FHD webcam).
- During the time of no connection to webserver (99% of time), system should be in standby mode, meaning no processing/encoding, whatsoever.
Components:- HW - Raspberry Pi 4 + webcam or picam, either webcam mic or external USB
Vision/logic:- Janus starts/enables underlying processes on first connection,
- Janus stops/disables underlying processes on last user disconnection/lost connection to last user
- If Janus is not capable of tracking number of connected users, potentially a wrapper with JS and websockets would be needed for tracking of connected users, including heartbeat to discover disconnections.
Video stream - to be h264 FHD or HD. Webcam provides such capabilities and if not, Raspberry Pi 4 is capable of real-time GPU encoding.
Idea is that Janus would start GStreamer (
gst-launch-1.0) with appropriate pipeline for both audio and video.
Implementations found so far are based on UDP, where GStreamer blindly sends to UDP port and Janus would listen to it, but that is async and whilst acceptable if Janus is capable of starting GStreamer, not sure if that's the best idea (RTP based).
Since all is enclosed within same host, why not to just use UDP and keep GStreamer running all the time streaming to Janus? 99% or more of time it won't be used, therefore there is no reason to stream it blindly - why to burn energy for no need.
Janus can combine RTP audio and video stream, but risk is that these two might get desync, before reaching Janus even if processed by GStreamer within same pipe - is that possible or am I getting crazy here? How to enforce sync?
So the main question is how to set it up on "server" side to launch these processes on first connection (headless)?
Is there anything avalable, which I just need to connect like lego blocks?
All the survaillance solutions use the webcam feed in continuous manner and idea here is to use it only ad-hoc and avoid any continuous processing of video or audio streams, but to be able to stream it occasionally to multiple locations/users and shut down all processing once last user disconnects.
I'm complete noob to Janus, did quite a bit of reading, but feel like hamster in spinning wheel even if have systmes and net/sec/IT/linux experience.
Thanks in advance!