Record X seconds before motion and Y seconds after...

dan2112

Young grasshopper
May 10, 2019
47
23
California
Tried to find this, but search in the help and the forum didn't yield anything useful.

Is it possible to configure BI to clip a number of seconds before the motion event. For example say 30 sec before and 10 secs after. The thought being by the time motion trips it may be just a little late. So clipping before the event would help get the "context" of the situation. I have my cameras set to continuous recording so clipping before the event is no problem there, but would be really nice would be able to just record on event and give time before and after the event so that I could turn off continuous recording and conserve disk space.

The solution is relatively easy - create a continuous loop recording of whatever the pre delay is (+the GOP interval of course - have to start on an I-Frame) and if motion happens mark the recording time before the event as part of the clip to be recorded plus any time afterwards.

Is this possible in BI?
Dan
 
  • Like
Reactions: djernie
Got a chance to try this and I am only seeing the event recording itself and no "pre/post" video. I set the pre-trigger and break-time to 10 sec hit save let the camera do it's thing (colorbars) waited for bit then walked in front of the camera. I only got the event starting when I triggered and it ended when I was out for frame. - What did I miss?
Sorry - noob questions.
 
Got a chance to try this and I am only seeing the event recording itself and no "pre/post" video. I set the pre-trigger and break-time to 10 sec hit save let the camera do it's thing (colorbars) waited for bit then walked in front of the camera. I only got the event starting when I triggered and it ended when I was out for frame. - What did I miss?
Sorry - noob questions.
What is your iFrame interval setting? Blue Iris when using directed this can only begin Recording on a new frame if you have a long iFrame interval or are using a smart codec You will have this problem
 
What is your iFrame interval setting? Blue Iris when using directed this can only begin Recording on a new frame if you have a long iFrame interval or are using a smart codec You will have this problem

My I-Frame on the Camera is 10sec (that is the min I can set it it's a IPC-HDW544T-ZE from Andy) and I am using H265 direct to disk and Smart Codec is off on the camera UI. I upped the pre-trigger to 30 and the break to 30 to cover 3 I-Frames and I will try again.
 
My I-Frame on the Camera is 10sec (that is the min I can set it it's a IPC-HDW544T-ZE from Andy) and I am using H265 direct to disk and Smart Codec is off on the camera UI. I upped the pre-trigger to 30 and the break to 30 to cover 3 I-Frames and I will try again.
I frame interval of 10 does not mean 10 seconds.
 
See mine below. Set you I-frame to the same value as your frame rate.

1599086919660.png
 
  • Like
Reactions: djernie
I am still having difficulty getting the "Pre-Trigger" to work. I have it set to 10 seconds with an I-Frame of 1 second. What is strange is I would think there would be disk activity if the pre-trigger was active since it needs to clip ahead of the trigger, but I don't see anything.

There has to be something I am missing or did in the wrong order. Love the software just need a wee bit of help :-)

Here's what I did:
* After configuring the IP Address I let BI autodetect the camera. That worked and it found created it as Generic/ONVIF

CameraConfig.png

* Configured camera UI and adjusted bitrate and I-Frame and confirm it shows up in the "General Tile" for BI:

GeneralTile.png

* Configured the recording to pre-trigger and break time to be 10 secs:

RecordTile.png

Hit OK twice and got the color bars as the camera reloaded and waited for motion to happen.

When it did the recording started at the trigger time and lasted 10 sec after the motion stopped. I have no recordings where the pre-trigger kicked in and saved 10 sec before the event. For example a car passing the camera - the recording starts with the car halfway through the frame, which is fine, but nothing before it even if the pre-trigger time is configured.

What is weird is that there no disk activity between motion events. You would think BI would be recording a 10 sec loop to disk constantly for this camera, but I don't see it. Network activity is there, but no disk. There is only one camera on the network now.
PerfWindow.png
 
You would think BI would be recording a 10 sec loop to disk constantly for this camera
I do no think BI writes the pre-trigger to disk. I would imagine it is in RAM.

Why not just record continuous? Having it record on triggered events is a great way to miss things.
 
I do no think BI writes the pre-trigger to disk. I would imagine it is in RAM.

Why not just record continuous? Having it record on triggered events is a great way to miss things.
It would be nice to know where the pre-trigger buffer is - if it's in memory, great - but it's still not showing up on disk after the event.
If I am forced to record continuous I will, but the point of having a pre-trigger time is to catch stuff before the event. ;)
 
It would be nice to know where the pre-trigger buffer is - if it's in memory, great - but it's still not showing up on disk after the event.
If I am forced to record continuous I will, but the point of having a pre-trigger time is to catch stuff before the event. ;)
Delete the camera in bi and add it back
 
  • Like
Reactions: dan2112
I don't see anything wrong in your configuration, and the order of setting things should not matter. Make sure when you re-add the camera that you have direct-to-disc enabled. That is what most of us use on all our cameras so if there's a bug in the re-encoding recording method then we might not know about it :)

I also don't use "Combine or cut" when I configure a cam for recording only when triggered. Otherwise your configuration seems very similar to mine.
 
  • Like
Reactions: dan2112
Also once you get this figured out, keep in mind that setting the i-frame interval equal to the frame rate is really mostly for making Blue Iris behave more predictably in terms of timing the recording start. Every i-frame in your stream hurts the compression ratio so there's good reason to use an i-frame interval that is higher (myself I usually set it between 2x and 4x the frame rate).