'Does ExifInterface.TAG_SHUTTER_SPEED_VALUE really measure shutter speed? If so, how to convert it to a more standard format?

I'm trying to get camera shutter speed when a photo is taken with Android camera. Using this instruction in an image the app creates that contains the taken photo.

double vel = exif.getAttributeDouble(ExifInterface.TAG_SHUTTER_SPEED_VALUE, 0);

This gives some values that change according to the level of luminosity, for example right now if I allow natural light to go through my window fully it offers the value 6.906 and if I don't allow it as much as possible it is 3.882.

But on the other hand I'm using this app to check correctness of the values and for these same cases it offers the values 1/120 and 1/12, which seem to be on a standard format to represent shutter speed as seen here.

I can't grasp if ExifInterface.TAG_SHUTTER_SPEED_VALUE is measuring shutter speed correctly, but in other scale which I don't know how to convert or if it's doing that in a wrong way and using it wouldn't help.

Could anyone tell me how to convert to the 1/x format from the value it gives or tell me if it's measuring any other thing?



Solution 1:[1]

The TAG_SHUTTER_SPEED_VALUE unit is the APEX value.

Not sure about about this source but this is the only answer I found about the APEX value calculation: https://www.dpreview.com/forums/post/54376235

ShutterSpeed=-log2(ExposureTime).

And it matches your values:

-log2(1/120) = 6.907
-log2(1/12) = 3.585

Anyway, if your are looking for the exposure time value in second, you can directly read the TAG_EXPOSURE_TIME instead.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nit