Tips for adjusting camera video conditions

drakejest

Young grasshopper
Joined
Sep 9, 2022
Messages
60
Reaction score
9
Location
Asia
I would like to tune my camera to my environment, but there soo much i dont know which to adjust first.

Here are what i can adjust with my camera

picture (hue,saturation,contrast,sharpness,gamma)
Exposure
Backlight
WB

Now i have no idea how these settings work and have been just randomy adjusting it without a process in mind.

So far the notable settings that i cranked up to max or near maximum, are the contrast and sharpness. What am i sacrificing rising the value of those settings? contrast gives great color when raised up and sharpness just makes the image more sharper.

I have also been playing with manual exposure. I noticed that i was having a little bit of motion blur so I raised the value of the shutter just enough thats its somewhat gone, raising this setting seems to yield darker images.

Backlight is set to OFF but the choices are BLC, HLC, WDR. which one should i pick for night and day?

WB is set to auto,

I also raised the IR illumination to 100% as it gives me a really good picture at night.

Any tips on how to set these settings? which one should i adjust first? or what i should look out for when adjusting?
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,448
Reaction score
47,571
Location
USA
Here is my "standard" post that many use as a start for dialing in day and night that helps get the clean captures. These are done within the camera GUI thru a web browser.

Every field of view is different, but I have found you need contrast to usually be 6-8 higher than the brightness number at night.

We want the ability to freeze frame capture a clean image from the video at night, and that is only done with a shutter of 1/60 or faster. At night, default/auto may be on 1/12s shutter or worse to make the image bright.

In my opinion, shutter (exposure) and gain are the two most important parameters and then base the others off of it. Shutter is more important than FPS. It is the shutter speed that prevents motion blur, not FPS. 15 FPS is more than enough for surveillance cameras as we are not producing Hollywood movies. Match iframes to FPS. 15FPS is all that is usually needed.

Many people do not realize there is manual shutter that lets you adjust shutter and gain and a shutter priority that only lets you adjust shutter speed but not gain. The higher the gain, the bigger the noise and see-through ghosting start to appear because the noise is amplified. Most people select shutter priority and run a faster shutter than they should because it is likely being done at 100 gain, so it is actually defeating their purpose of a faster shutter.

Go into shutter settings and change to manual shutter and start with custom shutter as ms and change to 0-8.3ms and gain 0-50 (night) and 0-4ms exposure and 0-30 gain (day)for starters. Auto could have a shutter speed of 100ms or more with a gain at 100 and shutter priority could result in gain up at 100 which will contribute to significant ghosting and that blinding white you will get from the infrared or white light.

Now what you will notice immediately at night is that your image gets A LOT darker. That faster the shutter, the more light that is needed. But it is a balance. The nice bright night static image results in Casper blur and ghost during motion LOL. What do we want, a nice static image or a clean image when there is motion introduced to the scene?

In the daytime, if it is still too bright, then drop the 4ms down to 3ms then 2ms, etc. You have to play with it for your field of view.

Then at night, if it is too dark, then start adding ms to the time. Go to 10ms, 12ms, etc. until you find what you feel is acceptable as an image. Then have someone walk around and see if you can get a clean shot. Try not to go above 16.67ms (but certainly not above 30ms) as that tends to be the point where blur starts to occur. Conversely, if it is still bright, then drop down in time to get a faster shutter.

You can also adjust brightness and contrast to improve the image.

You can also add some gain to brighten the image - but the higher the gain, the more ghosting you get. Some cameras can go to 70 or so before it is an issue and some can't go over 50.

But adjusting those two settings will have the biggest impact. The next one is noise reduction. Want to keep that as low as possible. Depending on the amount of light you have, you might be able to get down to 40 or so at night (again camera dependent) and 20-30 during the day, but take it as low as you can before it gets too noisy. Again this one is a balance as well. Too smooth and no noise can result in soft images and contribute to blur.

Do not use backlight features until you have exhausted every other parameter setting. And if you do have to use backlight, take it down as low as possible.

After every setting adjustment, have someone walk around outside and see if you can freeze-frame to get a clean image. If not, keep changing until you do. Clean motion pictures are what we are after, not a clean static image.
 

drakejest

Young grasshopper
Joined
Sep 9, 2022
Messages
60
Reaction score
9
Location
Asia
Thank you for this guide, i hope you dont mind me asking questions..

Every field of view is different, but I have found you need contrast to usually be 6-8 higher than the brightness number at night.
what do you mean by 6-8 higher? is that the actual value like if my brightness is say 50/100 the contrast should 58/100?

In my opinion, shutter (exposure) and gain are the two most important parameters and then base the others off of it. Shutter is more important than FPS. It is the shutter speed that prevents motion blur, not FPS. 15 FPS is more than enough for surveillance cameras as we are not producing Hollywood movies. Match iframes to FPS. 15FPS is all that is usually needed.
I am currently running a H265, smart codec off (do i need to turn this on?) 15 FPS, VBR at best quality at 8000kps (max). Are these settings alright?


Go into shutter settings and change to manual shutter and start with custom shutter as ms and change to 0-8.3ms and gain 0-50 (night) and 0-4ms exposure and 0-30 gain (day)for starters. Auto could have a shutter speed of 100ms or more with a gain at 100 and shutter priority could result in gain up at 100 which will contribute to significant ghosting and that blinding white you will get from the infrared or white light.

Now what you will notice immediately at night is that your image gets A LOT darker. That faster the shutter, the more light that is needed. But it is a balance. The nice bright night static image results in Casper blur and ghost during motion LOL. What do we want, a nice static image or a clean image when there is motion introduced to the scene?

In the daytime, if it is still too bright, then drop the 4ms down to 3ms then 2ms, etc. You have to play with it for your field of view.
does it have to be 0 to 4 ? why not 4 to 4? Also i forgot i have a 3d NR setting should i turn this off or on?

It is currently dawn here and i was reducing the shutter down and got to 1ms and it switched to IR, 2ms is still fairly bright. so do i stop at 2ms?
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,448
Reaction score
47,571
Location
USA
Thank you for this guide, i hope you dont mind me asking questions..

what do you mean by 6-8 higher? is that the actual value like if my brightness is say 50/100 the contrast should 58/100?

That is correct


I am currently running a H265, smart codec off (do i need to turn this on?) 15 FPS, VBR at best quality at 8000kps (max). Are these settings alright?

Keep Smart Codec off. Many have found that H264 produces a better image. I will reply in a moment with the explaination.

Problem with Variable Bit Rate (VBR) is if the motion is quick, by the time the bitrate catches up, the object is gone, so most here run CBR (Constant Bit Rate)



does it have to be 0 to 4 ? why not 4 to 4? Also i forgot i have a 3d NR setting should i turn this off or on?

The Range 0 to 4 means that the shutter can go as fast as the camera allows (either 1/100,000 or 1/10,000), but will go no slower than 4ms (1/250ms).

If you put it at 4 to 4, then as daylight comes or goes, you could get a washed out image as there is too much light.

You should turn 3D NR on and run it at the lowest setting that you can tolerate. Do not go above 50.


It is currently dawn here and i was reducing the shutter down and got to 1ms and it switched to IR, 2ms is still fairly bright. so do i stop at 2ms?

That comes down to what you want it to do.
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,448
Reaction score
47,571
Location
USA
This will explain H264 versus H265 a little better.

H265 in theory provides more storage as it compresses differently, but part of that compression means it macro blocks big areas of the image that it thinks isn't moving. However, it also takes more processing power of the already small CPU in the camera and that can be problematic if someone is maxing out the camera and then it stutters.

In theory it is supposed to need 30% less storage than H264, but most of us have found it isn't that much. My savings were less than few minutes per day. And to my eye and others that I showed clips to and just said do you like video 1 or video 2 better, everyone thought the H264 provided a better image.

The left image is H264, so all the blocks are the same size corresponding to the resolution of the camera. H265 takes areas that it doesn't think has motion and makes them into bigger blocks and in doing so lessens the resolution yet increases the CPU demand to develop these larger blocks.

In theory H265 is supposed to need half the bitrate because of the macroblocking. But if there is a lot of motion in the image, then it becomes a pixelated mess. The only way to get around that is a higher bitrate. But if you need to run the same bitrate for H265 as you do H264, then the storage savings is zero. Storage is computed based on multiplying bitrate, FPS, and resolution.


1667974399793.png



In my testing I have one camera that sees a parked car in front of my house. H265 sees that the car isn't moving, so it macroblocks the whole car and surrounding area. Then the car owner walked up to the car and got in and the motion is missed because of the macroblock being so large. Or if it catches it, because the bitrate is low, it is a pixelated mess during the critical capture point and by the time H265 adjusts to there is now motion, the ideal capture is missed.

In my case, the car is clear and defined in H264, but is blurry and soft edges in H265.

Digital zooming is never really good, but you stand a better chance with H264 rather than a large macroblocked H265. I can digital zoom on my overview camera and kinda make out the address number of the house across the street with H264, but not a chance with H265 as it macroblocked his whole house.

H265 is one of those theory things that sounds good, but reality use is much different.

As always, YMMV.
 

drakejest

Young grasshopper
Joined
Sep 9, 2022
Messages
60
Reaction score
9
Location
Asia
It is currently dawn here and i was reducing the shutter down and got to 1ms and it switched to IR, 2ms is still fairly bright. so do i stop at 2ms?

That comes down to what you want it to do.
So just basically you want as fast of a exposure as possible. All other video setting are set to help get the fastest exposure that retains a clear video.

What does gain actually do? it brightens the image on the hardware level compared to brightness setting which is software? Im noticing that increasing the gain from 0 just worsen the image in my opinion



H265 is one of those theory things that sounds good, but reality use is much different.

As always, YMMV.
Ahh, i chose h265 thinking it would need significant less storage , but i guess its very little when there are always movement. What about the different variant of h264 ? I have a plain h264 , and a h264B variant in my choices. which one should i choose?
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,448
Reaction score
47,571
Location
USA
Yeah, the faster the shutter, the better than chance to get clear video IF, and it is a big IF, you keep the other parameters within check.

If you run a 1/250 shutter but crank brightness and gain and iris to 100 to give you a bright image, it will result in lots of issues and probably look much worse than a 1/30 slower shutter with the other numbers around 50.

These images are all digital, so going to extremes with any of the parameters will result in issues.

Gain amplifies the signal, but in doing so introduces noise and too much gain and you will get ghosting during motion.

If you are using just the camera or going to an NVR, then you can run the variants. If you are using Blue Iris, it is best to run plain ole H264.
 

Malvineous

Getting the hang of it
Joined
Jan 7, 2023
Messages
35
Reaction score
33
Location
Brisbane, Australia
What about the different variant of h264 ? I have a plain h264 , and a h264B variant in my choices. which one should i choose?
I wondered the same thing so I did a bit of investigation. Seems "H.264" is main profile, B is baseline, and H is high profile.

The short answer is that you are likely to get the best image quality with the High profile, but if some of your devices can't play the video then you will have to switch back to the Main profile, and if you still can't get playback to work on some really old device, you may have to try the Baseline profile. If you still have playback problems on the Baseline profile then the problem is something else as all devices that support H.264 can decode Baseline without any trouble.

Baseline ("H.264B") is used to strip out some of the size optimisations to make it easier to decode on simple devices with limited processing power, such as very early digital TV set top boxes. It will result in less efficient compression (so you need a higher bitrate for the same quality as the other profiles). Baseline is not recommended unless you need the stream to play on one of these old devices.

Main ("H.264") is meant for normal consumer gear and most things will decode it. It is the safe version that should work with most playback devices.

High ("H.264H") adds a few additional features in to improve the image quality at the same bitrate, however not all devices support these features (although practically all modern devices do). It's supposed to offer the best quality, however given what @wittaj said above about H.265 negatively affecting sudden movement, I'd probably want to check first that the High profile doesn't have similar issues. One of the features the High profile adds is "8x8 vs 4x4 transform adaptivity" and although I don't know what it means, I wonder whether it's increasing the size slightly of the macroblocks. If so, it could potentially be slightly worse than the Main profile for sudden movement as described in that post above, but not as bad as H.265.

There's an interesting article here that has a summary table of the main differences between each of the profiles: H.264 profiles and levels | Inside & Outside MediaCoder

Interestingly the Baseline profile is the only one (of the three here) that includes "redundant slices" which makes it more suitable for broadcast media as it can better recover from some data loss. This is probably not relevant for IP cameras unless your camera is on an unreliable link such as wifi and you're using a lossy protocol like UDP/multicast to send the video. It's also possible the camera won't insert any redundant slices even in Baseline mode so it might be completely pointless for this purpose, but interesting nonetheless.
 

drakejest

Young grasshopper
Joined
Sep 9, 2022
Messages
60
Reaction score
9
Location
Asia
I wondered the same thing so I did a bit of investigation. Seems "H.264" is main profile, B is baseline, and H is high profile.

The short answer is that you are likely to get the best image quality with the High profile, but if some of your devices can't play the video then you will have to switch back to the Main profile, and if you still can't get playback to work on some really old device, you may have to try the Baseline profile. If you still have playback problems on the Baseline profile then the problem is something else as all devices that support H.264 can decode Baseline without any trouble.

Baseline ("H.264B") is used to strip out some of the size optimisations to make it easier to decode on simple devices with limited processing power, such as very early digital TV set top boxes. It will result in less efficient compression (so you need a higher bitrate for the same quality as the other profiles). Baseline is not recommended unless you need the stream to play on one of these old devices.

Main ("H.264") is meant for normal consumer gear and most things will decode it. It is the safe version that should work with most playback devices.

High ("H.264H") adds a few additional features in to improve the image quality at the same bitrate, however not all devices support these features (although practically all modern devices do). It's supposed to offer the best quality, however given what @wittaj said above about H.265 negatively affecting sudden movement, I'd probably want to check first that the High profile doesn't have similar issues. One of the features the High profile adds is "8x8 vs 4x4 transform adaptivity" and although I don't know what it means, I wonder whether it's increasing the size slightly of the macroblocks. If so, it could potentially be slightly worse than the Main profile for sudden movement as described in that post above, but not as bad as H.265.

There's an interesting article here that has a summary table of the main differences between each of the profiles: H.264 profiles and levels | Inside & Outside MediaCoder

Interestingly the Baseline profile is the only one (of the three here) that includes "redundant slices" which makes it more suitable for broadcast media as it can better recover from some data loss. This is probably not relevant for IP cameras unless your camera is on an unreliable link such as wifi and you're using a lossy protocol like UDP/multicast to send the video. It's also possible the camera won't insert any redundant slices even in Baseline mode so it might be completely pointless for this purpose, but interesting nonetheless.
Weirdly enough i do not have the H variant but only h264 and h264B, if h264 is baseline and h264B is also baseline, what would then be the difference?
 
Top