Saving CHDK override values in JPEG EXIF data (Propset 4 cameras). - General Discussion and Assistance - CHDK Forum

Saving CHDK override values in JPEG EXIF data (Propset 4 cameras).

  • 11 Replies
  • 11242 Views
*

Offline philmoz

  • *****
  • 3450
    • Photos
Advertisements
One thing that's annoyed me on the G12 and SX30 ports I did was that shutter, aperture and ISO override values in CHDK were not saved to the JPEG EXIF data. So you could not tell from the resulting JPEG what the actual exposure values were.

This also seems to be a problem for other cameras.

After digging through the firmware code for the G12 I found the functions that build the JPEG EXIF header.
What I found was that the JPEG EXIF header was using different property values from what I'd set up in propset4.h for these cameras.

I changed the property values in propset4.h which not only fixed the JPEG EXIF problem; but the override values are also shown on screen in the Canon OSD (bonus). This is true for the SX30 as well as the G12.

The changes I made are:
   PROPCASE_AV  was 23, now 22
   PROPCASE_TV  was 266, now 265
   PROPCASE_SV  was 251, now 347

It's still not perfect in that:
- Shutter speed values saved in the EXIF are limited to the maximum and minimum the camera supports natively (e.g. a shutter speed of 20 secs still shows in the EXIF as 15 secs).
- ISO overrides are weird, the override value does not correspond to the actual ISO value set. Still trying to work this one out.

Since the G12 and SX30 aren't the only cameras using propset4 I don't want to submit a patch until I can confirm that these changes work for all propset4 cameras (and don't break anything).

Anyone working with a propset4 camera, please try out the above changes and post results here.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline reyalp

  • ******
  • 14125
Re: Saving CHDK override values in JPEG EXIF data (Propset 4 cameras).
« Reply #1 on: 21 / May / 2011, 15:36:51 »
Nice.

For ISO values, Canon has "Real" and "Market" ISO which are different.
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Saving CHDK override values in JPEG EXIF data (Propset 4 cameras).
« Reply #2 on: 21 / May / 2011, 19:55:48 »
Nice.

For ISO values, Canon has "Real" and "Market" ISO which are different.

I've been trying to understand the ISO override system - can you point me to any documentation that explains these 'real' and 'market' values.
There seems to be some odd numbers hardwired into the code that I can't figure out and I was wondering if these might need to be updated for newer cameras.

Edit: Ok, figured it out eventually. The override value set in CHDK is treated as a 'real' ISO value and the code then calculates the appropriate sv values to try and set this ISO on the camera. So if I enter 50 as the override I get 80 as the camera ISO and the CHDK calculated sv values match pretty closely to the Canon property values I get when I select ISO 80 on the dial.

So now I need to remember what 'real' ISO values correspond to the camera ISO values - seems to be about a 1.6x factor.

Wouldn't it be easier for the average user to treat the CHDK override value as a Canon 'market' ISO value?

Phil.
« Last Edit: 21 / May / 2011, 21:49:47 by philmoz »
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline reyalp

  • ******
  • 14125
Re: Saving CHDK override values in JPEG EXIF data (Propset 4 cameras).
« Reply #3 on: 22 / May / 2011, 00:42:28 »
So now I need to remember what 'real' ISO values correspond to the camera ISO values - seems to be about a 1.6x factor.
My vague recollection from some experiments with SD990 is that it wasn't linear.
Quote
Wouldn't it be easier for the average user to treat the CHDK override value as a Canon 'market' ISO value?
Probably. However, if you want to do APEX calculations, you probably want to stick with the "real" value. There are some functions related to converting between the two in generic/shooting.c

I haven't looked at this stuff recently, hence the vague answers. Not trying to make your life difficult :)
Don't forget what the H stands for.

*

Offline funnel

  • ****
  • 349
Re: Saving CHDK override values in JPEG EXIF data (Propset 4 cameras).
« Reply #4 on: 22 / May / 2011, 07:13:37 »
I tried and looks like the EXIF data is correctly written now.
Just one thing I noticed. If I set the Av in camera to 3.1 and override in CHDK to F11 everything is ok, when I set to F8.0 and try to override to F3.1 the exif shows F3.1 but in reality the value didn't change (the shoot remains the same F8.0).
The EXIF ISO values looks correct, they just don't match to what I set up (if I set 3200 in chdk the actual and exif value is 800).

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Saving CHDK override values in JPEG EXIF data (Propset 4 cameras).
« Reply #5 on: 22 / May / 2011, 07:18:24 »
I haven't looked at this stuff recently, hence the vague answers. Not trying to make your life difficult :)

The lack of comments / documentation in the code is more than enough to make our lives 'difficult' :haha

Your help and assistance is always appreciated.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Saving CHDK override values in JPEG EXIF data (Propset 4 cameras).
« Reply #6 on: 22 / May / 2011, 07:26:46 »
I tried and looks like the EXIF data is correctly written now.
Just one thing I noticed. If I set the Av in camera to 3.1 and override in CHDK to F11 everything is ok, when I set to F8.0 and try to override to F3.1 the exif shows F3.1 but in reality the value didn't change (the shoot remains the same F8.0).
The EXIF ISO values looks correct, they just don't match to what I set up (if I set 3200 in chdk the actual and exif value is 800).

Not sure what is happening here - which camera is this (does it really support F/11)?
Try testing a range of different settings to see if there are any patterns.

Also you can enable the display of the property values if the debug menu - make sure both the original PROPCASE_AV (23) and and the new one (22) are getting set to the same value.

The ISO override value is not the camera's displayed ISO (which is referred to as 'market' ISO in the code). It is the supposed 'real' ISO. The camera 'market' ISO will be approx 1.6x the value you set in the CHDK override - so a CHDK override of 3200 will be trying to set a camera ISO of 5120. Since the camera probably doesn't support this it may be picking a safe ISO.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline funnel

  • ****
  • 349
Re: Saving CHDK override values in JPEG EXIF data (Propset 4 cameras).
« Reply #7 on: 22 / May / 2011, 08:23:30 »
Yes the camera (SX220HS) can go up to F11. I tried all values from F3.1 to F16 and compared the histogram in play mode. Above F11 there's no difference.

I tried the ISO with the prop debug displayed. When I set to 3200 pro 347 shows 690 an the incamera ISO(halfs hoot) shows 800 and exif shows 800.

Some numbers I tired:

ISOset->Prop347->EXIF

1600->345->64
1610->757->1250
1620->1168->12800
1630->1580->12800
1700->4463->12800
1800->8580->12800
2400->33286>-10
2410->33697>-10
2420->34109>-10
6400->1381->12800
12800->2763->12800


*

Offline funnel

  • ****
  • 349
Re: Saving CHDK override values in JPEG EXIF data (Propset 4 cameras).
« Reply #8 on: 22 / May / 2011, 09:45:23 »
Ok. I did some tests and found out the following values.

First I tried the continuous shoot ISO bracketing start from ISO 1 increment by 1:

ISO(EXIF) - ISO set
10-1
25-2
32-3
40-4
50-5
80-6  Min
100-7
125-8
200-9
250-10
320-11
400-12
640-13
800-14
1000-15
1600-16
2000-17
2500-18
3200-19
5000-20  Max
6400-21
8000-22
12800-23


I noticed some differences when inputing the values manually. So I tried them all and I got this:

ISO(EXIF) - ISO set
10-1,2
12-3
16-4
25-5
32-6
40-7
50-8
80-9  Min
100-10
125-11
200-12
250-13
320-14
400-15
640-16
800-17
1000-18
1600-19
2000-20
2500-21
3200-22
5000-23
6400-24
8000-25  Max
12800-26


The min and max are the camera limits. In the second I see some differencies in histogram at ISO 6400 and 8000, but I'm not sure. Probably max ISO is 5000.

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Saving CHDK override values in JPEG EXIF data (Propset 4 cameras).
« Reply #9 on: 22 / May / 2011, 14:10:18 »
As a side note a few things to remember when searching for override limits:
- In terms of f number, the narrowest aperture is only available fully zoomed in.
- On cameras with both an iris and an ND filter, make sure you know the ND filter state when playing with aperture override. You probably want to override the ND filter to not be there.
- With ISO overrides, you should look at both RAW and JPEG output. In most cameras the highest ISO settings rely on software, not on increased sensor sensitivity or analog amplification (as an example, on my a570 RAW for ISO 1600 and ISO 800 are identical but JPEG is boosted in software for ISO 1600). On recent cameras with more signal processing power they have started doing binning too (highest resolutions are not available for highest ISOs). Depending on how Canon wrote their firmware and how CHDK happens to tap into it, a hacked ISO override could behave unexpectedly, especially in the high ISO end (not that I would've heard that ever happening, it's just something that could one day happen with a new port).
- EXIF can't be trusted when overrides are enabled, especially not the normal tags that aren't a part of Canon's MakerNotes (and especially when you go past regular firmware user interface limits).

 

Related Topics


SimplePortal © 2008-2014, SimplePortal