Jump to content
kaon

Bitrate during stationary scenes. How low can you go?

Recommended Posts

Hi all,

 

I have a vague understanding that an MPEG4 codec could, in principle, be set up in constant quality (variable bitrate) mode, such that when there is high motion, bitrate increases up to a set maximum, and when the scene is unchanging, bitrate should approach zero. This is the ideal way things would work.

And then we should have no need to set record-only-when-motion-is-above-threshold. Since they can record stationary scenes with very little disk space.

 

Question:

How well do the various cameras achieve the above ideal?

 

A few possibilities for the poor performance I have been seeing:

- shoddy MPEG4 implementations

- constrained by processing hardware

Share this post


Link to post
Share on other sites

The answer is "neither" . MPEG-4 like other interframe codecs, sends out a full frame of video called I-frame. It then transmits differences between that reference frame and what is happening now. You are correct that in theory, if nothing changes, nothing needs to be transmitted. However, MPEG-4 encoders by default, repeat the I-frame after certain amount of time, whether there has been any motion or not. Check to see if there is a parameter called "I-frame" or "keyframe" distance. Increasing this number to a high value, will reduce the frequency of I-frames.

 

Note that setting the keyframe distance too high may make it difficult to seek into a specific portion of the recorded video later. And things like fast forward may not work nearly as well. Both of these are reasons for having frequent I-frames.

 

As a way of example, DVD and Blu-ray disc formats use 0.5 second keyframe distance to allow features like above.

 

Let me know if above is not clear.

Share this post


Link to post
Share on other sites

Hi Kaon,

 

Most interframe codec implementations (like MPEG-4 and H.264) in IP cameras default to variable bit rate.

 

In practice, the bit rate can vary significantly depending on the scene.

 

In a recent test of an Axis camera I did, the bit rate for 1080i, 30fps ranged from 1Mb/s to 8Mb/s per second depending on the complexity of the scene and the time of day (see http://ipvideomarket.info/report/test_axis_q1755_hd_surveillance_camera)

 

What poor performance are you seeing?

 

Best,

 

John

Share this post


Link to post
Share on other sites
The answer is "neither" . MPEG-4 like other interframe codecs, sends out a full frame of video called I-frame.

I am testing ACTi ACM-4001 and DLink DCS-2102.

Thank you, yes I am aware of keyframes, and that some encoders accept a parameter for max-distance between consecutive keyframes.

Both cameras I am testing do not expose that setting, though.

 

Keyframe interval should ideally be variable, becoming less frequent during low motion, perhaps up to a max-interval.

 

For security cam videos, 10s interval is fine, especially if only exercised during stationary scenes. If the space-savings are significant.

Share this post


Link to post
Share on other sites
Keyframe interval should ideally be variable, becoming less frequent during low motion, perhaps up to a max-interval.

Keyframe distance is variable. The encoder will make that decision on every frame. Note however it is not just motion that will trigger a keyframe to be sent. But rather, the encoder deciding that sending the incremental change is more than sending a keyframe.

 

Take the example of the sun coming out all of a sudden. Nothing has moved but every pixel has changed. So instead of sending the difference between every pixel and last keyframe, it is more efficient to simply generate a new keyframe.

For security cam videos, 10s interval is fine, especially if only exercised during stationary scenes. If the space-savings are significant.

Fair enough. One note though. In MPEG-4 ASP there is sometimes accumulated error. That is, if you keep sending changes relative to the original keyframe, the image degrades over time. You can see this effect when watching a mostly static image and seeing it get better at regular intervals when the keyframe arrives. This is another reason keyframe distance is not set to too large of a number.

Share this post


Link to post
Share on other sites

Both Acti ACM-4001 and Dlink DCS-2102 are unable to reduce their bitrate during stationary scenes, by much.

Bitrate ratio is about 4 : 5 (bitrate during no-motion : bitrate during motion)

Axis's 1:8 ratio as mentioned by jhonovich is more like it.

 

Keyframe distance is variable.

It is 100% constant for the DCS-2102.

1 I-frame, 4 P-frames....

I cannot tell for the Acti ACM-4001, since it records in a proprietary container.

The encoder will make that decision on every frame. ... So instead of sending the difference between every pixel and last keyframe, it is more efficient to simply generate a new keyframe.

I know the above are the advertised capabilities of MPEG4, but implementations of wildly varying efficiencies by different companies seem to be labelled "MPEG4". Greatly complicates camera selection.

 

Fair enough. One note though. In MPEG-4 ASP there is sometimes accumulated error. That is, if you keep sending changes relative to the original keyframe, the image degrades over time. You can see this effect when watching a mostly static image and seeing it get better at regular intervals when the keyframe arrives. This is another reason keyframe distance is not set to too large of a number.

AFAIK, during stationary scenes, if the deltas are directly with respect to a keyframe, then we don't expect degradation. It is only when deltas are with respect to other delta frames, that we expect degradation to accumulate.

Share this post


Link to post
Share on other sites

MPEG standards do not specify any encoder functionality. All the spec says is how to decode the video. So you are right that encoder is free to utilize as many "tools" as it likes. At the extreme a MPEG-4 encoder can act simply like motion-JPEG for example (and first generation MPEG-4 encoders did exactly that). As long as the video can be decoded, it can be called "MPEG-4."

 

There are also different profiles like "ASP" (Advanced Simple Profile) which increases efficiency somewhat.

 

What is the frame rate that you tested the DCS-2102?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×