Live data from Hacker News

Show HN: Critter.Camera – Browser based motion detection and image capture

critter.camera

21–28 of 28 posts

Re: Show HN: Critter.Camera – Browser based motion detection and image capture

#21
post #4

This is cool! Would be ever cooler if it could record a video clip rather than just images. You wouldn't have enough space in localStorage/IndexedDB, but you can use File System Access[0] (currently available in Chrome and Edge, strong chance of making it into Firefox and Safari in the next couple of years) which allows the user to select a folder which the clips can be saved into. [0] https://web.dev/file-system-acc…

Or perhaps CockroachDB. I’ll let myself out.

Re: Show HN: Critter.Camera – Browser based motion detection and image capture

#23
post #22

> During the day curtains and blinds should be closed to maintain the same level of lighting Can't you recalibrate after every N frames, utilizing the fact that daytime lighting changes are only gradual?

On a clear day this would definitely help however where I live in the UK there is frequent cloud cover. As the sun passes in and out of the clouds the light levels end up changing a surprising amount, causing frequent exposure flashes on the camera which essentially voids the calibration. In trying to achieve very high sensitivity I could not really make any kind of rolling calibration work sadly

Re: Show HN: Critter.Camera – Browser based motion detection and image capture

#24
post #15

No camera is recognized in any iOS browser other than Safari. Is it something that can be fixed by you, or is it up to Apple?

Good question, I would say neither, this responsibility is for the browser and native apps you use which display web content (e.g. Chrome, Firefox, Facebook, etc). Not apple or the web app developer. At most OP should include https://www.npmjs.com/package/webrtc-adapter as part of their polyfills to aid cross-browser support/cater for WebRTC nuances.

WebRTC has been in iOS Safari for quite a while. However, all other apps and browsers were limited to what was in offer within WKWebView. From iOS 14.3 beta 1 onwards WKWebView gained getUserMedia/WebRTC features. It is now up to the browser and apps you use to make sure they have implemented their web views correctly and allow the correct permissions for WebRTC to work.

https://stackoverflow.com/questions/48775154/notreadableerro... https://bugs.webkit.org/show_bug.cgi?id=208667 https://bugs.chromium.org/p/chromium/issues/detail?id=752458

Re: Show HN: Critter.Camera – Browser based motion detection and image capture

#25
post #9
post #5

Can I switch witch camera it uses?

It will use whichever camera the browser has configured as it's default. You may be able to change this in your browser settings

Firstly great app, I enjoyed using this on my baby daughter crawling around the living room! Keep up the good work :)

If you were to implement a camera picker, take a gander at: https://webrtc.github.io/samples/src/content/devices/input-o...

iOS and Android don't have the same camera picker like Chrome on Windows 10, even then it is difficult to always override. I would recommend using enumerateDevices to allow you to pass the deviceId when firing getUserMedia. Not a lot of work. Implemented this a few times for cross-browser WebRTC experiences. A pro-tip is use getUserMedia with audio and video constraints set to true. This forces the permissions pop up to appear. You can kill the feed once the user has accepted the permissions, then ask them what device they want to use, and then fire getUserMedia with the correct deviceId. This is a [nice?] hack as some browsers don't allow you to use enumeratedDevices until after getUserMedia has asked you for the permissions. e.g. Safari...

https://developer.mozilla.org/en-US/docs/Web/API/MediaDevice...

Re: Show HN: Critter.Camera – Browser based motion detection and image capture

#26
I also tackled the problem of moving-window brightness calibration in a related (but more constrained) problem --- tracking water fleas moving in a tank of water where an overhead light might periodically turn on and wash out the picture.

I essentially subtracted the current frame from the max across a moving window.

I'd be interested to chat about it if you like, my email is in my profile. The code is at https://github.com/nuchi/multi_object_tracking

Re: Show HN: Critter.Camera – Browser based motion detection and image capture

#27
post #3

This takes me back to the time when I wanted to determine which of my two cats is the one who makes the first move in their daily game of shess (it's like chess, but both the colours are black/brown and you don't move pieces - you just place them) in the bathroom. I hooked a webcam to an old netbook and downloaded an app which would take a picture whenever it detected motion. What I didn't take into account was the m…

Have you found out which cat was it in the end?

Nope, but I discovered that the older one liked to drink water from the bathtub, so there's that.

He's in kitty heaven now, but the younger one proved to still be an avid shess player when my SO had to take him along with her while she was working seasonally as a hotel receptionist. He found a worthy opponent there, so it might have been him from the start.

Post reply on HN