# Shutter Speed from the Exif ShutterSpeedValue

Extracting Exif data from my photo (using python) among the other values I have:

``````'ShutterSpeedValue': (8643856, 1000000), 'ApertureValue': (1695994, 1000000)
``````

After some research, I found that the actual aperture is given by:

``````1.8 = math.sqrt(math.pow(2, (1695994/1000000)))
``````

So the aperture is f/1.8

How do I calculate the shutter speed given the ShutterSpeedValue of (8643856, 1000000) found in the Exif data?

• xiota's formula works, but you might want to use the ExposureTime Exif value instead of ShutterSpeedValue. At least on my Canon camera, ExposureTime gives the expected value, while ShutterSpeedValue is off a bit, e.g. 1/82 instead of 1/80. ExposureTime also avoids powers; it's just numerator/denominator. Feb 13 '20 at 21:34

What camera is that with this Exif format?

I recognize the math, but not the values.

The regular math is this way:

If you simply number the f/stops starting at
f/1 = stop number 0,
f/1.4 = stop number 1,
f/2 = stop number 2,
f/2.8 = stop number 3, etc...

then f/stop = sqrt(2^stop number).

Regular math is that sqrt(2^a power) is just sqrt(2)^a power. If you move the 2 outside the radical, it must become square root out there.

The actual f/stop numbers are themselves actually powers of sqrt(2)
(f/1, f/1.414, f/2, f/2.828, f/4, etc),
so then the same math is just:

f/2.8 = stop number 3, so f/2.8 = 1.414^3 = 2.828 precise. or your sqrt(2^3) is the same value.

Fractions work too, and f/1.8 is 1/3 stop less than f/2, which is stop number (2 - 1/3) = 1.6667,
so f/1.8 is 1.414^1.6667 = f/1.78, which is the exact precise value (that is an exact third stop under the exact value f/2). The f/1.8 is just its nominal value, rounded so to speak, just to show humans. But the precise value is f/1.78.

Shutter speeds work the same way but their stop values are 1,2,4,8,16,32, etc seconds, (those numbers which are powers of 2 not needing the extra sqrt)
2^3 = 8 seconds.
2^-3 = 1/8 second.

So your ShutterSpeedValue of (8643856, 1000000) would be 2^8.643856 = 400 seconds.
The shutter sequence 1,2,4,8,16,32,64,128,256,512

shows that stop number 8.6+ would be a big number.

If this value may be assumed negative, then 2^-8.643856 = 1/400 second

But then any speeds longer than 1 second would be a problem (or maybe there is some external flag?) And these are nominals too, not the precise values. Which seems very strange to me.

your math.sqrt(math.pow(2, 1.695994)) intends it to be a "stop number". But it computes f/1.800, but which is a nominal number (existing in name only, not a real value), and the actual standard precise value (that works with EV powers of 2) should be f/1.78.

So I'm curious where these (1695994/1000000) numbers came from?

The technique of scaling it up, with x 1000 or x 1000000 is normal, known and seen, and then the CPU chip does not need floating point math capability then. But I question it computing a nominal number? Maybe the firmware maybe could try to compensate it to be shown to a user as f/1.8, but f/1.8 or 1/400 second are not the precise numbers for the camera to use to compute EV and exposure.

• Thank you so much for your answer. The camera is the Nikon Z6 and I took the photo with the Nikkor G lens 85mm f/1.8 Here is a partial of the Exif data as extracted by python PIL library: `{'ExifVersion': b'0231', 'ShutterSpeedValue': (8643856, 1000000), 'ApertureValue': (1695994, 1000000), 'DateTimeOriginal': '2019:06:08 12:02:28', 'DateTimeDigitized': '2019:06:08 12:02:28', 'ExposureBiasValue': (0, 6), 'ColorSpace': 65535, 'MeteringMode': 2, 'LightSource': 0, 'Flash': 0, 'FocalLength': (850, 10),....` Jun 9 '19 at 23:00
• Thanks, that certainly makes it clear. Then I surely must have a wrong idea about the precise values being required in Exif. The camera does have to use the precise values for metering and exposure, but I guess they can show it in Exif any way they please. :) The precise values don't need lists, it is directly computed in for loops with 2^stop number. But Nominals cannot be computed, it requires a list. I guess that list can be in the 1.695994 format too. :) Thanks much for that info. Jun 9 '19 at 23:11
• might be worth mentioning. The Reason for sqrt is because to reduce the amount of light by a factor of 2 you need to reduce the area of the apeture by a factor of 2, which is pi*r^2 . Doubling the width of the apeture quadruples the amount of light that reaches the sensor. Aug 3 at 9:42

Exif:ShutterSpeedValue is stored in rational form as an APEX value.

The APEX system is a way to calculate exposure and works using base-2 logarithms. The use of base-2 means a rise of one in the value equates to a doubling, which we know as `1 stop`; which makes it pretty handy for photographers if they're good with logarithms (which we don't use much nowadays). (James Snell)

To convert from APEX to seconds, use the following equation:

ShutterSpeedValue (Tv) = -log2(t)
⇒ t = 2-Tv

For the particular values from your camera:

2(-8643856/1000000) = 1 / 2(8.643856) = 1/400 sec