Commit Graph

5 Commits

Author SHA1 Message Date
Scott Lamb
713d7863de Improve warning message on open failure.
Before:

W0430 08:26:53.958887 41576 moonfire-nvr.cc:123]
driveway: Output error; sleeping before retrying: open
031e423c-2a0c-4450-b6cc-8af629606a90: Permission denied

After:

W0430 08:50:06.315666 43514 moonfire-nvr.cc:123]
driveway: Output error; sleeping before retrying: open
98592dfa-4ab4-427a-8ad0-033325f0f0b3 (within dir /home/slamb/moonfire/sample):
Permission denied
2016-04-30 08:51:58 -07:00
Scott Lamb
40cd983355 Web interface to the new SQLite schema.
This is almost certain to have performance problems with large databases,
but it's a useful starting point.

No tests yet. It shouldn't be too hard to add some for moonfire-db.h, but
I'm impatient to fake up enough data to check on the performance and see
what needs to change there first.
2016-01-16 22:54:16 -08:00
Scott Lamb
84406a8123 Add a fast path to Mp4SampleTablePieces::Init.
This avoids iteration through the video index for the "interior" recordings of
a virtual file. This takes generating the size of a ~8-hour / 15 fps file from
about 60 ms to about 10 ms. I expect better savings on a Raspberry Pi 2, for
longer records, and for higher frame rates. The total time here can be
significant; one one ~day-long recording on the Pi, it was several seconds.
I'm optimistic this will help with that.

It'd also be possible to optimize DecodeVar32 (perhaps by unrolling the loop)
but better to remove a call than to optimize one.

To add the fast path, we need a new field "video_sync_samples" in the
recording table to calculate the length of the stss table. Storage cost should
be minimal; I think typically two bytes in SQLite's record format (serial type
1, value < 128), described here: <https://www.sqlite.org/fileformat2.html>.
2016-01-14 15:41:45 -08:00
Scott Lamb
48d0473a4c Small helper for writing sample files safely.
Handles partial writes + checksumming.
2016-01-09 17:16:55 -08:00
Scott Lamb
60988f0646 Add sample index codec; fix schema doc. 2016-01-05 11:01:36 -08:00