Image Quality Settings?

DigitalCorpus

Active Member
Joined
Oct 17, 2023
Messages
112
Reaction score
74
Location
California
Country
United States
Dash Cam
Vantrue N4 Pro
I know I'm new here and though I've seen decent chunk of dash cam footage over the years, most of you have seen more than me. I've also done a fair amount of DIY DVR for terrestrial broadcast TV, such that I've spit out quite a bit of footage through fairly tuned x264 encoding parameters. I'm also a photographer of over 20 yrs and I work heavily under ambient light in low light conditions. Image quality is always a topic I've been interested in, so while what we get isn't a surprise to me, yeah, my desire will always be to see if there is something better. However, I do understand why various decisions for these IQ are made due to what the majority people want. @Jeff_Vantrue, if you don't mind considering the following request for additions to the N4 Pro's recording settings.

Requested IQ parameters:
  • Sharpening threshold, scale from 1 to 5: a differing level between two pixels that, once exceeded, determined if sharpness is applied to the selected pixel.
  • Sharpening radius, scale from 1 to 5: how many pixels affected out from the selected pixel affected by the algorithm
  • Sharpening strength/amount, scale from off/0 to 5: amount of added contrast/sharpness applied to selected pixels
  • Noise Reduction threshold, scale from 1 to 5 : Also can be known as "detail" instead of "threshold", though the effect would be inverted. As "threashold", if this differing level between two pixels is not exceeded, apply noise reduction
  • Noise Reduction strength, scale from off/0 to 5: amount or strength of NR algorithm
  • Bit rate, 3 levels of adjustment: everyone here knows what it is
Advanced Advance IQ Parameters
  • Noise reduction algorithm, Conservative or Aggressive: Conservative would leave low frequency detail present, effectively a low pass filter, whereas Aggressive would disregard the low pass filter.
  • Noise reduction gamma, scale from -3 to 3: bias the noise reduction algorithm to the shadows, no bias, or to the highlights of the image. A median value of 0 is no bias, a negative value to shadows, a positive value to highlights.

I'll use the sample provided here by @lisabon_Q3 since I don't have multiple dash cams to use for my own comparison.

The N4 Pro's image quality (IQ for short) settings that pertain to noise reduction (NR) and sharpness, to me, are insanely high. Granted, the footage when scaled down from 4K to 1080p looks better, but I rather have noise in the image than those details smudged out and removed. Also, many many people view the bitrate of the footage to be the overall "quality" metric of the footage even though that is the last detail that has an effect. You can very very easily over-accentuate noise/grain by cranking up the sharpness of a video. If little noise is present when this is done, fine details are lost and you start to get significant haloing around contrasting pixels. Turn up the radius and sharpening levels and you begin introducing artifacts that the encoders will prioritize over fine detail and allocate bits to those macroblocks instead. In order to objectively improve IQ, actually reducing these processing algorithms is a better route to choose. Subjectively though, the Average Joe does tend to like overly smoothed image with excessive sharpness.

All things combined, excessive sharpening and aggressive NR are the reason why increasing the bitrate out of devices like these are why you quickly run into diminishing returns. The encoders allocate more and more bits to where false/artificial detail is in the image, which isn't really detail at all. Similarly, in low light conditions, noise is very problematic and is effectively false detail too, but as it is impossible to completely remove it, having some actually helps the brain process the detail behind it. Yeah, its a physiological thing as vision isn't just the eyes, but the eyes and the brain. I'm not asking Vantrue to upend the IQ settings and "ruin" the output image for everyone else, but to expose some of settings to us in an advanced menu or some such if the end use is to be discouraged from adjusting their defaults.


As a couple examples, I'll present the following 1:1 crops of a old photo on an old sensor, a Canon 7D, ISO 3200 (pushed +1.0 EV in post). The image has flat block of smooth gradients and are out of focus (no detail), and some pixel level detail in the sleeve. Compressed with JPEG quality of 95, 50, 20 respectively for each.
Untouched images: 1943 KiB, 388 KiB, & 162 KiB
_OB_1498 - No NR or S - 95.jpg_OB_1498 - No NR or S - 50.jpg_OB_1498 - No NR or S - 20.jpg

Faux "dash cam" tuned NR & sharpness images: 1011 KiB, 236 KiB, 120 KiB
_OB_1498 - DC NR and S - 95.jpg_OB_1498 - DC NR and S - 50.jpg_OB_1498 - DC NR and S - 20.jpg

IQ tuned NR & sharpness images: 782 KiB, 148 KiB, 68 KiB
_OB_1498 - Tuned NR and S - 95.jpg_OB_1498 - Tuned NR and S - 50.jpg_OB_1498 - Tuned NR and S - 20.jpg


A few things to note regarding file sizes and compression quality:
  • IQ tuned image is always ~40% the size of the untouched image
  • The faux dash cam image is ~50% the size of the untouched at high quality and ~75% the size of the original at low quality
  • The faux dash cam images don't have as notable subjective difference between 50 & 20, unlike the other two
  • The IQ tuned 50 image is ~25% larger than the 20 faux image and looks objectively better
Edited to fix thumbnails
 
Last edited:
I'll present the final comparisions. A JPEG quality 39 for the IQ tuned and the JPEG quality 20 of the faux dash cam, just to make them the same size.
_OB_1498 - DC NR and S - 20.jpg_OB_1498 - Tuned NR and S - 39.jpg

I side with saying the IQ tuned image looks better than the over-smoothed and over-sharpened faux image, but that IQ one probably could use some additional sharpenning due to how lossy compression works. Hey, I honestly wanted the IQ one to be hands down better, but it isn't because it could be better. Coincidently, adding to the argument/request to allow us to turn some IQ parameters and bitrate to have the image look best to what the buyer would like. One optimization doesnt fit every scenario.
 
I am able to change many parameters - 3DNR, defog, AE, SHDR... Do you have feeling that you may do it better than manufacturer?
I attached a file from N4Pro with different sensor settings, it can be changed and applied to mod firmware. But I do not have enough datasheets and time for many IQ tests to do it better than Vantrue at this time.

I be glad to listen your recommendations about better values.

Also about H265 codec settings. Default in N4Pro for 4K 30 FPS resolution is:

MOVIE_AQ_PARAM =
DCD 1 //aq_enable; // 0 = aq off, 1 = aq on
DCD 3 //aq_str; // Adaptive Quantization Strength: 1~8
DCD 36 //sraq_init_aslog2; // initial i_ASlog2 for sraq (680): -1: disable sraq @1st Frame; 0~63 (default: 36) #0
DCD 8 //max_sraq; // max ssim aq: 0~ 15 (default: 8)
DCD -8 //min_sraq; // min ssim aq: 0~-15 (default: -8)
DCD 0 //sraq_const_aslog2; // 0 : update aslog2 by each frame, 1: use sraq_init_aslog2 for each frame.

MOVIE_CBR_PARAM =
DCD 1 ; Enable
DCD 4 ; bitstream statistic time, in seconds
DCD 30 ; frames per second
DCD 3993600 ; maximim bitrate, 31 200 kbit/sec
DCD 15 ; GOP (1 I-frame + 14 P-frames)
DCD 26 ; Initial I-frame QP value, Range: 0~51, 0 is best quality
DCD 10 ; Minimum I-frame QP value. Range: 0~51, 0 is best quality
DCD 50 ; Maximum I-frame QP value. Range: 0~51, 0 is best quality
DCD 26 ; Initial P-frame QP value. Range: 0~51, 0 is best quality
DCD 10 ; Minimum P-frame QP value. Range: 0~51, 0 is best quality
DCD 50 ; Maximum P-frame QP value. Range: 0~51, 0 is best quality
DCD 0 ; IPweight Range: -100~100, Set to 0 by default
DCD 1 ; 0 :disable RowRc, 1:enable RowRc
DCD 8 ; RowRcQpRange
DCD 4 ; RowRcQpStep


That do you recommend to change and why?

Please make a note that better IQ leads to increasing file size. I checked GOP=10, InitQP=16, MaxQP=30, QPStep=1 and 1minute 4K 30FPS video makes 1 GB file size. Without sufficient image quality differences between default values and 260MB filesize.
 

Attachments

Fancy :love:

That's a fairly comprehensive configuration file. It'll take quite a bit of time for me to go through it properly. I've not looked into H.265, though there are familiar parameters there from my time in H.264.

"Better IQ" isn't something that's static and there are a number of factors that go into it. Seeing if NR & sharpness can be modified and in what ways is where my focus is atm. Wasn't expecting this, but it is possible these two things are lower level firmware that what the config file touches.
 
Byte structure is little endian?
I have more questions @Dex_, but I'll compile them and ask them all at once. Thank you for that config file as it appears to have regular NR, 3DNR as you said, "edge" would be the synonym for "sharpness", et al.

Edit: Notes for me (and anyone else playing along) for when I can come back to this, and I'm not going to just make a new post for this:
AVB = Auto White Balance
MWB = Manual White Balance (even though it is not user configurable in the menu, but I'd not use this anyhow)
CFA = Color Filter Array, aka Bayer Filter, aka info needed to demosaic sensor data
CCM = Color Correction Matrix (table) (no touchy, no reasonable reason to touch this)
NR = Noise Reduction
3DNR = 3D Noise Reduction, i.e. temporal noise reduction
OB = not sure, could use help from others. Maybe "objective" which is a synonym for lens. Could be a distortion correction map?
Companding = not sure, could use help from others
RGBIR = Red Green Blue Infrared, likely a table for blending the two or exposure information for when to switch between the two modes
RGBIR_ENH = the above + enhancement. Don't know what this function performs
DeFog = aka Haze Removal, in all likelihood
HDR = High Dynamic Range, an exposure/processing paradigm used to capture a greater amount of light between black and white. Usually requires post processing tone mapping
SHDR = not sure, but related to HDR, probably Super HDR
WDR = Wide Dynamic Range, a form of HDR, but distinctly different (I've not messed with HDR-like processing outside of Exposure Fusion, let alone messed with it algorithmically)
Edge = Sharpening parameters
Edge Region = Sharpening parameters?
VA = not sure, could use help from others
Cap = Capture? Specific parameter for stills/photo capture from the sensor?
Gamma = Gamma, a function for adjusting the linear output of the sensor to logarithmic to mimic the response of the human vision system
Color = Yeah, not sure, but I assume this is a synonym for "saturation"
 
Last edited:
I am able to change many parameters - 3DNR, defog, AE, SHDR... Do you have feeling that you may do it better than manufacturer?
I attached a file from N4Pro with different sensor settings, it can be changed and applied to mod firmware. But I do not have enough datasheets and time for many IQ tests to do it better than Vantrue at this time.

I be glad to listen your recommendations about better values.
<snip></snip> That do you recommend to change and why?

Please make a note that better IQ leads to increasing file size. I checked GOP=10, InitQP=16, MaxQP=30, QPStep=1 and 1minute 4K 30FPS video makes 1 GB file size. Without sufficient image quality differences between default values and 260MB filesize.
I do think that I can produce better results, objectively, yes. Though it will take time, having my N4 Pro installed in my car, and having memory cards + time to test different firmware options. I have other real life things I need to tend to and I've already spent an hour on this when I should be doing other things. As I said before, I have some specific questions for you about that config file and I'll ask them all at once. We can communicate here or through DMs if desired. I appreciate your effort to make comments in the file. I'm used to using Google to translate German for editing diesel ECU definition files so Russian is fine too.
 
Values encoded in Little-Endian bytes order. Feel free to DM me your questions. Russian in comments because at 11 PM I was so tired for translation to English so I just posted my current working file. As you noted not everything is commented, original file does not consist any comments and I spend enough time to find proper structs for AE and need more work for other parameters.
 
Last edited:
Okay, so if people get the choice, we want to optimize for 4K, right? 'Cause that's the front camera's resolution. I'm not being clever, rather serious. I used a power bank of mine and ran the camera overnight to see how thing would behave, and established that this 50K power bank is still functioning properly.

Sharpness is equally applied to 1080p & 3180p alike. This means that if you optimize for one, the other will be over/under sharp. Plus there is a weird pixel binning issue when in parking mode that is exaggerated because of over sharpening. Here are 2 frame grabs.

4K/3160p
vlcsnap-2023-11-04-14h15m11s293.png

1080p
vlcsnap-2023-11-04-14h16m24s217.png

That 1080p recording is a ~5 Mbps whereas the normal stream is ~10 Mbps yet there is pixel level detail in the grab that isn't an issue [in a static scene] at that bitrate in case anyone doubts that bitrate isn't the absolute measure of video quality/fidelity. I have some IRL things to tend to and then I might break into attempting to decode the 3DNR, NR, and sharpening parameters.
 
Last edited:
Quick snip as to why the mains power frequency is important.

 
So there was another term in the config file called companding. Here is how it affects HDR image processing. I do not know how they have it implemented in firmware, but the array in the config has 70 entries. I'm not pretending to understand all of the white paper at the moment:

Slideshow deck for a lecture using the above paper:

Video from lecture *with audio*:


It is easy to knock any company for poor implementation. It is really hard to get this right and the above info is from 2 decades ago.
 
@Agie, are you familiar with analog HD, aka AHD and do you have any premise that I could use to vet if it is being used for the rear camera or cabin camera?

The config file has AHD references and 4 total sections for the application of image processing. 2 of those 4 are for AHD, if my memory is correct.
 
@Agie, are you familiar with analog HD, aka AHD and do you have any premise that I could use to vet if it is being used for the rear camera or cabin camera?

The config file has AHD references and 4 total sections for the application of image processing. 2 of those 4 are for AHD, if my memory is correct.
I'm not sorry mate
 
I just found this discussion and great thread!

I like the ideas you’re suggesting here with image optimization, but I think that it might be a bit much for most people. Most people don’t know what settings are “best” and they prefer the manufacturer to make those decisions for them and then bake them into the file.

For those of us who want every ounce of detail when shooting stills, having the ability to shoot in RAW instead of JPEG is a huge benefit. It’d be awesome to have a similar capability with our dashcams. However I wonder if those options will be too much for most people and introduce unwanted complexity and confusion.

That said, when it comes to the baked in image processing including sharpening, noise reduction, etc., that might be a more feasible approach to have them tweak those options.

Given that most dashcams provide very little control to the user, the only controls we have are basic things like resolution, bitrate, frame rate, and maybe HDR or codec selection. I doubt most people putz around with things like exposure compensation, heh. To your point about bitrate producing diminishing returns, that’s true as well. It’s something, but it’s certainly not everything.
 
I just found this discussion and great thread!

I like the ideas you’re suggesting here with image optimization, but I think that it might be a bit much for most people. Most people don’t know what settings are “best” and they prefer the manufacturer to make those decisions for them and then bake them into the file.

For those of us who want every ounce of detail when shooting stills, having the ability to shoot in RAW instead of JPEG is a huge benefit. It’d be awesome to have a similar capability with our dashcams. However I wonder if those options will be too much for most people and introduce unwanted complexity and confusion.

That said, when it comes to the baked in image processing including sharpening, noise reduction, etc., that might be a more feasible approach to have them tweak those options.

Given that most dashcams provide very little control to the user, the only controls we have are basic things like resolution, bitrate, frame rate, and maybe HDR or codec selection. I doubt most people putz around with things like exposure compensation, heh. To your point about bitrate producing diminishing returns, that’s true as well. It’s something, but it’s certainly not everything.
Totally agree, Vantrue are definitely watching what we find and say here on the forums as evidenced by their bug squashing. I do wonder though if they are making any image optimisations or not from firmware to firmware, or if this it outside their current scope.
 
Most details in an image, especially at night, are blurred due to vehicle movement so it is inherent to the manufacturer to adjust the parameters above to aid in that. This is why I'm not trying to drag Vantrue over the coals for the IQ decisions they made, but want to ask for adjustments or refinement. That said, I have been chatting with @Dex_ and we both have little free time but and making progress on how the functions are setup. The remaining months of this year have little free time and I know Dex_ doesn't have much either. Unless there is a windfall eureka moment, I'd estimate that we won't have meaning results until sometime in January. Unless Vantrue beats us to it.
 
Did quite a fair bit of driving from just after sunset to well past nautical twilight. Our geography is as such, with advantageous weather, that I got a brief stint of fog driving on an unlit road. I'm not in a dark sky area, but it is dark enough that the camera thinks things are black. Anyhow, this accounts for my stock test footage and as such, I now have a baseline to start making manipulations from. I do want to thank @Dex_ for having providing me with all of the information he is able to, even some things that I can do A<->B comparisons with.

I can still say that, with confidence, that the 4K footage down-sampled to my iPhone 12 mini's screen, 1080 pixels tall, that the image is still notably oversharpened. This is what I'm going to attempt to tackle first. Hope everyone have a great New Year's Eve celebration, if plans succeed. I'll be trying to do the thing and get a cleaner image out of this dashcam.


EDIT & Disclaimer​

All dashcam images provided by me will have a filter factor of ~1.35, i.e. ~70% of light makes it through, thus my dashcam is given 1/3rd of a stop less light to work with. If you notice that my videos in a dark environment differ from yours in brightness, this is likely why
 
Last edited:
T
I know I'm new here and though I've seen decent chunk of dash cam footage over the years, most of you have seen more than me. I've also done a fair amount of DIY DVR for terrestrial broadcast TV, such that I've spit out quite a bit of footage through fairly tuned x264 encoding parameters. I'm also a photographer of over 20 yrs and I work heavily under ambient light in low light conditions. Image quality is always a topic I've been interested in, so while what we get isn't a surprise to me, yeah, my desire will always be to see if there is something better. However, I do understand why various decisions for these IQ are made due to what the majority people want. @Jeff_Vantrue, if you don't mind considering the following request for additions to the N4 Pro's recording settings.

Requested IQ parameters:
  • Sharpening threshold, scale from 1 to 5: a differing level between two pixels that, once exceeded, determined if sharpness is applied to the selected pixel.
  • Sharpening radius, scale from 1 to 5: how many pixels affected out from the selected pixel affected by the algorithm
  • Sharpening strength/amount, scale from off/0 to 5: amount of added contrast/sharpness applied to selected pixels
  • Noise Reduction threshold, scale from 1 to 5 : Also can be known as "detail" instead of "threshold", though the effect would be inverted. As "threashold", if this differing level between two pixels is not exceeded, apply noise reduction
  • Noise Reduction strength, scale from off/0 to 5: amount or strength of NR algorithm
  • Bit rate, 3 levels of adjustment: everyone here knows what it is
Advanced Advance IQ Parameters
  • Noise reduction algorithm, Conservative or Aggressive: Conservative would leave low frequency detail present, effectively a low pass filter, whereas Aggressive would disregard the low pass filter.
  • Noise reduction gamma, scale from -3 to 3: bias the noise reduction algorithm to the shadows, no bias, or to the highlights of the image. A median value of 0 is no bias, a negative value to shadows, a positive value to highlights.

I'll use the sample provided here by @lisabon_Q3 since I don't have multiple dash cams to use for my own comparison.

The N4 Pro's image quality (IQ for short) settings that pertain to noise reduction (NR) and sharpness, to me, are insanely high. Granted, the footage when scaled down from 4K to 1080p looks better, but I rather have noise in the image than those details smudged out and removed. Also, many many people view the bitrate of the footage to be the overall "quality" metric of the footage even though that is the last detail that has an effect. You can very very easily over-accentuate noise/grain by cranking up the sharpness of a video. If little noise is present when this is done, fine details are lost and you start to get significant haloing around contrasting pixels. Turn up the radius and sharpening levels and you begin introducing artifacts that the encoders will prioritize over fine detail and allocate bits to those macroblocks instead. In order to objectively improve IQ, actually reducing these processing algorithms is a better route to choose. Subjectively though, the Average Joe does tend to like overly smoothed image with excessive sharpness.

All things combined, excessive sharpening and aggressive NR are the reason why increasing the bitrate out of devices like these are why you quickly run into diminishing returns. The encoders allocate more and more bits to where false/artificial detail is in the image, which isn't really detail at all. Similarly, in low light conditions, noise is very problematic and is effectively false detail too, but as it is impossible to completely remove it, having some actually helps the brain process the detail behind it. Yeah, its a physiological thing as vision isn't just the eyes, but the eyes and the brain. I'm not asking Vantrue to upend the IQ settings and "ruin" the output image for everyone else, but to expose some of settings to us in an advanced menu or some such if the end use is to be discouraged from adjusting their defaults.


As a couple examples, I'll present the following 1:1 crops of a old photo on an old sensor, a Canon 7D, ISO 3200 (pushed +1.0 EV in post). The image has flat block of smooth gradients and are out of focus (no detail), and some pixel level detail in the sleeve. Compressed with JPEG quality of 95, 50, 20 respectively for each.
Untouched images: 1943 KiB, 388 KiB, & 162 KiB
View attachment 68564View attachment 68563View attachment 68562

Faux "dash cam" tuned NR & sharpness images: 1011 KiB, 236 KiB, 120 KiB
View attachment 68561View attachment 68560View attachment 68559

IQ tuned NR & sharpness images: 782 KiB, 148 KiB, 68 KiB
View attachment 68578View attachment 68567View attachment 68565


A few things to note regarding file sizes and compression quality:
  • IQ tuned image is always ~40% the size of the untouched image
  • The faux dash cam image is ~50% the size of the untouched at high quality and ~75% the size of the original at low quality
  • The faux dash cam images don't have as notable subjective difference between 50 & 20, unlike the other two
  • The IQ tuned 50 image is ~25% larger than the 20 faux image and looks objectively better
Edited to fix thumbnails
So you want to be smarter than the manufacturer and keep changing the settings according to lighting conditions, contrast, number of details in the image. That's not suitable for ordinary consumers who know nothing about photography and image editing options and want "just" a dashcam.

There is one single optical product in the current range that meets your needs. In my opinion, such adjustments are not made when the image is taken but only when editing it at home.
 
T

So you want to be smarter than the manufacturer and keep changing the settings according to lighting conditions, contrast, number of details in the image. That's not suitable for ordinary consumers who know nothing about photography and image editing options and want "just" a dashcam.

There is one single optical product in the current range that meets your needs. In my opinion, such adjustments are not made when the image is taken but only when editing it at home.
What are you adding to this conversation? You’re entitled to your opinion. Your opinions appear to be antithetical to my proposal and you don’t seem to be interested in advancing the conversation in a meaningful way. I’m entitled to ignore you.

The manufacturer tailors the image to the audience by delivering to them what they think they want. Go shopping for a TV, find the brightness and saturation and all of the image processing turned on and near their highest setting. First thing you should do is turn all of that stuff off.
 
Create a petition for your opinion .

The comparison between TV and dascam is somewhat lame. TV is not for recording like a dascam, but for video reproduction. Video is not edited at the time of capture but afterwards.

You are simply confusing a video camera and a video editing program.

What you require is probably not included in the capabilities of any camcorder on the market, let alone a dashcam.
 
Last edited:
You are simply confusing a video camera and a video editing program.

What you require is probably not included in the capabilities of any camcorder on the market, let alone a dashcam.
You don't know what you're talking about.

The ISP/SoC has to do some very complex image manipulation to provide a usable frame for encoding. Dex_ has already provided me with the information and tools I seek to make the adjustments. We just lack documentation for the data structures of the parameters and they are unsurprisingly complex. Here is a simple one where auto exposure is weighted across the image frame and it does have 1 asymmetric mismatch, though in practicality, won't affect things:
1703986863626.png

This is a configuration file that is used in the firmware to dynamically adjust dozens of image parameters and features. The firmware [blob] is a partitioned ROM with a linux build in it. This file can be swapped out with a modified one and voila, regular NR, 3DNR/temporal NR, sharpening, HDR et al can be modified.

We cannot fix bugs in the implementation of the various algorithms, but we can modify the parameters fed into them.


My main sharpening gripe is that the radius is so high, that 4K --> 1080p downsampling shows pronounced haloing at this lower resolution
My main noise reduction gripe is that it is tuned for zero noise resulting is large swaths of uniform patches of color.

The over-sharpening causes the H.265 to allocate bits to these areas that are effectively artificial detail and the decimation & AQ filtering further accentuate this when encoding the frame. This creates a blurred, contoured mess of an image. I am not expecting pixel perfect 4K frames. I am expecting it to not look like a 1080p frame upscaled to 4K with a bicubic filter.

Camcorders don't have this functionality. Embedded cameras, which these are, do. You seem bent on being contrary in your ignorance, such as in Alexcrist's thread, to which he and I have more than 15 years of photography experience each.
 
Back
Top