Optimizing Camera Frame Rate
Purpose
This application note describes configuration rules needed to obtain optimum frame rate performance from the Ethernet camera while receiving high-quality images.
Image Exposure Times
The camera cannot create images faster than the exposure time of the camera.
If autoexposure has been turned on, set maximum_exposure to at most the inverse of your desired frame rate. If it has been disabled, set exposure instead.
Frame Size
The product of the frame size and frame rate will determine the bandwidth used by the camera. The camera will maintain the optimum frame rate until the bandwidth has exceeded the maximum of 1.5MB/s using HTTP. When this rate is exceeded, the camera will lower the frame rate proportionally.
The Ethernet camera varies the frame size with the JPEG quality settings. The parameter can be set as JPEG quality (jpeg_quality) or as maximum frame-size (auto_jpeg_quality and max_jpeg_size). To maintain high-quality JPEG frames, set the maximum JPEG size to 5KB below .
Network Capacity
The maximum network capacity required for the Ethernet camera is 1.5MB/s using HTTP. The MJPEG streaming video from the camera will maintain a constant bandwidth without burst traffic.
The frame-rate performance will diminish in cases of network congestion. Using HTTP, performance will also degrade with excessive latency.
Camera Geometry
The width and height of the image also affects the speed that the camera can capture frames. The following table gives the maximum frame rate for several different image geometries as well as the maximum exposure and maximum frame sizes required to achieve this frame rate.
| max framerate | optimum exposure | max frame size | compression ratio |
1600x1200 (UXGA) | 20fps | 50ms | 72KB | 1:30 |
1280x1024 (SXGA) | 28fps | 36ms | 52KB | 1:30 |
Frame Rate Limiting
The camera allows frame rate limiting. By default, the camera will capture images at the maximum allowable rate based on the camera geometry and exposure settings. The camera can be set to capture images consistently at a slower rate by using the maximum_framerate parameter.
Automated JPEG Control
The camera may automatically adjust the JPEG compression to match a target frame rate or bandwidth usage. The control algorithm is designed to adjust the JPEG compression to match changes in exposure times and scene complexity.
To use this algorithm, turn on auto_jpeg_quality and set projected_network_bandwidth and projected_network_framerate.
Once set up, there are three states the camera may be in.
If the camera framerate is the same as the projected network framerate, the camera will limit the JPEG images such that a single stream of images will not exceed the projected network bandwidth.
If the camera framerate is higher than the projected network framerate, the camera will produce images the same size as in the first scenario. A request for a stream with a framerate of projected_network_framerate will result in a stream that consumes projected_network_bandwidth. If you ask for a stream without a frame rate limit, this stream will require more than projected_network_bandwidth and you may not receive all of the images the camera is producing.
If the camera framerate is lower than the projected network framerate, the camera will produce images larger than those in the first two scenarios. This allows the camera to use the spare bandwidth to produce larger, higher quality images.
Gain Noise
If the gain on the camera is set to a large value, the image noise becomes more pronounced. All compression engines have difficulties compressing noisy images. Thus at high gain, such as in a low light situation, a specific frame size will produce images of poorer quality than when the gain is low.
Troubleshooting Guide:
How do I control the frame-rate after I have configured the camera?
The camera supports a parameter, “maximum_framerate”, that allows the user to set the value to a rate that is below the maximum.
How do I initiate an MJPEG stream from the camera?
Use the “nph-video” (video) function with the URL http://camera_address/cgi-bin/nph-video
.
I am only receiving a fraction of the maximum bandwidth.
A bottleneck can be found in the camera, the MJPEG receiving computer, or the network in the following ways.
On the camera, check the exposure rate, MJPEG file-size, and the framerate parameter. If more than one video stream is run from the camera, the available bandwidth will be divided between each stream.
If the computer is decompressing the JPEG frames, the CPU will slow down the received video to a rate that it can handle. Turn off the MJPEG decompression to remove a possible framerate bottleneck caused by the computer CPU.
Finally, the network capacity can be tested if the frame-size of each image is set to the maximum allowable frame-rate. On the camera, set the JPEG quality to 99% and the maximum jpeg-size to 500KB. Even though the camera frame-rate will degrade in this configuration, the camera will be forced to use the maximum available bandwidth.
Can I pull multiple video streams from the camera?
Yes, the bandwidth of the camera will be divided between the demands of each stream.
How can I read the file-size of the images from the camera?
Pull a single image from the camera using the image command. This can be done from a web-browser. The image file-size can be found by reading the image properties.
An image can be pulled from the camera with the URL http://camera_address/cgi-bin/nph-image
.