set i-frames to match FPS

StratRider

Getting comfortable
Joined
Jul 31, 2019
Messages
244
Reaction score
281
Location
Dallas, TX
BI-5 manual on page 72/73 basically says that for "direct to disk" recording you should have the FPS/Key (key frames per second) set to 1.00
Info found in BI Status > cameras tab >FPS/key column.
A little more searching meant I needed to set each camera i-frames to match the camera FPS to get a 1.00 Key setting.
This is rarely mentioned in the forum although every camera that I have installed configures itself with i-frames to double the chosen FPS setting which produces a .50 key rate.

I guess I just want to reassure myself that everyone else is setting their cameras at 1/1 if doing 24/7 recording and "direct to disk" and is there any downside at all to this?
Thanks
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,006
Location
USA
The main downside to a short i-frame interval is a poorer compression ratio, which means your recordings will be slightly bigger and/or worse quality than if you used a longer i-frame interval. This is because each i-frame consumes a big portion of the available bit rate.

The benefits of a shorter i-frame interval are numerous. The BI help file covered some of this already:

  • Clips must begin at an i-frame, so a shorter i-frame interval means Blue Iris can provide better precision when starting a direct-to-disc recording and when exporting a section of a clip without re-encoding.
  • Better motion detector / live view performance when using "limit decoding".
  • Seeking in recorded clips is slightly more efficient with a shorter i-frame interval.
  • If your camera often has visible video corruption due to data loss, a short i-frame interval helps the stream to recover quicker.

I don't care about any of those benefits for my systems at home, so I mostly use 2-4 second i-frame intervals.
 

fenderman

Staff member
Joined
Mar 9, 2014
Messages
36,897
Reaction score
21,250
A recent updated added a feature that also requires a lower iframe interval.
5.2.3 - March 26, 2020
The email alert MP4 as well as the push alert GIF will now begin with 5 seconds of “pre-
trigger” time, making them immensely more useful. Previously, these began recording only
at the time of trigger. The requirement for this feature is that your camera is set to record in
“direct to disc” mode. Please also check your key frame rate to insure that it’s at least 0.50;
1.00 is recommended—this is displayed on the Status/Cameras page alongside the FPS.
Also, the video encoding parameters for the email alert MP4 must not specify to resize the
video (re-encoding will be required). The email alert MP4 will also be created “direct to
disc” which will ease use of the CPU, however it may result in a larger file, as this is now
the camera’s full resolution. Your system must also be able to open and play MP4 files in
Blue Iris—you can get the K-Lite codec pack for this if not already installed: https://
codecguide.com/download_kl.htm.
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,006
Location
USA
I won't go into details here, but Blue Iris's web server streaming profiles are a special case. There, you want a very high i-frame interval. The default value, which also happens to be the maximum Blue Iris will let you enter, is 300 frames. Sometimes people reduce this to 15 or 30 or something without realizing that in doing so, they have made their web server streaming quality much worse for no reason.
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,006
Location
USA
That depends on which setting you are referring to.

You took a screenshot of the camera's web interface and named it "fps BI"?

BTW, the reason the i-frame interval is grayed out in your screenshot is because H.264+ is enabled which means it doesn't use normal i-frames and can cause compatibility problems.
 
Joined
Sep 19, 2015
Messages
945
Reaction score
1,211
Location
Naples Fl
That depends on which setting you are referring to.

You took a screenshot of the camera's web interface and named it "fps BI"?

BTW, the reason the i-frame interval is grayed out in your screenshot is because H.264+ is enabled which means it doesn't use normal i-frames and can cause compatibility problems.
does this look correct? should all camera have the +264 disabled?
 

Attachments

Joined
Aug 8, 2018
Messages
7,386
Reaction score
25,889
Location
Spring, Texas
So if one has Dahua cameras and is using BI Direct-to-disk recording, and the options are: H.264, H.264B, H264H, or H.265 for the camera's main stream, what should one select?
 

Walrus

Getting comfortable
Joined
Nov 19, 2018
Messages
593
Reaction score
449
Location
Ontario
I don't care about any of those benefits for my systems at home, so I mostly use 2-4 second i-frame intervals.
@bp2008

I still can't get my head around what the interval means. When you mention 2-4 second i-frame intervals, what do you have your FPS set to, and what do you have your i-frame interval set to?
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,006
Location
USA
does this look correct? should all camera have the +264 disabled?
That looks fine. Did you have any trouble with H.264+ enabled? Some people don't have (or don't notice) any problems, and it does make encoding more efficient.

Only thing I might change is to turn off SVC explicitly, and of course reduce the frame rate if I wanted to save BI CPU cycles.
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,006
Location
USA
So if one has Dahua cameras and is using BI Direct-to-disk recording, and the options are: H.264, H.264B, H264H, or H.265 for the camera's main stream, what should one select?
I normally pick H.264H. Not sure if there's any meaningful difference with the other 264 options. H.265 is okay too if you don't lose hardware acceleration by enabling it. I don't have a way to objectively measure quality of the stream so I can't say if it helps to use H.265 or not.
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,006
Location
USA
I still can't get my head around what the interval means. When you mention 2-4 second i-frame intervals, what do you have your FPS set to, and what do you have your i-frame interval set to?
For most cameras, the i-frame interval setting is a number of frames (Dahua and Hikvision both do it this way).

In that case if you make it equal to the frame rate then you get 1 i-frame per second. e.g. 30 FPS, 30 I-Frame interval.

For 1 i-frame every 2 seconds, you would make it double the frame rate. e.g. 30 FPS, 60 I-Frame interval.

So if I say "4 second i-frame interval" then I mean for an FPS of 30 you would set I-Frame Interval to 120.

Some cameras don't include an I-Frame Interval setting, or may label it differently ("i-frames", "GOP", "keyframe interval", etc). And some cameras may have their I-Frame Interval setting be in seconds so you would enter a relatively low number like 1, 2, 3, or 4. Hopefully it would be obvious which unit was being used for each camera based on the field label or the default value.
 

SouthernYankee

IPCT Contributor
Joined
Feb 15, 2018
Messages
5,170
Reaction score
5,320
Location
Houston Tx
In simple form The Iframe is a complete frame with 100% of the data, all the colors, all the pixel. All other frames contain the data that has changed. The changed frames are filled in by computing the remaining data. Different compression methods provided the changed data using different algorithms. The larger the Iframe value the longer the time is between a complete frame the more difficult the calculation of the interleaving frames. If the FPS and the Iframe value are the same , then there is a complete frame ever one second.

Use a large Iframe value can have an impact on the motion calculations, under selection settings and the start time of video provided in the alert, events.
 
Last edited:

gfaulk09

Getting the hang of it
Joined
Jul 19, 2019
Messages
127
Reaction score
16
Location
Memphis
Just a thought. I didn’t really set up my frame interval section when i installed the cameras. I’m up to 40 cameras on my blue iris system. When I was using h264. My system would hover around 50%. Now it fluctuates violently since I changed over to h265. Sometimes as low as 25%. Other times it maxes at 100%. When theirs a lot of motion on the cameras is mostly when the problem arise. Only 3 cameras use motion detection. So that’s not the issue. Wondering if using a different frame interval can help solve the problem
 

SouthernYankee

IPCT Contributor
Joined
Feb 15, 2018
Messages
5,170
Reaction score
5,320
Location
Houston Tx
@gfaulk09
On the cameras that are not doing motion detection, in BI on the video tab check the limit decoding.
Are you using Hardware accleration to process your video in BI? What CPU processor do you have ?
H.265 is a more complete compression than H.264.

Is the BI machine Headless ?

If you are recording direct to disk and not processing the video , the Iframe will not affect the processing, But if the camera is up on the display or used in motion detection than the video will need to be processed.
 

gfaulk09

Getting the hang of it
Joined
Jul 19, 2019
Messages
127
Reaction score
16
Location
Memphis
@gfaulk09
On the cameras that are not doing motion detection, in BI on the video tab check the limit decoding.
Are you using Hardware accleration to process your video in BI? What CPU processor do you have ?
H.265 is a more complete compression than H.264.

Is the BI machine Headless ?

If you are recording direct to disk and not processing the video , the Iframe will not affect the processing, But if the camera is up on the display or used in motion detection than the video will need to be processed.
I can't really do limit decoding on some cameras because they are viewed quite often thru remote server.
I have been having issues every since I switched over to h265. Now my processor is maxed out. i9-9900k also paired with a Nvidia graphics card.

It is headless but I do have it plugged in to an adapter that makes it thinks that its being powered.
 
Top