Skip to content
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

[FEATURE] Camera Service #16

Closed
oliverrahner opened this issue May 25, 2018 · 170 comments
Closed

[FEATURE] Camera Service #16

oliverrahner opened this issue May 25, 2018 · 170 comments
Labels
enhancement 👍 New feature or request

Comments

@oliverrahner
Copy link
Collaborator

Based on #15, try to think of a generic way to add camera functionality to this project.

Todos would be:

  • add a new node type, because Cameras can't (or shouldn't) be hosted behind bridged accessories
  • find out which abstract functionality has to be provided by the node
@oliverrahner oliverrahner added the enhancement 👍 New feature or request label May 25, 2018
@Shaquu
Copy link
Member

Shaquu commented Mar 3, 2019

If anyone wonder about it.
I am planning to add Camera support in release 0.6

There will be a new node but I am not sure yet if this should be attachable to existing Services/Accesoriess or we should really create a new Accessory for Camera only.

@RaymondMouthaan
Copy link

@Shaquu, very nice to see some activity again on this repo 👍🏽

@TristanMW
Copy link

This addition would be great! - Thanks for the update!

@Shaquu Shaquu added this to the Release 0.7.0 milestone Mar 8, 2019
@Shaquu Shaquu added help wanted Used for setup help 0 - Backlog labels Mar 11, 2019
@Shaquu Shaquu changed the title implement an easy way to add camera controls/streaming [FEATURE] Camera Service Mar 11, 2019
@Shaquu
Copy link
Member

Shaquu commented Mar 11, 2019

Camera support will not come to 0.6.0
But 0.6.0 adds a lot required stuff for Camera implementation. I think that Camera will appear in 0.7.0.

@radokristof
Copy link
Contributor

I'm also considering adding some cameras to my home setup.
What is missing right now to implement Camera Service? As I know, it only supports RTSP streams?

@Shaquu
Copy link
Member

Shaquu commented Mar 12, 2019

Time :)
And I assume yes. Only RTSP is supported directly.

@RaymondMouthaan
Copy link

@Shaquu, you probably have seen this https://github.com/KhaosT/homebridge-camera-ffmpeg project, but in case you haven't, it might be useful to you.

@crxporter
Copy link
Member

The functional but not full featured one I’m using on a pi zero is https://github.com/moritzmhmk/homebridge-camera-rpi

@RaymondMouthaan
Copy link

@crxporter, I am not (yet) a camera user and I am very curious about how it looks on the Home App and or Eve App. Could you share some screenshots? 😃

@crxporter
Copy link
Member

This is how it looks right now - but the fun part is in the smart notifications. For example if I turn on homekit notifications for my motion detector when there is a camera and a door lock in the room then my "motion detected" alert is a view of the room with 2 buttons: one to turn on the room lights and one to unlock the door.

The 3rd screenshot is not from me but looks the same if I turn on the feature - however my buttons are "turn on lights" and "unlock door"

IMG_497E1DDB3968-1

IMG_0CB8CBC082D1-1

iu

@RaymondMouthaan
Copy link

RaymondMouthaan commented Mar 12, 2019

@crxporter, awesome! thanks for the screenshots and use-case 👍 , any recommendations for a good quality camera? I might consider buying one to play around :-)

@crxporter
Copy link
Member

I’m running on a pi zero w with the official pi camera! Works great I just stuck it on the wall with two sided tape.

@Shaquu

This comment has been minimized.

@matthub
Copy link

matthub commented Mar 12, 2019

IIRC VLC should be able to stream a file, see https://support.spinetix.com/wiki/Tutorial:Streaming_using_VLC HTH

@TristanMW
Copy link

TristanMW commented Mar 21, 2019

I have managed to find a way to get snapshots of my camera and display them on the node-red Dashboard (Made for Android Users haha)
Here is the flow:

Screenshot 2019-03-21 at 02 07 15
Screenshot 2019-03-21 at 02 07 48
(Snapshot is saved into the tmp folder which gets overwritten every 2 minutes)

I use the saved snapshots to send them to telegram when motion is detected while homekit alarm is active

I was wondering if maybe you can integrate the camera service to display the snapshots instead of trying to stream the camera feed on the favourites page in the homekit app?

Screenshot 2019-03-21 at 02 35 26

@crxporter
Copy link
Member

The HomeKit protocol supports both snapshots and streamed video. There are homebridge programs out there that are capable of using this. The iPhone/iPad/etc will show the most recent snapshot in while connecting to the stream.

Yours is the first example I’ve seen using pictures files in node red.

Hopefully the devs find a winning setup! (though my wallet has other opinions, I don’t really have the spare cash to outfit my house with cameras!)

@Shaquu
Copy link
Member

Shaquu commented Apr 2, 2019

Prototype: https://i.imgur.com/rtDI1qF.mp4 (swipe to the bottom if video is outside of screen bounds).
@crxporter you said that you are using api currently? Can you share your configuration? (those for stream for example -re etc. my current is -rtsp_transport tcp -i rtsp://192.168.0.227:8554/unicast)

@crxporter
Copy link
Member

I'm running this

@RaymondMouthaan
Copy link

@crxporter, no issues like this?

@crxporter
Copy link
Member

crxporter commented Apr 3, 2019

@RaymondMouthaan :

Just tested with varying results:
Works on iPhone XS with newest release software (12.2)
Works on MacBook running newest release (10.14.4)
Does not work (I have the snapshot-only issue) on iPad running iOS beta 12.2

I'm updating the beta to the release version now, I don't use the iPad much... I'll update here in a few minutes.

Update complete - iPad still won't pull up live video.

@radokristof
Copy link
Contributor

@Shaquu could this feature be merged to master soon?

@Shaquu
Copy link
Member

Shaquu commented Oct 8, 2019

@radokristof if you test current dev state then I can merge :)
Calling @NRCHKB/test @crxporter

@radokristof
Copy link
Contributor

@Shaquu it works the same for me :)

@Shaquu
Copy link
Member

Shaquu commented Oct 8, 2019

Have a look at changelog and last commits.
I have removed some boundaries.
I am scared if I didn't brake something with it.

@radokristof
Copy link
Contributor

@Shaquu I saw it and tried it now with the updated branch :) I just only did a quick test but I was able to add new bridge, devices appered in that bridge and was able to interact with them...

@Shaquu
Copy link
Member

Shaquu commented Oct 8, 2019 via email

@radokristof
Copy link
Contributor

For sure!

@crxporter
Copy link
Member

crxporter commented Oct 10, 2019

I haven't touched my dev branch camera pi in months. Also haven't had camera issues.

Running dev branch with a built-in camera on a pi zero w.

I had big dreams to test more cameras but they are instead all in a kitchen cabinet. Comments here

Edit: are there recent changes to dev? If so I will update eventually but don't have time this weekend.

@Shaquu
Copy link
Member

Shaquu commented Oct 11, 2019

@crxporter they are changes on the dev but no new features.
I have removed write/read boundaries from characteristics.

@ptath
Copy link

ptath commented Oct 12, 2019

I have 8 cameras (NVR), all works fine about a month or so, no problems at all. It's time of 0.7 =)

@Shaquu
Copy link
Member

Shaquu commented Oct 12, 2019

@ptath but current dev 0.6.2 changed a little :) I found one bug myself yesterday.
So it would be good if you download a new code and play a little with it.

@Shaquu
Copy link
Member

Shaquu commented Oct 12, 2019

For example #129 is working now with Remote Key

@Shaquu
Copy link
Member

Shaquu commented Oct 12, 2019

Merged to master as version 0.7.0
Enjoy! I am closing this issue.
If you have further questions then please comment or open new one.

  • I am looking for someone to help with writing wiki page for Camera Service and updating README regarding Camera, I will be very grateful

@Shaquu Shaquu closed this as completed Oct 12, 2019
@radokristof
Copy link
Contributor

I'm having the same issue: FFmpeg exited with code 1. Previously I have tested it on an x86 PC, now on my RPi, it doesn't work. I have read somewhere that this is might be related to some RPi (kernel) issue...

@Shaquu
Copy link
Member

Shaquu commented Oct 13, 2019

It's definitely about RPi as code base didn't change. Try to run ffmpeg in comandline outside of nrchkb/node-red and see if it's true or it works good and nrchkb is bad here.

@radokristof
Copy link
Contributor

Did you have an RPi to test it?

If I run from the command line it seems to work properly. This problem pops up in homebridge forums as well.

@radokristof
Copy link
Contributor

@crxporter are you running Node-Red on an RPi? Could you give me some example how it works for you? FFmpeg version, etc...

@Shaquu
Copy link
Member

Shaquu commented Oct 13, 2019

I connected camera to rpi0 and was running node-red on it. It worked.
Somewhere there are comments with my config.

@radokristof
Copy link
Contributor

Ok got it working, there were 2 things which were wrong for me:

  • I havent passed the switches (-re -i) for the source, noob mistake
  • RPi 3B+ seems to be not enough to handle 2 cameras + openHAB + all my other things smoothly, so I had to wait around 20 secs for the first frames to appear.

@Shaquu
Copy link
Member

Shaquu commented Oct 13, 2019

So it works :)

@ptath
Copy link

ptath commented Oct 13, 2019

  • RPi 3B+ seems to be not enough to handle 2 cameras + openHAB + all my other things smoothly, so I had to wait around 20 secs for the first frames to appear.

First of all u should understand your camera output. I have really old semi-analog NVR which perfectly send h.264 stream at 720p so vcodec copy works brilliant, 3-5% cpu usage

@Shaquu
Copy link
Member

Shaquu commented Oct 13, 2019

@ptath you are right, people would like to have a config wizard and everything made automatically but we have a field where you have to type your command which can be difficult for some people to find out what is right.

@Shaquu Shaquu reopened this Oct 13, 2019
@crxporter
Copy link
Member

@crxporter are you running Node-Red on an RPi? Could you give me some example how it works for you? FFmpeg version, etc...

Looks like I am too slow - did you get things figured out @radokristof ? Let me know if you want more details of my setup. Pi zero w running built in camera.

@radokristof
Copy link
Contributor

@crxporter Thanks, yes I was able to set it up :) My actual indoor cameras haven't arrived yet, so I just tested with an rtsp stream from my PC, but it worked. When my actual cameras arrive, I will share more on this.

@Shaquu
Copy link
Member

Shaquu commented Oct 15, 2019

There are improvements in dev branch (acquired from homebridge-camera-ffmpeg)
Added validation for videoFilter (check if it is not none).
Added interface name field for better compatibility.

@Shaquu
Copy link
Member

Shaquu commented Oct 20, 2019

As feature landed on master a while ago I am closing this Issue.
If you have a problem then file a bug please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 👍 New feature or request
Projects
None yet
Development

No branches or pull requests