VideoKeys "-und-FI" and non-"-und-FI"

Started by wywh, Today at 05:19:14 AM

Previous topic - Next topic

wywh

I am puzzled about the purpose of those seemingly duplicate "-und-FI" VideoKeys and whether I need to preserve either or both of them? Or not mess with them at all.

For example an iPhone movie:

exiftool -a -G1 -s -VideoKeys:All 2024-1221-1741-55.mov
[VideoKeys]     LensModel-und-FI                : iPhone 16 Pro back camera 6.765mm f/1.78
[VideoKeys]     FocalLengthIn35mmFormat-und-FI  : 25
[VideoKeys]     LensModel                       : iPhone 16 Pro back camera 6.765mm f/1.78
[VideoKeys]     FocalLengthIn35mmFormat         : 25

Only "-und-FI" (or maybe in fact the non-"-und-FI"?) seems to really be present in the original iPhone movie? Adding -v3 seems to indicate the other sibling is not real?

  | | | ItemList (SubDirectory) -->
  | | | + [ItemList directory]
  | | | | LensModel-und-FI = iPhone 16 Pro back camera 6.765mm f/1.78
  | | | | FocalLengthIn35mmFormat-und-FI = 25
-v3:
(synthesized default-language tag for QuickTime:LensModel)
(synthesized default-language tag for QuickTime:FocalLengthIn35mmFormat)

"-und-FI" tags refuse to delete from the original iPhone movie:

exiftool -overwrite_original -VideoKeys:LensModel-und-FI= -VideoKeys:FocalLengthIn35mmFormat-und-FI= 2024-1221-1741-55.mov
    0 image files updated
    1 image files unchanged

exiftool -a -G1 -s -VideoKeys:All 2024-1221-1741-55.mov
[VideoKeys]     LensModel-und-FI                : iPhone 16 Pro back camera 6.765mm f/1.78
[VideoKeys]     FocalLengthIn35mmFormat-und-FI  : 25
[VideoKeys]     LensModel                       : iPhone 16 Pro back camera 6.765mm f/1.78
[VideoKeys]     FocalLengthIn35mmFormat         : 25

But deleting their non-"-und-FI" siblings surprisingly deletes all those tags:

exiftool -overwrite_original -VideoKeys:LensModel= -VideoKeys:FocalLengthIn35mmFormat= 2024-1221-1741-55.mov
    1 image files updated

exiftool -a -G1 -s -VideoKeys:All 2024-1221-1741-55.mov
Warning: [minor] The ExtractEmbedded option may find more tags in the media data [x24] - 2024-1221-1741-55.mov

exiftool -a -G1 -s -ee -VideoKeys:All 2024-1221-1741-55.mov
[empty]

On the other hand, if I copy those tags to another movie, then both siblings seem to be real with no "synthesized" in v3 output:

exiftool -m -overwrite_original -api QuickTimeUTC=1 -tagsFromFile 2024-1221-1741-55.mov -All:All movie.mp4

exiftool -a -G1 -s -ee -VideoKeys:All movie.mp4
[VideoKeys]     FocalLengthIn35mmFormat         : 25
[VideoKeys]     FocalLengthIn35mmFormat-und-FI  : 25
[VideoKeys]     LensModel                       : iPhone 16 Pro back camera 6.765mm f/1.78
[VideoKeys]     LensModel-und-FI                : iPhone 16 Pro back camera 6.765mm f/1.78

  | | | ItemList (SubDirectory) -->
  | | | + [ItemList directory]
  | | | | FocalLengthIn35mmFormat = 25
  | | | | FocalLengthIn35mmFormat-und-FI = 25
  | | | | LensModel = iPhone 16 Pro back camera 6.765mm f/1.78
  | | | | LensModel-und-FI = iPhone 16 Pro back camera 6.765mm f/1.78

And then the "-und-FI" can be separately deleted. And Photos.app is still happy to display the Lens info:

exiftool -overwrite_original -VideoKeys:LensModel-und-FI= -VideoKeys:FocalLengthIn35mmFormat-und-FI= movie.mp4
    1 image files updated

exiftool -a -G1 -s -VideoKeys:All movie.mp4
[VideoKeys]     FocalLengthIn35mmFormat         : 25
[VideoKeys]     LensModel                       : iPhone 16 Pro back camera 6.765mm f/1.78

But then deleting the non-"-und-FI" surprisingly deletes both:

exiftool -a -G1 -s -VideoKeys:All movie.mp4
[VideoKeys]     FocalLengthIn35mmFormat         : 25
[VideoKeys]     FocalLengthIn35mmFormat-und-FI  : 25
[VideoKeys]     LensModel                       : iPhone 16 Pro back camera 6.765mm f/1.78
[VideoKeys]     LensModel-und-FI                : iPhone 16 Pro back camera 6.765mm f/1.78

exiftool -overwrite_original -VideoKeys:LensModel= -VideoKeys:FocalLengthIn35mmFormat= movie.mp4
    1 image files updated
exiftool -a -G1 -s -VideoKeys:All movie.mp4
[empty]

...still with me? So it seems one or the other of those tags is a master and deleting it deletes also the other, right? And it is better not to mess with them?

- Matti

Phil Harvey

Hi Matti,

Welcome to the nightmare of alternate-language metadata.

Quote from: wywh on Today at 05:19:14 AMOnly "-und-FI" (or maybe in fact the non-"-und-FI"?) seems to really be present in the original iPhone movie? Adding -v3 seems to indicate the other sibling is not real?

Correct.  non-"und-FI" tag does not exist in the file.  The default language is synthesized so the ExifTool user will get some response when LensModel is requested without a language code.

Quote"-und-FI" tags refuse to delete from the original iPhone movie:

Good point.  The reason is complicated and I will look into this, but it will take a lot of work to make sure I can keep any changes backward compatible.  The tag may actually deleted with

exiftool -videokeys:lensmodel-eng-FI=

QuoteBut deleting their non-"-und-FI" siblings surprisingly deletes all those tags:

This is as designed.  This, and the "eng"/"und" ambiguity are discussed in the 4th paragraph here.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

wywh

Quote from: Phil Harvey on Today at 08:18:08 AMWelcome to the nightmare of alternate-language metadata.

Thanks for the info. It seems it is best not to mess with those twins ???  But simply overwriting like below seems to get rid of those pesky Alternate language tags:

exiftool -a -G1 -s -VideoKeys:All 2024-1221-1741-55.mov
[VideoKeys]     LensModel-und-FI                : iPhone 16 Pro back camera 6.765mm f/1.78
[VideoKeys]     FocalLengthIn35mmFormat-und-FI  : 25
[VideoKeys]     LensModel                       : iPhone 16 Pro back camera 6.765mm f/1.78
[VideoKeys]     FocalLengthIn35mmFormat         : 25

exiftool -overwrite_original '-VideoKeys:LensModel=iPhone 16 Pro back camera 6.765mm f/1.78' '-VideoKeys:FocalLengthIn35mmFormat=25' 2024-1221-1741-55.mov
    1 image files updated

exiftool -a -G1 -s -VideoKeys:All 2024-1221-1741-55.mov
[VideoKeys]     LensModel                       : iPhone 16 Pro back camera 6.765mm f/1.78
[VideoKeys]     FocalLengthIn35mmFormat         : 25

- Matti

Phil Harvey

Hi Matti,

Yes.  If you write a tag with no language code then the alternate-language versions will removed.

I think I'll try patching ExifTool 12.15 to return these as 'eng-FI' tags instead of 'und-FI', because otherwise it is confusing because it is inconsistent with writing.  But it will still treat 'eng' as 'und' if there is no country code.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).