haven icon indicating copy to clipboard operation
haven copied to clipboard

in 0.2.0-beta4 video recording appears error-prone

Open deviantollam opened this issue 5 years ago • 10 comments

i've opted for the nightly builds on F-Droid. i'm now running 0.2.0.-alpha4 (117)

during testing, i've enabled video recording for a relatively short duration... i've tried 15 seconds and 30 seconds. when camera events are triggered now, the following result will happen:

  1. the device display says "RECORDING" in red
  2. the device creates a whole mess of JPG images that don't really show much
  3. the device seems to /try/ to record video files. but they are never 15 or 30 seconds or whatever i've configured
  4. the video files that get recorded tend to be about 2 or 3 seconds only, and similarly don't really show anything useful
  5. often, other video files are also saved, but they are broken/have no frames/etc

so as a monitoring tool, unfortunately this isn't really working for me now. arg.

deviantollam avatar Sep 25 '18 05:09 deviantollam

i'm also sad to report that the Camera Sensitivity settings are really hard to get right now, it seems.

i filmed a device where i was trying to get the settings right...

https://www.youtube.com/watch?v=Sx1oCZ3FCg4

...in the first segment of the video, the Camera Sensitivity value is set around "8500" (whatever that value means) and then at the 8 second mark you see the preview after the sensitivity has been adjusted to about "11000"

While the device can detect my finger appearing in the field of view... from this perspective it will not detect anyone opening the door and entering the room. I have to cross the room and make it all the way up to about 2' from the phone before it decides to record.

EDIT - it seems the camera sensitivity wasn't the problem. we've isolated that it's a "capture video" problem... turning that on causes much of the monitoring to break.

deviantollam avatar Sep 25 '18 19:09 deviantollam

ok... so maybe this isn't related to camera sensitivity... this may be related to when the screen is off. although i have successfully gotten Haven to detect camera events with the screen off (and capture video, send video to me, etc) in the past... something has happened now and it won't work anymore.

i'm going to uninstall 0.2.0-beta4, remove all settings, and try re-installing again. i'm going to troubleshoot the hell out of this today in an attempt to isolate what is preventing the app from doing any real monitoring and detection.

deviantollam avatar Sep 25 '18 20:09 deviantollam

ok, i've totally uninstalled and wiped. i've re-installed 0.2.0-beta4.

i've configured the camera sensitivity setting to something reasonable and then configured audio and movement to their highest settings i could (120 and 100, respectively) so i want to only focus on the camera.

i've set up Signal and run a test message. the test message reached me perfectly.

first i will do a series of tests with the screen on, then i'll see what's happening with the screen turned off.

deviantollam avatar Sep 25 '18 20:09 deviantollam

first test and result...

video monitoring: enabled android screen: left on detection: app reports that it detected log entry: created, says it captured two images and two videos contents of log: two JPGs worked, one MP4 (only 3 seconds long, despite setting configured for 30 seconds) and one broken MP4 that doesn't play notification: not sent to remote device (even though other notification tests work)

deviantollam avatar Sep 25 '18 20:09 deviantollam

second test and result...

video monitoring: disabled android screen: left on detection: app detected movement in front of camera log entry: created, says it captured 27 events. wow! contents of log: lots of JPG images. i did a burst of movement, then waited a few seconds, then more movement... and it took photos of all of that notification: yes! one Signal message came (with the very first image attached)

so that tells us that Video Monitoring is perhaps the key problem?

deviantollam avatar Sep 25 '18 20:09 deviantollam

third test and result...

video monitoring: disabled android screen: turned off and locked (during the delay window) detection: app detected movement in front of camera log entry: created, says 29 events contents of log: found a bug there were 29 JPG images, and the preview thumbnails all look different, but tapping to view the full size images will constantly and repeatedly only show the first image. no matter what thumbnail is tapped, only the first captured image is shown. using a file explorer in Android will allow viewing and proper opening of all the JPGs, however. notification: yes. one Signal message came (with the very first captured image attached)

so screen off versus screen on doesn't seem to be the problem.

deviantollam avatar Sep 25 '18 20:09 deviantollam

fourth test and result...

video monitoring: disabled android screen: turned off and locked (during the delay window) heartbeat: enabled detection: app detected movement in front of camera log entry: created, says 16 events (i didn't do as much movement this time) contents of log: found same bug there were 16 JPG images, and the preview thumbnails all look different, but tapping to view the full size images will constantly and repeatedly only show the first image that was captured. no matter what thumbnail is tapped, only the first captured image is shown. (i even tried making my initial tap upon an entry later in the list, no the first entry. still, it was the first image that was displayed) using a file explorer in Android will allow viewing and proper opening of all the JPGs, however. notification:

yes. one Signal message came (with the very first captured image attached) so screen off versus screen on doesn't seem to be the problem AND heartbeat being enabled doesn't seem to be the problem. it's all about video monitoring. that seems to break everything.

deviantollam avatar Sep 25 '18 20:09 deviantollam

for reference, my test device at this time is...

Nokia 3.1, model TA-1049 Android 8.0.0 (Kernel 3.18.60+)

deviantollam avatar Sep 25 '18 21:09 deviantollam

Changed some lines and had a smooth session, only works for devices tested < 21.

Seems that introducing the Camera 2 API in new branch holds same problems for old devices using the deprecated version; fails using the following:

  • getCameraFacing: Won’t return a proper value and defaults to null. Sensors on some LG and other devices don’t feedback the 1 or 0 it’s looking for.

  • getExternalStorage: Devices without removable storage are highly likely to crash.

  • When preview surface is killed off to enter main settings the camera is in a null state, selecting sensitivity will crash it.

  • The timer logic is broken, during active session will request new timer when exiting settings and countdown again while active. Exiting the app at this moment can cause a zombie/rouge alert experience for users.

  • The mkdir commands & file creation calls aren’t used properly, the result is a messy persistence layer causing DB, camera, alert and other errors/ unexpected behavior. Some use absPath some don’t.

  • Running sensors and events for ambient light in bg is a problem & when camera crashes these and only these events are logged, no alerts sent or otherwise.

None of the above are persistent issues on flagship and newer AOS, however that doesn’t cover half the Android handsets in circulation. Planning a sprint to patch some of this up after the fat-tire updates are pulled in. Cheers

lukeswitz avatar Oct 02 '18 11:10 lukeswitz

It could the Camera2 wrapper component I chose "com.asksira.android:cameraviewplus:0.9.5" doesn't do a good job with being backwards compat. There are others we can look at using instead.

Also, I am seriously considering a very different implementation for video. The current approach is just not cutting it.

Otherwise, the fat-tire updates have been merged!

n8fr8 avatar Oct 03 '18 20:10 n8fr8