TL;DR - Why are the jpeg's obtained via the API Snapshot MUCH worse quality than the png's from using the web interface?
2024_01_09 Update: Per @duplo post #18, you can change some "SnapFormat" settings which will improve the quality. I still feel that if you compare the JPEGs as generated from the Camera API versus similar-sized JPEG's generated from Photoshop from the PNG, the camera could do better. Makes me wonder about the internal algorithms ... but may be related to dynamic range comment below.
Also, per post #21-24 where I show Histograms, the "lightening" appears to be from compression of the dynamic range by boosting the shadows and knocking down the highlights. I'll point out that Hikvision has a Grey Scale option (Image->Image Enhancement) where you can choose the range of the grey scale as [0-255] or [16-235] ... the later is what seems to be happening.
I use a perl program to snarf the API snapshot ... but you can also get that by simply surfing to USERNAMEcolonPASSWORDampersandIP/cgi-bin/snapshot.cgi
I've been using IP cameras for a few decades - mostly recently Hikvision. But I've seen some nice products from Dahua, and this forum is much more active ... plus @EMPIRETECANDY is super responsive. So I decided to take one of the latest cameras for a spin - specifically the "latest 5442-ZE-S3 AKA T54IR-ZE-S3" as discussed in this thread.
I ordered it from Andy's Amazon store on 12/10 and it showed up the next day - can't get much better than that!
While there are a few differences from Hikvision, the setup was fairly straightforward ... as imaging is ... wellllll ... imaging! ;-)
I'm impressed with the camera so far ... with low light quality (the main thing I'm looking for) a definite improvement over the Hikvision (similar lens specs, but several year old sensor) I'm currently using.
But one thing that is REALLY bugging me is the quality of the jpeg Snapshot images when you snarf 'em via the API (/cgi-bin/snapshot.cgi) are MUCH worse than the png's obtained from the web interface.
I have tried all sort of encode combinations (compression, VBR/CBR, Bit Rate) and I see the same significant difference in image quality. Camera settings are close to default, with shutter speed set to 100msec (yes, I know that 1/10s is slow - I see it at faster shutter speeds), gain cranked up to 75 (I see it at lower gains), Noise reduction is at 50/50.
Yes, the Web PNG is 5,340KB versus the API JPEG is 256KB ... and yes, I appreciate that the API call returns a compressed image ... I have not found a way to change/specify the quality. If open the Web PNG in Photoshop, save it as a JPEG at quality 10, the resulting file size is about the same ... but doesn't have near as much blockiness. Even if I save as JPEG quality ONE(!), it doesn't look that bad. Another things I notice is the image is lightened (which probably contributes to the blockiness) resulted in a washed out look. I'm wondering if there is some sort of funky auto-leveling, gamma correction, and/or shadow pushing in generating the JPEG?
The camera is clearly capable of generating a (pretty darn good) PNG ... so why is the JPEG downloaded from the API so poor?
I'm wondering if others are seeing that on this camera or other Dahua's? And if so, is there any workaround to get a "decent" image via an API call.
Images attached in the next thread comments. Again, I LIKE the camera ... just wondering WTF is going on here and hoping to find a solution. TIA for any suggestions.
P.S. While this image is replicated below, I'm posting it here so you can quickly see what I'm talking about - note the the lightening plus the blockiness.
2024_01_09 Update: Per @duplo post #18, you can change some "SnapFormat" settings which will improve the quality. I still feel that if you compare the JPEGs as generated from the Camera API versus similar-sized JPEG's generated from Photoshop from the PNG, the camera could do better. Makes me wonder about the internal algorithms ... but may be related to dynamic range comment below.
Also, per post #21-24 where I show Histograms, the "lightening" appears to be from compression of the dynamic range by boosting the shadows and knocking down the highlights. I'll point out that Hikvision has a Grey Scale option (Image->Image Enhancement) where you can choose the range of the grey scale as [0-255] or [16-235] ... the later is what seems to be happening.
I use a perl program to snarf the API snapshot ... but you can also get that by simply surfing to USERNAMEcolonPASSWORDampersandIP/cgi-bin/snapshot.cgi
I've been using IP cameras for a few decades - mostly recently Hikvision. But I've seen some nice products from Dahua, and this forum is much more active ... plus @EMPIRETECANDY is super responsive. So I decided to take one of the latest cameras for a spin - specifically the "latest 5442-ZE-S3 AKA T54IR-ZE-S3" as discussed in this thread.
I ordered it from Andy's Amazon store on 12/10 and it showed up the next day - can't get much better than that!
While there are a few differences from Hikvision, the setup was fairly straightforward ... as imaging is ... wellllll ... imaging! ;-)
I'm impressed with the camera so far ... with low light quality (the main thing I'm looking for) a definite improvement over the Hikvision (similar lens specs, but several year old sensor) I'm currently using.
But one thing that is REALLY bugging me is the quality of the jpeg Snapshot images when you snarf 'em via the API (/cgi-bin/snapshot.cgi) are MUCH worse than the png's obtained from the web interface.
I have tried all sort of encode combinations (compression, VBR/CBR, Bit Rate) and I see the same significant difference in image quality. Camera settings are close to default, with shutter speed set to 100msec (yes, I know that 1/10s is slow - I see it at faster shutter speeds), gain cranked up to 75 (I see it at lower gains), Noise reduction is at 50/50.
Yes, the Web PNG is 5,340KB versus the API JPEG is 256KB ... and yes, I appreciate that the API call returns a compressed image ... I have not found a way to change/specify the quality. If open the Web PNG in Photoshop, save it as a JPEG at quality 10, the resulting file size is about the same ... but doesn't have near as much blockiness. Even if I save as JPEG quality ONE(!), it doesn't look that bad. Another things I notice is the image is lightened (which probably contributes to the blockiness) resulted in a washed out look. I'm wondering if there is some sort of funky auto-leveling, gamma correction, and/or shadow pushing in generating the JPEG?
The camera is clearly capable of generating a (pretty darn good) PNG ... so why is the JPEG downloaded from the API so poor?
I'm wondering if others are seeing that on this camera or other Dahua's? And if so, is there any workaround to get a "decent" image via an API call.
Images attached in the next thread comments. Again, I LIKE the camera ... just wondering WTF is going on here and hoping to find a solution. TIA for any suggestions.
P.S. While this image is replicated below, I'm posting it here so you can quickly see what I'm talking about - note the the lightening plus the blockiness.
Last edited: