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…
Show HN: Critter.Camera – Browser based motion detection and image capture
21–28 of 28 posts
Re: Show HN: Critter.Camera – Browser based motion detection and image capture
#22Can't you recalibrate after every N frames, utilizing the fact that daytime lighting changes are only gradual?
Re: Show HN: Critter.Camera – Browser based motion detection and image capture
#23> 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?
Re: Show HN: Critter.Camera – Browser based motion detection and image capture
#24No 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?
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
#25Can 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
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
#26I 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
#27This 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?
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.