Flushing - How does it work ?

16 views
Skip to first unread message

Brendan Sleight

unread,
Jan 23, 2022, 6:03:42 AM1/23/22
to moonfire-nvr-users

HI All,

Q: How does flushing work - what triggers it ? Suspect an artiact of very cheap cameras
Q: How can I configure the flushing to make it not occur ?

I just set-up my system as documented.

I have previously set-up the system with with same Pi, just microSD card (no harddrive) and only one cameras. I set the flush_if_sec to be 60 and had nice recording.

With the set-up as PI, external HD and three cameras - I get the recording flushing quite often. I tried setting of 0 seconds, 15 seconds, 500 and 900, I still at some point get all previous recording 'flushed' and then only have a few minutes of recording history.

Best Regards,
Brendan

Neurodiversity: Please excuse spelling and grammatical errors, due to dyslexia.

Brendan Sleight

unread,
Jan 26, 2022, 1:48:28 PM1/26/22
to moonfire-nvr-users
More information

Any clue what triggers the deletion at 23:15:05.279 below ?


I20220124 23:12:25.673 main moonfire_nvr::cmds::run] Starting syncer for path /media/nvr/camera_01
I20220124 23:12:25.741 main moonfire_db::db] Flush 1 (why: synchronous deletion):
/media/nvr/camera_01: added 0B in 0 recordings (), deleted 255K 158B in 2 (4/2996, 3/3019), GCed 0 recordings ().
I20220124 23:12:25.843 main moonfire_db::db] Flush 2 (why: synchronous garbage collection):
/media/nvr/camera_01: added 0B in 0 recordings (), deleted 0B in 0 (), GCed 4 recordings (3/3019, 3/3018, 4/2996, 4/2995).
I20220124 23:12:25.844 main moonfire_nvr::cmds::run] Starting streamer for Shed To Back Door-main
I20220124 23:12:25.845 main moonfire_nvr::cmds::run] Starting streamer for Shed To Back Door-sub
I20220124 23:12:25.845 s-Shed To Back Door-main moonfire_nvr::streamer] Shed To Back Door-main: Opening input: rtsp://10.3.2.205:554/live/ch00_1
I20220124 23:12:25.846 s-Shed To Back Door-sub moonfire_nvr::streamer] Shed To Back Door-sub: Opening input: rtsp://10.3.2.205:554/
I20220124 23:12:25.859 main moonfire_nvr::cmds::run] Ready to serve HTTP requests
W20220124 23:12:26.048 s-Shed To Back Door-main moonfire_ffmpeg::udp] 0x29bc6b0: attempted to set receive buffer to size 393216 but it only ended up set as 360448
W20220124 23:12:26.049 s-Shed To Back Door-main moonfire_ffmpeg::udp] 0x29ccd40: attempted to set receive buffer to size 393216 but it only ended up set as 360448
W20220124 23:12:29.044 s-Shed To Back Door-main moonfire_base::clock] opening rtsp://10.3.2.205:554/live/ch00_1 took PT3.197965244S!
W20220124 23:12:29.189 s-Shed To Back Door-sub moonfire_base::clock] opening rtsp://10.3.2.205:554/ took PT3.341716652S!
I20220124 23:14:01.540 sync-/media/nvr/camera_01 moonfire_db::db] Flush 3 (why: 0 sec after start of 1 minute 27 seconds Shed To Back Door-main recording 3/3020):
/media/nvr/camera_01: added 517K 842B in 1 recordings (3/3020), deleted 0B in 0 (), GCed 0 recordings ().
I20220124 23:14:33.271 sync-/media/nvr/camera_01 moonfire_db::db] Flush 4 (why: 0 sec after start of 1 minute 58 seconds Shed To Back Door-sub recording 4/2997):
/media/nvr/camera_01: added 288K 487B in 1 recordings (4/2997), deleted 0B in 0 (), GCed 0 recordings ().
I20220124 23:15:05.279 sync-/media/nvr/camera_01 moonfire_db::db] Flush 5 (why: 0 sec after start of 1 minute 3 seconds Shed To Back Door-main recording 3/3021):
/media/nvr/camera_01: added 372K 366B in 1 recordings (3/3021), deleted 517K 842B in 1 (3/3020), GCed 0 recordings ().

Scott Lamb

unread,
Jan 26, 2022, 3:27:08 PM1/26/22
to Brendan Sleight, moonfire-nvr-users


On Wed, Jan 26, 2022 at 10:48 AM Brendan Sleight <b...@barwap.com> wrote:
More information

I'm glad you sent the follow-up. Your first message was rotting in my spam folder for some reason. :-(
 
Any clue what triggers the deletion at 23:15:05.279 below ?


I20220124 23:12:25.673 main moonfire_nvr::cmds::run] Starting syncer for path /media/nvr/camera_01
I20220124 23:12:25.741 main moonfire_db::db] Flush 1 (why: synchronous deletion):
/media/nvr/camera_01: added 0B in 0 recordings (), deleted 255K 158B in 2 (4/2996, 3/3019), GCed 0 recordings ().
I20220124 23:12:25.843 main moonfire_db::db] Flush 2 (why: synchronous garbage collection):
/media/nvr/camera_01: added 0B in 0 recordings (), deleted 0B in 0 (), GCed 4 recordings (3/3019, 3/3018, 4/2996, 4/2995).
I20220124 23:12:25.844 main moonfire_nvr::cmds::run] Starting streamer for Shed To Back Door-main
I20220124 23:12:25.845 main moonfire_nvr::cmds::run] Starting streamer for Shed To Back Door-sub
I20220124 23:12:25.845 s-Shed To Back Door-main moonfire_nvr::streamer] Shed To Back Door-main: Opening input: rtsp://10.3.2.205:554/live/ch00_1
I20220124 23:12:25.846 s-Shed To Back Door-sub moonfire_nvr::streamer] Shed To Back Door-sub: Opening input: rtsp://10.3.2.205:554/
I20220124 23:12:25.859 main moonfire_nvr::cmds::run] Ready to serve HTTP requests
W20220124 23:12:26.048 s-Shed To Back Door-main moonfire_ffmpeg::udp] 0x29bc6b0: attempted to set receive buffer to size 393216 but it only ended up set as 360448
W20220124 23:12:26.049 s-Shed To Back Door-main moonfire_ffmpeg::udp] 0x29ccd40: attempted to set receive buffer to size 393216 but it only ended up set as 360448
W20220124 23:12:29.044 s-Shed To Back Door-main moonfire_base::clock] opening rtsp://10.3.2.205:554/live/ch00_1 took PT3.197965244S!
W20220124 23:12:29.189 s-Shed To Back Door-sub moonfire_base::clock] opening rtsp://10.3.2.205:554/ took PT3.341716652S!
I20220124 23:14:01.540 sync-/media/nvr/camera_01 moonfire_db::db] Flush 3 (why: 0 sec after start of 1 minute 27 seconds Shed To Back Door-main recording 3/3020):
/media/nvr/camera_01: added 517K 842B in 1 recordings (3/3020), deleted 0B in 0 (), GCed 0 recordings ().
I20220124 23:14:33.271 sync-/media/nvr/camera_01 moonfire_db::db] Flush 4 (why: 0 sec after start of 1 minute 58 seconds Shed To Back Door-sub recording 4/2997):
/media/nvr/camera_01: added 288K 487B in 1 recordings (4/2997), deleted 0B in 0 (), GCed 0 recordings ().
I20220124 23:15:05.279 sync-/media/nvr/camera_01 moonfire_db::db] Flush 5 (why: 0 sec after start of 1 minute 3 seconds Shed To Back Door-main recording 3/3021):
/media/nvr/camera_01: added 372K 366B in 1 recordings (3/3021), deleted 517K 842B in 1 (3/3020), GCed 0 recordings ().

The "why" should be accurate. In this case, it suggests flush_if_sec is set to 0, so a flush will happen the moment a recording completes.
 

On Sunday, 23 January 2022 at 11:03:42 UTC Brendan Sleight wrote:

HI All,

Q: How does flushing work - what triggers it ? Suspect an artiact of very cheap cameras

If you have flush_if_sec set to 0, "very cheap cameras" may matter. Bad camera => more disconnects => more recordings => more flushes.

But once flush_if_sec exceeds the duration at which Moonfire NVR decides to divide a run into recordings on its own (that's 60 seconds mid-run, or 120 seconds for the first recording of a run), the cheapness of the camera shouldn't matter anymore.

Did you see the description in install.md? Quoting:
    • flush_if_sec should typically be 120 seconds. This causes the database to be flushed when the first instant of one of this stream's completed recordings is 2 minutes old. A "recording" is a segment of a video stream that is 60–120 seconds when first establishing the stream, about 60 seconds midstream, and shorter when an error or server shutdown terminates the stream. Thus, a value just below 60 will cause the database to be flushed once per minute per stream in the steady state. A value around 180 will cause the database to be once every 3 minutes per stream, or less frequently if other streams cause flushes first. Lower values cause less video to be lost on power loss. Higher values reduce wear on the SSD holding the SQLite database, particularly when you have many cameras and when you record both the "main" and "sub" streams of each camera.



Do those answer your questions? I'm happy to try rephrasing them if not.

 
Q: How can I configure the flushing to make it not occur ?

I just set-up my system as documented.

I have previously set-up the system with with same Pi, just microSD card (no harddrive) and only one cameras. I set the flush_if_sec to be 60 and had nice recording.

With the set-up as PI, external HD and three cameras - I get the recording flushing quite often. I tried setting of 0 seconds, 15 seconds, 500 and 900, I still at some point get all previous recording 'flushed' and then only have a few minutes of recording history.

Can you show me logs with the 500 or 900 case? I don't know why you'd get frequent flushing with those.

If the logs still say "0 sec after...", maybe we have a bug where flush_if_sec isn't making it correctly from the UI to the syncer code. This part of the schema changed relatively recently with 0.7.0 so that's possible. Now that I think about it, I've tested flush_if_sec works correctly on a database upgraded from the prior release, but maybe not that freshly setting it from the UI works...

My flush lines look like this:

Jan 26 12:23:18 nuc moonfire-nvr[1724343]: sync-/media/14tb/sample moonfire_db::db] Flush 30629 (why: 120 sec after start of 59 seconds driveway-main recording 5/2240608):
Jan 26 12:23:18 nuc moonfire-nvr[1724343]: /media/6tb/sample: added 129M 382K 578B in 9 recordings (4/2292485, 4/2292486, 7/1961149, 6/2311688, 1/2295730, 2/2309704, 12/1974692, 8/1972491, 10/1959258), deleted 120M 595K 494B in 13 (4/2255435, 7/1783567, 7/1783568, 7/1783569, 7/1783570, 7/1783571, 6/2258254, 1/2258906, 2/2273185, 12/1878360, 8/1678611, 8/1678612, 10/1717121), GCed 13 recordings (10/1717120, 8/1678609, 2/2273184, 7/1783565, 12/1878359, 8/1678610, 1/2258905, 7/1783566, 4/2255434, 7/1783564, 7/1783562, 7/1783563, 6/2258253).
Jan 26 12:23:18 nuc moonfire-nvr[1724343]: /media/14tb/sample: added 34M 1016K 169B in 5 recordings (5/2240608, 5/2240609, 3/2299157, 9/1962785, 11/1974264), deleted 33M 1007K 29B in 3 (5/2000123, 9/1670488, 11/1403369), GCed 2 recordings (11/1403368, 9/1670487).
 


Best Regards,
Brendan

Neurodiversity: Please excuse spelling and grammatical errors, due to dyslexia.

--
You received this message because you are subscribed to the Google Groups "moonfire-nvr-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moonfire-nvr-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/moonfire-nvr-users/2321fb96-dffb-4eda-9078-626c6ea8352fn%40googlegroups.com.


--

Brendan Sleight

unread,
Jan 26, 2022, 3:50:25 PM1/26/22
to Scott Lamb, moonfire-nvr-users
Thanks for the reply. Spam filtering obviously thinks I am a rogue :)

On Wed, 26 Jan 2022 at 20:27, Scott Lamb wrote:
>
> Can you show me logs with the 500 or 900 case? I don't know why you'd get frequent flushing with those.
Yes - just but I am part way through compiling moonfire based upon
moonfire-1c9a556 - see below.

> If the logs still say "0 sec after...", maybe we have a bug where flush_if_sec isn't making it correctly from the UI to the syncer code. This part of the schema changed relatively recently with 0.7.0 so that's possible. Now that I think about it, I've tested flush_if_sec works correctly on a database upgraded from the prior release, but maybe not that freshly setting it from the UI works...
I have an earlier version of moonfire on a different sd card. Where I
do not see the flush deletes. I was thinking I changed something
subtle on the set-up. But after removing log2ram and trying
everything, was getting the error on the latest install but not on the
'older' version.

I am currently compiling based upon a fresh install to see if I can
replicate the issue in moonfire-1c9a556.

I did see the Instal comments. I thinks thi si why I changes it in my
first install to zero. In the latest install with the flushing issue,
I tried 0, 60, 120, 500 and 900. I still get the deletes.

Let's see how the latest compile goes. I have around 40 + 15 + 15
minutes remaining.

Regards,
BMS

Brendan Sleight

unread,
Jan 26, 2022, 6:16:53 PM1/26/22
to Scott Lamb, moonfire-nvr-users
On Wed, 26 Jan 2022 at 20:27, Scott Lamb <sl...@slamb.org> wrote:
> If you have flush_if_sec set to 0, "very cheap cameras" may matter. Bad camera => more disconnects => more recordings => more flushes.
>
> But once flush_if_sec exceeds the duration at which Moonfire NVR decides to divide a run into recordings on its own (that's 60 seconds mid-run, or 120 seconds for the first recording of a run), the cheapness of the camera shouldn't matter anymore.
>
>>> With the set-up as PI, external HD and three cameras - I get the recording flushing quite often. I tried setting of 0 seconds, 15 seconds, 500 and 900, I still at some point get all previous recording 'flushed' and then only have a few minutes of recording history.
>
>
> Can you show me logs with the 500 or 900 case? I don't know why you'd get frequent flushing with those.
>

I am still getting deletes with 0, 60, 180. Such that after deletes >0
previous all previous recording are deleted. Annoying as I have an
old version on an SD card which works - I must be doing something
wrong.


0 Seconds

I20220126 22:19:15.772 main moonfire_nvr::cmds::run] Starting syncer
for path /home/pi/camera_001/
I20220126 22:19:15.848 main moonfire_db::db] Flush 1 (why: synchronous
deletion):
/home/pi/camera_001/: added 0B in 0 recordings (), deleted 326K 1007B
in 1 (1/0), GCed 0 recordings ().
I20220126 22:19:15.911 main moonfire_db::db] Flush 2 (why: synchronous
garbage collection):
/home/pi/camera_001/: added 0B in 0 recordings (), deleted 0B in 0 (),
GCed 1 recordings (1/0).
I20220126 22:19:15.911 main moonfire_nvr::cmds::run] Starting streamer
for Shed Door-main
I20220126 22:19:15.912 main moonfire_nvr::cmds::run] Starting streamer
for Shed Door-sub
I20220126 22:19:15.912 main moonfire_nvr::cmds::run] Ready to serve
HTTP requests
I20220126 22:19:15.912 s-Shed Door-main moonfire_nvr::streamer] Shed
Door-main: Opening input: rtsp://10.3.2.205:554/live/ch00_1
I20220126 22:19:15.912 s-Shed Door-sub moonfire_nvr::streamer] Shed
Door-sub: Opening input: rtsp://10.3.2.205:554/
W20220126 22:19:16.007 s-Shed Door-main moonfire_ffmpeg::udp]
0x17a1160: attempted to set receive buffer to size 393216 but it only
ended up set as 360448
W20220126 22:19:16.008 s-Shed Door-main moonfire_ffmpeg::udp]
0x17b18c0: attempted to set receive buffer to size 393216 but it only
ended up set as 360448
W20220126 22:19:18.943 s-Shed Door-main moonfire_base::clock] opening
rtsp://10.3.2.205:554/live/ch00_1 took PT3.030755778S!
W20220126 22:19:19.241 s-Shed Door-sub moonfire_base::clock] opening
rtsp://10.3.2.205:554/ took PT3.328386011S!
I20220126 22:20:36.011 sync-/home/pi/camera_001/ moonfire_db::db]
Flush 3 (why: 0 sec after start of 1 minute 11 seconds Shed Door-sub
recording 2/0):
/home/pi/camera_001/: added 170K 905B in 1 recordings (2/0), deleted
0B in 0 (), GCed 0 recordings ().
I20220126 22:21:07.238 sync-/home/pi/camera_001/ moonfire_db::db]
Flush 4 (why: 0 sec after start of 1 minute 43 seconds Shed Door-main
recording 1/1):
/home/pi/camera_001/: added 603K 122B in 1 recordings (1/1), deleted
0B in 0 (), GCed 0 recordings ().
I20220126 22:21:31.365 sync-/home/pi/camera_001/ moonfire_db::db]
Flush 5 (why: 0 sec after start of 55 seconds Shed Door-sub recording
2/1):
/home/pi/camera_001/: added 131K 988B in 1 recordings (2/1), deleted
170K 905B in 1 (2/0), GCed 0 recordings ().
I20220126 22:22:02.808 sync-/home/pi/camera_001/ moonfire_db::db]
Flush 6 (why: 0 sec after start of 55 seconds Shed Door-main recording
1/2):
/home/pi/camera_001/: added 332K 529B in 1 recordings (1/2), deleted
603K 122B in 1 (1/1), GCed 1 recordings (2/0).
^CI20220126 22:22:21.807 main moonfire_nvr::cmds::run] Received
SIGINT; shutting down gracefully. Send another SIGINT or SIGTERM to
shut down immediately.
I20220126 22:22:21.807 main moonfire_nvr::cmds::run] Shutting down
streamers and syncers.
I20220126 22:22:21.821 s-Shed Door-main moonfire_nvr::streamer] Shed
Door-main: shutting down
I20220126 22:22:21.822 s-Shed Door-sub moonfire_nvr::streamer] Shed
Door-sub: shutting down
I20220126 22:22:21.933 main moonfire_nvr::cmds::run] Waiting for HTTP
requests to finish.
I20220126 22:22:21.933 main moonfire_nvr::cmds::run] Waiting for
TEARDOWN requests to complete.
I20220126 22:22:21.933 main moonfire_nvr::cmds::run] Exiting.
I20220126 22:22:22.000 main moonfire_db::db] Flush 7 (why: drop)

60 seconds

I20220126 22:23:24.955 main moonfire_nvr::cmds::run] Starting syncer
for path /home/pi/camera_001/
I20220126 22:23:25.007 main moonfire_db::db] Flush 1 (why: synchronous
deletion):
/home/pi/camera_001/: added 0B in 0 recordings (), deleted 259K 695B
in 2 (1/3, 2/2), GCed 0 recordings ().
I20220126 22:23:25.086 main moonfire_db::db] Flush 2 (why: synchronous
garbage collection):
/home/pi/camera_001/: added 0B in 0 recordings (), deleted 0B in 0 (),
GCed 4 recordings (2/1, 2/2, 1/2, 1/3).
I20220126 22:23:25.087 main moonfire_nvr::cmds::run] Starting streamer
for Shed Door-main
I20220126 22:23:25.087 main moonfire_nvr::cmds::run] Starting streamer
for Shed Door-sub
I20220126 22:23:25.087 s-Shed Door-main moonfire_nvr::streamer] Shed
Door-main: Opening input: rtsp://10.3.2.205:554/live/ch00_1
I20220126 22:23:25.088 main moonfire_nvr::cmds::run] Ready to serve
HTTP requests
I20220126 22:23:25.088 s-Shed Door-sub moonfire_nvr::streamer] Shed
Door-sub: Opening input: rtsp://10.3.2.205:554/
W20220126 22:23:25.134 s-Shed Door-main moonfire_ffmpeg::udp]
0x1632830: attempted to set receive buffer to size 393216 but it only
ended up set as 360448
W20220126 22:23:25.135 s-Shed Door-main moonfire_ffmpeg::udp]
0x1642f90: attempted to set receive buffer to size 393216 but it only
ended up set as 360448
W20220126 22:23:28.176 s-Shed Door-main moonfire_base::clock] opening
rtsp://10.3.2.205:554/live/ch00_1 took PT3.088138384S!
W20220126 22:23:28.178 s-Shed Door-sub moonfire_base::clock] opening
rtsp://10.3.2.205:554/ took PT3.090056665S!
I20220126 22:25:08.739 sync-/home/pi/camera_001/ moonfire_db::db]
Flush 3 (why: 60 sec after start of 1 minute 35 seconds Shed Door-main
recording 1/4):
/home/pi/camera_001/: added 562K 874B in 1 recordings (1/4), deleted
0B in 0 (), GCed 0 recordings ().
I20220126 22:25:32.384 sync-/home/pi/camera_001/ moonfire_db::db]
Flush 4 (why: 60 sec after start of 1 minute 58 seconds Shed Door-sub
recording 2/3):
/home/pi/camera_001/: added 284K 44B in 1 recordings (2/3), deleted 0B
in 0 (), GCed 0 recordings ().
I20220126 22:26:08.507 sync-/home/pi/camera_001/ moonfire_db::db]
Flush 5 (why: 60 sec after start of 55 seconds Shed Door-main
recording 1/5):
/home/pi/camera_001/: added 336K 366B in 1 recordings (1/5), deleted
562K 874B in 1 (1/4), GCed 0 recordings ().
I20220126 22:26:35.879 sync-/home/pi/camera_001/ moonfire_db::db]
Flush 6 (why: 60 sec after start of 1 minute 3 seconds Shed Door-sub
recording 2/4):
/home/pi/camera_001/: added 153K 265B in 1 recordings (2/4), deleted
284K 44B in 1 (2/3), GCed 1 recordings (1/4).
I20220126 22:27:07.406 sync-/home/pi/camera_001/ moonfire_db::db]
Flush 7 (why: 60 sec after start of 1 minute 3 seconds Shed Door-main
recording 1/6):
/home/pi/camera_001/: added 364K 500B in 1 recordings (1/6), deleted
336K 366B in 1 (1/5), GCed 1 recordings (2/3).
^CI20220126 22:27:34.659 main moonfire_nvr::cmds::run] Received
SIGINT; shutting down gracefully. Send another SIGINT or SIGTERM to
shut down immediately.
I20220126 22:27:34.659 main moonfire_nvr::cmds::run] Shutting down
streamers and syncers.
I20220126 22:27:34.686 s-Shed Door-main moonfire_nvr::streamer] Shed
Door-main: shutting down
I20220126 22:27:34.736 s-Shed Door-sub moonfire_nvr::streamer] Shed
Door-sub: shutting down
I20220126 22:27:34.797 main moonfire_nvr::cmds::run] Waiting for HTTP
requests to finish.
I20220126 22:27:34.798 main moonfire_nvr::cmds::run] Waiting for
TEARDOWN requests to complete.
I20220126 22:27:34.798 main moonfire_nvr::cmds::run] Exiting.
I20220126 22:27:34.820 main moonfire_db::db] Flush 8 (why: drop):
/home/pi/camera_001/: added 315K 956B in 3 recordings (1/7, 2/5, 2/6),
deleted 517K 765B in 2 (1/6, 2/4), GCed 1 recordings (1/5)

180 seconds

I20220126 22:28:26.852 main moonfire_nvr::cmds::run] Starting streamer
for Shed Door-main
I20220126 22:28:26.852 main moonfire_nvr::cmds::run] Starting streamer
for Shed Door-sub
I20220126 22:28:26.853 main moonfire_nvr::cmds::run] Ready to serve
HTTP requests
I20220126 22:28:26.852 s-Shed Door-main moonfire_nvr::streamer] Shed
Door-main: Opening input: rtsp://10.3.2.205:554/live/ch00_1
I20220126 22:28:26.853 s-Shed Door-sub moonfire_nvr::streamer] Shed
Door-sub: Opening input: rtsp://10.3.2.205:554/
W20220126 22:28:26.892 s-Shed Door-main moonfire_ffmpeg::udp]
0x1a813f0: attempted to set receive buffer to size 393216 but it only
ended up set as 360448
W20220126 22:28:26.892 s-Shed Door-main moonfire_ffmpeg::udp]
0x1a91b50: attempted to set receive buffer to size 393216 but it only
ended up set as 360448
W20220126 22:28:29.659 s-Shed Door-main moonfire_base::clock] opening
rtsp://10.3.2.205:554/live/ch00_1 took PT2.806021555S!
W20220126 22:28:30.008 s-Shed Door-sub moonfire_base::clock] opening
rtsp://10.3.2.205:554/ took PT3.154150322S!
W20220126 22:30:19.005 s-Shed Door-sub moonfire_base::clock] getting
next packet took PT1.110821410S!
W20220126 22:30:19.006 s-Shed Door-main moonfire_base::clock] getting
next packet took PT1.157651289S!
I20220126 22:31:34.995 sync-/home/pi/camera_001/ moonfire_db::db]
Flush 3 (why: 180 sec after start of 1 minute 27 seconds Shed
Door-main recording 1/8):
/home/pi/camera_001/: added 1M 148K 752B in 3 recordings (1/8, 1/9,
2/7), deleted 0B in 0 (), GCed 0 recordings ().
I20220126 22:33:34.163 sync-/home/pi/camera_001/ moonfire_db::db]
Flush 4 (why: 180 sec after start of 1 minute 3 seconds Shed Door-sub
recording 2/8):
/home/pi/camera_001/: added 984K 160B in 4 recordings (1/10, 1/11,
2/8, 2/9), deleted 1M 148K 752B in 3 (1/8, 1/9, 2/7), GCed 0
recordings ().
^CI20220126 22:35:08.141 main moonfire_nvr::cmds::run] Received
SIGINT; shutting down gracefully. Send another SIGINT or SIGTERM to
shut down immediately.
I20220126 22:35:08.142 main moonfire_nvr::cmds::run] Shutting down
streamers and syncers.
I20220126 22:35:08.178 s-Shed Door-sub moonfire_nvr::streamer] Shed
Door-sub: shutting down
I20220126 22:35:08.179 s-Shed Door-main moonfire_nvr::streamer] Shed
Door-main: shutting down
I20220126 22:35:08.216 main moonfire_nvr::cmds::run] Waiting for HTTP
requests to finish.
I20220126 22:35:08.216 main moonfire_nvr::cmds::run] Waiting for
TEARDOWN requests to complete.
I20220126 22:35:08.217 main moonfire_nvr::cmds::run] Exiting.
I20220126 22:35:08.266 main moonfire_db::db] Flush 5 (why: drop):
/home/pi/camera_001/: added 1M 109K 777B in 6 recordings (1/12, 1/13,
1/14, 2/10, 2/11, 2/12), deleted 984K 160B in 4 (1/10, 1/11, 2/8,
2/9), GCed 3 recordings (2/7, 1/8, 1/9).

Brendan Sleight

unread,
Feb 3, 2022, 2:02:14 PM2/3/22
to moonfire-nvr-users
I tried a lots of thing. Then I even tried to reading the fine manual.

> 3. Assign disk space to your cameras back in "Directories and retention". Leave a little slack between the total limit and the filesystem capacity, even if you store nothing else on the disk. 1 GiB of slack per camera should be plenty. This is needed for a few reasons:
  • Up to max(120, flush_if_sec) seconds of video can be written before being counted toward the usage because the recording doesn't count until it's fully written,

So if i set-up init, then config, then set -up first the samples file directories, then the cameras - assign new cameras the sample file directories. I miss the step of Edit Retention for /file/path and it therefore has no space and the stream is no retained on every flush.

I will update pull request #190 with some screenshots.

Not telling you all the other things I tried :)  RTFM.

Regards,
Brendan





Scott Lamb

unread,
Mar 2, 2022, 1:36:09 PM3/2/22
to Brendan Sleight, moonfire-nvr-users
I'm glad you got it working. Brainstorming: what can we do to make this more obvious if you miss something in the manual?

We could remove the record checkbox from the camera config dialog, since it doesn't make sense to enable it without also setting retention in "Edit directories". Except I'm likely to switch it to a pull-down to "monitor mode" (#120), and then it would make sense without the directory. Probably silly to make this change now and undo it later. But we could expand the validity check here...

            if stream.record && (stream.url.is_empty() || stream.sample_file_dir_id.is_none()) {
                bail!(
                    "Can't record {} stream without RTSP URL and sample file directory",
                    type_.as_str()
                );
            }

...to also error out if you click "Edit" when "record" is checked but retention is 0. Would that help? Any other ideas?

I was confused in your earlier email when you said that one camera worked as intended with flushIfSec set to 0 and the other didn't. I guess I was focused on the frequency of flushing and missed the more obvious problem that one camera was actually keeping around the recordings and the other wasn't. Sorry about that.
 






--
You received this message because you are subscribed to the Google Groups "moonfire-nvr-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moonfire-nvr-us...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages