ZoneMinder / zmNinja

High performance, cross platform ionic app for Home/Commerical Security Surveillance using ZoneMinder
http://zmninja.zoneminder.com
Other
1.01k stars 268 forks source link

Chromecast support #262

Open MichaelAronsen opened 8 years ago

MichaelAronsen commented 8 years ago

Platform & OS Version Android

What is the nature of your issue Enhancement

Details What are the chances of zmNinja growing chromecast support for montage and single camera views?

I'm loving the app already, but being able to cast my baby cam to a tv would make it even better.

Thanks!

pliablepixels commented 8 years ago

Hmm, I'd love to do that too - I'll look and see - last I checked chrome cast plugins were spotty in cordova but I'll check again. Don't expect it anytime soon, but if I find an easy way, it might land up soon :)

pliablepixels commented 8 years ago

Hmm https://github.com/ConnectSDK/Connect-SDK-Cordova-Plugin -- I'll check how that works, after I return from my brief vacation next week

jbraun27 commented 8 years ago

@pliablepixels do you use Videogular as the video player? I thought I read that in an FAQ. If so, they have a 3rd party plugin for Chromecast: https://github.com/benjipott/videogular-chromecast

pliablepixels commented 8 years ago

@jbraun27 - that's cool - I did some basic integration with https://github.com/ConnectSDK/Connect-SDK-Cordova-Plugin -- it seems easy to send a video or media file, but I can't quite see any APIs to export a screen - I guess I'll need to export screens for montage view (many pictures). Also live view involved refreshing the auth key every 5-6 mins. As of today, most of ZM is non video - only the experimental branch has video

MichaelAronsen commented 8 years ago

@pliablepixels for me at least, being able to cast a single live view monitor would cover ~90% of my use.

pliablepixels commented 8 years ago

@MichaelAronsen - I'll need a bit of education here. Hope you can help: a) Are you on Android? If so, does Android automatically provide chrome cast options in any system menu for all apps? b) Do you expect the feed to continue displaying on the TV even after you exit the app ?

MichaelAronsen commented 8 years ago

@pliablepixels I am on Android, yes

re A) There is the option to cast the whole screen and all audio from the phone, but this means that if the screen is turned off, the tv goes black - also changing apps or receiving calls disrupts the feed.

re B) Yes, the feed should continue, this is usually how chromecast works - it does not receive from the phone, but would rather receive the video/mjpeg stream directly from the zoneminder server, leaving the phone free to do other things. It may require some server side support though - I would be happy to try to help here if need be.

pliablepixels commented 8 years ago

Hmm thanks. Some researching is in order here. Here are the various ways ZM streams footage:

a) As of today and in the near future, even when h264 video branch is merged, live view is always streamed as a series of JPEG images over a TCP connection -- you display it via a usual <img src=""> tag and the image keeps changing (html's img tag takes care of that)

b) When it comes to montage live view, its multiple <img src> tags on one page, arranged

c) When it comes to event playback, it also uses the same logic as a) c.1) with the exception of h264-videobranch where it uses an mp4 file

c.1) is very easy to do, even if the app is not alive - just point it to the mp4 file and it will stream directly from the server.

a), b) and c) are more tricky - while its easy to send it the URL of the image, there is an auth key that is passed - something like img src="myzm/zm/cgi-bin/nph-zms?auth=xxxxxxxx". This xxxxx needs to be computed at the start of the stream and re-computed every few minutes (depending on PHP timeout) so the stream continues. So if the app exits, its possible the stream freezes after a while unless we have a means to re-compute the auth key. As of today, zmNinja runs a timer that recomputes every 5 minutes just to keep things simple.

MichaelAronsen commented 8 years ago

Ok, so for the auth key, there might need to be an option to create static keys or keys that live as long as the client keeps the connection open.

For viewing montage, the dashkiosk project might be interesting to look at, at least for inspiration: https://github.com/vincentbernat/dashkiosk

To use chromecast devices, you need to register a web app with google that the chromecast can connect to, I believe sending the is very simple using that.

MichaelAronsen commented 8 years ago

I'm going to set up dashkiosk, disable zoneminder auth and use basic auth via webserver.

I'm hoping this will allow me to create dashboards using zoneminder feeds, which require username and password, but does not time out.

This is just to test things out, for my girlfriend to use this feature, it would be much nicer to have it in ZMNinja rather than some NodeJS app :)

pliablepixels commented 8 years ago

Got the very basics working - live stream from one monitor from zmNinja (I'm on iOS) img_3164

MichaelAronsen commented 8 years ago

That's awesome, much work to port that to android?

pliablepixels commented 8 years ago

theoretically, it should work, but practically, it seems to be crashing on Android. I've added a note to an existing issue here https://github.com/ConnectSDK/Connect-SDK-Cordova-Plugin/issues/43 . I guess if it doesn't work, I'm going to have to park this for now

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

bradc87 commented 6 years ago

This would be amazing functionality, in combination with a few other supporting services like node red, you could have someones bedroom tv actually come on automatically if there was motion noticed outside at night

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

andye2801 commented 4 years ago

I appreciate this is a really old thread but what about https://github.com/jellyfin/cordova-plugin-chromecast? I would love to be able to cast a camera feed to my Google Nest Hub

ghost commented 3 years ago

Bump

PrplHaz4 commented 3 years ago

was also going to recommend the jellyfin chromecast cordova plugin - it is actively used and maintained

if you're using jellyfin you can add rtsp sources to live tv (in an .m3u) and i think cast that way, but it is definitely a bit more clunky