-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RTSP support #1295
Comments
I don't think that's quite correct. As I understand it the ONVIF adapter should support any ONVIF Profile S compatible camera, and all Profile S devices and clients must support RTSP. RTSP just provides the media transport, ONVIF provides a wrapper around the RTSP stream which does a lot of other things like device discovery, authentication, capability description, network configuration, PTZ controls etc. So I guess what you're really asking is whether an RTSP stream could be directly turned into a web thing, without using something like PSIA or ONVIF as a wrapper. I would guess that is possible, if users manually enter an rtsp:// URL it could be possible to create a Thing Description which exposes that video stream as a property (trans-coding the video as necessary) and offers some basic actions like play and pause. I guess the more important question is what are you trying to achieve? Is there a device you'd like to support which doesn't support ONVIF, but does expose an RTSP stream directly? |
As an outside example, @atirage managed to get the Raspberry Pi camera module running as a native web thing: https://github.com/atirage/picamera-webthing |
@benfrancis Interesting! The main goal is to have a privacy-focussed doorbell that could also double as a security camera, where the shutter and microphone can be trusted to be off. A physical camera shutter is essential to really offer peace of mind. Here's an early prototype: That one's based on an ESP32, so it's not very powerful. It only supports motion jpeg, altough RTSP theoretically supports both MJPEG and H26X. So it should work? A big advantage would be that it's cheap, safe to unplug, easy to create open source privacy-focused software for, and could be pre-programmed with a wifi password when flashed from Candle Manager (increasing transparency and trust). A more powerful option would be to base this on a Raspberry Pi Zero W. This is probably a good idea, since it might also make the return audio channel easier. Theoretically it could even just run the WebThings Gateway software again (a security camera running Voco might offer attractive convergence). It also has downsides though. Having a larger attack surface is one. A principle for Candle projects is to use the 'least viable hardware', so if an ESP32 can handle it, that would be the preference. It's all research in progress. I was thinking of creating an addon that receives a stream from the doorbell/cameras. It could store streams to the SD card or (ideally) an externally plugged in drive. This would be done on a rotation basis, or when a face/movement is detected. The addon should allow a user to look at and listen to this stream live, which might be done through the existing support, if it's easy to then quickly press an "unlock the door" button. In the case of the doorbell, it should ideally also return speech to a tiny speaker (bluetooth? ;-) ), or otherwise allow the user to trigger pre-recorded audio ("please wait a second", "not interested"). Does the current UI allow for streaming audio back from the Gateway UI to an endpoint? Privacy is once again the USP here so:
To complete the picture: the idea is to also have the Raspberry Pi create its own wifi accesspoint, so as to enforce that these devices are on a separate WiFi network from the home network. Especially because a camera doorbell literally hangs outside your house. It's important that if that device gets stolen, only that secondary wifi network is compromised (if its wifi password is extracted). In this doom scenario the user would have to generate a new network password and reflash the devices that were connecting to it so that they all have the new password again. Not having smart home devices communicate over the local network wherever possible is another one of Candle's principles. Sumarily put, the question this project asks is the same that all Candle experiments have asked: can we have some level of convenience (and security in this case) without blindly creating a surveillance culture in and around the home? // end of plan / pitch :-) |
If you're building your own device, why not make it a native web thing which exposes the
No I don't think so, but the proposed |
That's a good idea, thanks, I'll look into it. |
This looks interesting for a return audio channel: recording audio in JS. |
I'm getting an error that I'm not sure how to fix:
But shouldn't type be |
Setting it to a string of |
I've managed to get an image to show.
|
@flatsiedatsie, for the video streams you need to set up a Tornado handler to serve that URL, i.e. the stream is not a static resource like the snapshot. |
Thanks @atirage. Your work has actually been the inspiration for what I tried to do, after it was recommended to me earlier in this thread. I have used this example from |
I've tried to create a hybrid ffmpeg command based on the settings in the
This leads to the video element having some source, although something is clearly still wrong. FFMPEG seems to be chugging along:
The MPD file looks like this:
|
I've managed to get it working. Kind of.
I can see that stream in
The lowest delay I've been able to get is between 5 and 6 seconds (including telling Shaka player to buffer as little as possible).
|
It's working! Man this was a tough one. To answer one of my own questions for future reference:
No, but the limitation is that For me, the trick was to first stop using the addon route to create things, and instead use the
Phew |
Hello flatsiedatsie! I'm trying to create an RTSP Add-on to stream my camera in the gateway, i've tried the Onvif Add-on but it does not work for my camera (other Onvif client softwares do work for her). I just found this thread and it's looks like that ou made an add-on for RTSP stream, is this correct? I would like to use this add-on too, can you disponibilize it or tell how you made it, please? Thank you!
|
Hey Lucas, I was unable to make such an addon. I have created / am creating a security camera /smart doorbell which works with the gateway, as part of a privacy research project. It can switch between fast-but-no-sound mjpeg output or delayed-but-with-sound Dash output. The reason RTSP might not work as you hope is that the gateway has a built-in system where it wants to be able to forward the stream over it's 'tunnel' system, so you can watch your streams from outside of the house by logging into your gateway through that tunnel. RTSP could work around this (literally), but at the moment there is no built-in way to show the RTSP stream in the UI directly. |
Currently the Gateway has ONVIF support, but no RTSP support. What would it take to create an RTSP adapter? Are there things to look out for, or things to be aware of when potentially creating such an addon?
The text was updated successfully, but these errors were encountered: