Encoding · Storage · Networking
I-frame interval: what it does on a security camera and what to set
A camera stream carries a full picture every so often, the I-frame or keyframe, and in between only what changed. The I-frame interval says how far apart the full pictures are. It trades bandwidth and storage against how fast a stream starts and how precisely a recording can be searched.
How it works
- I-frame: a complete picture that can be decoded on its own. It is the largest frame in the stream.
- P-frames: the frames in between, which store only the changes since the previous frame and are much smaller.
- GOP: the group of pictures from one I-frame to the next. Its length is the I-frame interval.
Camera menus call the setting I-Frame Interval, GOP or keyframe interval. Some set it in frames and some in seconds: at 25 fps, 50 frames is 2 seconds.
Short or long interval
| Short interval | Long interval | |
|---|---|---|
| Bandwidth and storage | Higher: more full pictures per minute. | Lower, most of all on quiet scenes. |
| Opening a stream, switching cameras | Fast: the next full picture is never far away. | Slower: the player waits for the next I-frame. |
| Searching and exporting recordings | Lands close to the moment you ask for. | Playback starts at an I-frame, so it can be seconds off. |
| Lost packets on the network | The picture recovers sooner. | Damage can smear until the next I-frame. |
What to set
- A common choice is one to two seconds of video: 25 to 50 frames at 25 fps, 30 to 60 at 30 fps.
- Go shorter where operators watch live and switch cameras often, or where clips are exported for evidence.
- Go longer on quiet scenes recorded over a limited link, such as a wireless bridge or a 4G uplink.
- Keep the same setting on every camera of a recorder, so searching behaves the same on all of them. The sub stream can have its own interval.
In the calculators
Our storage calculator and bandwidth calculator take the I-frame interval in seconds and raise the estimated bitrate as it gets shorter, so the disks and the uplinks are sized for the setting you choose. For the other half of the bitrate question, see CBR vs VBR.
Questions
What is a good I-frame interval for CCTV?
One to two seconds of video is a common choice: 25 to 50 frames at 25 fps, 30 to 60 at 30 fps. Go shorter if people often seek and export clips, longer to save bandwidth on quiet scenes.
Is the I-frame interval set in frames or seconds?
It depends on the camera. Many show it in frames, so divide by the frame rate to get seconds; others ask for seconds directly.
Does a longer I-frame interval save storage?
Yes, because full pictures are the largest frames in the stream. The saving is biggest on quiet scenes, where the frames in between carry little.
Why does a camera take a moment to appear in the live view?
The player waits for the next I-frame before it can draw a picture. A long interval means a longer wait when you open a stream or switch cameras in a grid.
Is GOP the same as the I-frame interval?
For cameras, practically yes. A GOP (group of pictures) is an I-frame plus the frames up to the next one, so its length equals the I-frame interval.
See the bitrate for the whole system
Plan the cameras on the real site, then get bandwidth and storage for every camera in one report.