Can not find the tag for Nikon Focus Distance

Started by ubacher, July 15, 2019, 06:56:41 AM

Previous topic - Next topic

ubacher

When I display Metadata wit the exiftool command processor I get a tag
[Nikon]         Focus Distance                  : 9.44 m

I was trying to display the Focus Distance in the file window tips but I can not find this tag in Imatch tags.
There are various Nikon Focus Distance Tags but non display
this value. I looked in the Metadata 2 Tag manager without finding the tag.

I also looked at the exiftool website - the tag listings - and did not find the tag there either.

Details: For images from a Nikon D500 or a Nikon Df Imatch shows a focus distance under Nikon Lensdata 0204;
an Image from a Z6 does not show any focus distance under the various Nikon Lens Data - maybe because I use
a lens adaptor.




Mario

#1
Nikon shuffles their proprietary metadata around in their files with every firmware update. Nothing is documented and some of their metadata is even encrypted to make it extra hard or impossible to extract.
If ExifTool cannot find the data, I cannot help you.

Note that ExifTool makes up tag names for tags it finds but which are not documented or part of the ExifTool standard tag list ("unknown tags"). These tags usually have a generic group name and numbers, and "Nikon Lensdata 0204" sounds pretty much like it (field with the id 204 in the generic Nikon lens data block). ExifTool does not deliver these "dynamic" tags when IMatch queries the list of tag names (over 15,000 at this time) for the database. These tags hence don't show up in the tag manager.

if you use the ECP to find the data you're after, you can also find it in the Tag Manager. If this is a tag not imported, you need first to enable it in the tag manager and then re-import the files.
You can always contact the Nikon support (you are a customer after all, and the data is in your files) and ask them for a documentation of the metadata your camera stores in your files. I'm sure they will be glad to help.

Tip: Enable the option "Display and search tag keys" in the Tag Selector dialog. This helps if the tag name is different from the name used by ExifTool for the key.

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

You say:
Quoteif you use the ECP to find the data you're after, you can also find it in the Tag Manager.
But that is exactly the problem - I can't.

In the ECP it shows as:
[Nikon]         Focus Distance                  : 9.44 m

but I can't find the corresponding tag.

Mario

The Tag Manager has dozens of "Nikon Lens Focus" related tags. Plop them all into a MD Panel layout to find what you are looking for.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Mario

#4
The tag is easy to find. I've made a check with some Z6 sample images. Only a few had focus distance at all.

I can access it via the Variable:

{File.MD.Nikon::LensData0800\11\FocusDistance\0}

I found this by searching the MD panel (in browser mode) for focus.

If the tag is not imported, you have not enabled all related proprietary Nikon maker notes in the Tag Manager. If unsure, just enable everything that sounds like "lens" for the various Nikon groups.

Yes. Metadata is a mess. Without ExifTool we would be lost.
Nikon is making the mess worse with every firmware update and undocumented change. You have paid them, you complain with them.
I'm sick of metadata problems.

Let me know if you contacted Nikon support and if they have sent you a documentation of the metadata your camera (which you paid for) writes into your files (which you own).
Probably they'll just laugh into your face. They have your money already.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

jch2103

Thank you both for this. I've been interested in focus distance also. However, when I last looked into this, I seem to recall that the data provided in the proprietary tags wasn't very consistent. I'll plan to take another look using the tag Mario identified (I now also use a Z6) to see if this one is more reliable.
John

Mario

I have Z6 samples which have the tag and (apparently) reliably info. I have Z6 samples without this tag. I have one Z6 sample which shows nonsense in this tag.
Maybe your camera model writes the data into another field or offset, which would make ExifTool come up with a different name. Using the method I've described above should reveal all that's usable in your files.

It seems to me that Nikon did rush out the firmware to keep the release date. There is a chance that this will mature over time, if Nikon puts some effort into it.
No help for existing existing images, though.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

Is the data the ECP displays the data which Imatch uses to fill the metadata?
For me it does not seem so - at least it is then unexplainable how some tags are filled.

Mario

Of course it does.
The names you get from the command line application are tag names, not keys or ids. Keep that in mind.
IMatch does not make up names or tag ids, it uses an XML export from ExifTool to fill the database tables. Not all tags have names in all languages, and dynamic tags are named by ExifTool and are added by IMatch to the database when they are encountered.

As I demonstrated above, it is easy to find the right tag using the tools provided by IMatch.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

jch2103

Quote from: Mario on July 15, 2019, 07:21:14 PM
As I demonstrated above, it is easy to find the right tag using the tools provided by IMatch.

Indeed. However, the problem here is (as with most camera maker metadata) somewhat complicated.

My findings so far in searching for focus distance for my Z6:

- The variable {File.MD.Nikon::LensData0800\11\FocusDistance\0} (I checked the Tag Manager to be sure it and other distance tags were included) doesn't seem to provide any data for my Z6 'native' 24-70 S, but it does provide data for my Z6 with AF-S Nikkor 85mm f/1.8G and my old and current 70-300 Nikkor lenses using the FTZ adaptor.

- The tags Exif::Main\37382\SubjectDistance\0 and XMP::exif\SubjectDistance\SubjectDistance\0 do report values for JPG images derived via DxO PhotoLab from NEF files, but not for the NEF files themselves. I interpret this to mean that ExifTool has found a source in the NEF for distance data from my 24-70 S and has stored it the above two tags for JPG files, but I haven't figured out where in the NEF that information is.

More fun with metadata!
John

ubacher

QuoteAs I demonstrated above, it is easy to find the right tag using the tools provided by IMatch.

But I can not find which metadata tag corresponds to the entry in the ECP:
[Nikon]         Focus Distance                  : 9.44 m
There is no tag showing a value of 9.44

In reverse (different camera) I have the tag (with value):
{File.MD.Nikon::LensData0204\10\FocusDistance\0}
filled but I can not find a corresponding entry in the ECP listing.

Thus there must be some additional shuffling going on.

Mario

Quote from: ubacher on July 16, 2019, 07:33:54 AM
Thus there must be some additional shuffling going on.

You let ExifTool display the tag descriptions, not tag names. They may be different. (Tag Keys)
Add the -X -G and -t parameters so you get XML output including the ExifTool table name (which is used to produce the unique non-translated tag key IMatch is using internally). The tag descriptions you use for your analysis don't necessarily match the tag key and may even show in a different language.


-G
-all
-X
-a
-t
-n
-charset
filename=UTF8
{Files}


Then search for focus to find all related tags. The names used here is also the name IMatch uses for tag keys in variables.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

Thank you. Displaying the data this way cleared up all my questions.

BTW: I got curious and I tested the focus distance returned by my camera (lens, actually).
I photographed buckets placed at 4,6,8 and 10m and looked at the distances returned. Result:
useless. Way off.
This also means that the calculated depth of field is useless. Pity - it was DOF that interested me.

Mario

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

jch2103

Quote from: ubacher on July 16, 2019, 09:50:33 AM
Thank you. Displaying the data this way cleared up all my questions.

BTW: I got curious and I tested the focus distance returned by my camera (lens, actually).
I photographed buckets placed at 4,6,8 and 10m and looked at the distances returned. Result:
useless. Way off.
This also means that the calculated depth of field is useless. Pity - it was DOF that interested me.

Yes, that was my recollection from trying to access focus distance before. As you say, pity.
John

PaulS

Quote from: Mario on July 16, 2019, 08:21:46 AMYou let ExifTool display the tag descriptions, not tag names. They may be different. (Tag Keys)
Add the -X -G and -t parameters so you get XML output including the ExifTool table name (which is used to produce the unique non-translated tag key IMatch is using internally). The tag descriptions you use for your analysis don't necessarily match the tag key and may even show in a different language.
-G
-all
-X
-a
-t
-n
-charset
filename=UTF8
{Files}

Very cool.  Thank you.  I've saved this as an ECP Preset.

sinus

Quote from: PaulS on July 19, 2019, 12:59:36 AM
Quote from: Mario on July 16, 2019, 08:21:46 AMYou let ExifTool display the tag descriptions, not tag names. They may be different. (Tag Keys)
Add the -X -G and -t parameters so you get XML output including the ExifTool table name (which is used to produce the unique non-translated tag key IMatch is using internally). The tag descriptions you use for your analysis don't necessarily match the tag key and may even show in a different language.
-G
-all
-X
-a
-t
-n
-charset
filename=UTF8
{Files}

Very cool.  Thank you.  I've saved this as an ECP Preset.

I found this also cool.
I am curious, with these combinations does we get ALL the info inside an image?
It would be cool, if we had a combination (or command), where would pull out ALL the information, what is in an image.
Simply all.

But I do not know, if this possible.

I saved this here from Mario too, looks sophisticated.  ;D
Best wishes from Switzerland! :-)
Markus

Mario

QuoteIt would be cool, if we had a combination (or command), where would pull out ALL the information, what is in an image.

That's what the -a parameter is for (used by the standard presets in IMatch).

if you want to work with ExifTool (directly or via the ECP) I recommend reading the documentation to learn about it:

https://sno.phy.queensu.ca/~phil/exiftool/exiftool_pod.html
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ColinIM

Quote from: sinus on July 19, 2019, 08:56:35 AM
(....)
I am curious, with these combinations does we get ALL the info inside an image?
It would be cool, if we had a combination (or command), where would pull out ALL the information, what is in an image.
Simply all.

Hi Marcus,

Here's what I have been using (for years now) to extract what (I think) is all the meaningful metadata in one or more selected image files, including duplicate tags.  It might be a starting point for your peek at the ExifTool documentation.

On a quick test just now, this returned 260 (text) lines of metadata from one image file ... so you might begin testing with just one image file, or a small number of selected images initially.

-G
-all
-a
-m
-D
-charset
filename=UTF8
{Files}

The '-a' tells ExifTool to extract duplicate tags also.
The -D flag includes tag ID numbers in decimal in the left-most column.
The '-m' flag tells ExifTool to ignore minor errors and warnings
The '-G' tag (followed by an optional number) says 'Print group name for each tag'

You can also try adding:
-sort
to the list, but I'm satisfied with the result I get without '-sort' (curiously the output appears to be rather well sorted already!)

sinus

Quote from: ColinIM on July 26, 2019, 05:10:30 PM
Hi Marcus,

Here's what I have been using (for years now) to extract what (I think) is all the meaningful metadata in one or more selected image files, including duplicate tags.  It might be a starting point for your peek at the ExifTool documentation.

On a quick test just now, this returned 260 (text) lines of metadata from one image file ... so you might begin testing with just one image file, or a small number of selected images initially.

-G
-all
-a
-m
-D
-charset
filename=UTF8
{Files}

The '-a' tells ExifTool to extract duplicate tags also.
The -D flag includes tag ID numbers in decimal in the left-most column.
The '-m' flag tells ExifTool to ignore minor errors and warnings
The '-G' tag (followed by an optional number) says 'Print group name for each tag'

You can also try adding:
-sort
to the list, but I'm satisfied with the result I get without '-sort' (curiously the output appears to be rather well sorted already!)

Hi Colin
you brought me on the track...  ;D
Thanks for that!

Your example above works wonderful.
I found this combination is the same (I found it in IMatch, but not sure, is this a normal IMatch-combination, but I added your -D into it, is better):

-G1
-all:all
-D
{Files}

I compared with yours. And with this combination I get the same line like your example, but I find the left values even slightly a bit more informative, it says not only XMP, but does say XMP-aux or XMP-exif and so on. See my 2 attachements, one is from your combination (colin) and the other is with the shorter combination.

But do not ask what means -G1 (instead -G) or -all:all .... and so on. (you have not to ask, because you know it for sure  :D)
I have no clue and to be honest, to read the whole stuff about EXIF-Tools with my limited English goes simply over my head.
And once I have such a nice combination, what want I more?  ;D

I work seldom with Exif-Tool, but sometimes it is good to know, how to extract all information, burried in a file.

The only thing, what I wonder: is there no command, that the values, like

Kanton Aargau
Weihermattstrasse 76 / sinus
2.24
86304
...

can be vertically in the same row (means simply better formatted for the output)? Would make it better readable.


Thanks, Colin, for your effort, really appreciated!

Have a good time, best wishes
Markus



Best wishes from Switzerland! :-)
Markus

ColinIM

Thank you Markus for this feedback.
I agree that your more concise set of parameters gives a much more informative output, with the additional detail on the tags!

I see from my notes that I had devised my longer set of parameters (as in my reply) a long time ago - in 2014!!  So I guess it's possible that ExifTool's Phil Harvey has added even more magic to ExifTool in the meantime - which I hadn't spotted.

I will now replace my parameter set with yours  8)

Thanks, and best regards,
Colin P.

sinus

Quote from: ColinIM on July 26, 2019, 11:18:50 PM

I will now replace my parameter set with yours  8)

Thanks, and best regards,
Colin P.

Thanks, Colin, super,
so I have lerned from you, really, and you checked you (old) parameter, hence we both profited.  :)
Best wishes from Switzerland! :-)
Markus