Movie Title, Description, Author and Keywords

Started by wywh, February 16, 2021, 06:47:10 AM

Previous topic - Next topic

wywh

It seems that currently there are several places to write Title, Description, Author and Keywords in H.264 .m4v, .mp4 and .mov. Keys seems to be the most robust place to write them.

I tested this with macOS 11.2.1 Big Sur QuickTime Player and Photos.app 6.0:

1. Final Cut Pro 10.5.1 inserts the following tags to H.264 and H.265 .m4v it exports and I can edit them with a command like:

exiftool -m -P -overwrite_original_in_place -ItemList:Title='Title' -ItemList:Description='Description' -ItemList:Author='Author' -ItemList:Keyword='Keyword1,Keyword2' .

QuickTime Player's Get Info displays the Title, Description and Author and Photos.app 6.0 Title and Description.

Those ItemList tags also seem to need 'QuickTime:HandlerType=Metadata' tag so that QuickTime Player and Photos.app can display them:

[QuickTime]     HandlerType                     : Metadata

I can edit those tags but if I delete the last ItemList tag, also that 'QuickTime:HandlerType=Metadata' is removed and I can not add it back:

exiftool -m -P -overwrite_original_in_place -QuickTime:HandlerType=Metadata .
Warning: Sorry, QuickTime:HandlerType doesn't exist or isn't writable
Nothing to do.


And then even if I can successfully add and edit those ItemList tags, QuickTime Player and Photos.app don't display them anymore.

2. On the other hand, Final Cut Pro 10.5.1 inserts the following tags to .mp4 it exports. I can edit them with a command below but after that neither QuickTime Player nor Photos.app display them anymore:

exiftool -m -P -overwrite_original_in_place -UserData:Title='Title' -UserData:ClipFileName='Title' -UserData:Description='Description' -UserData:Author='Author' .

There is also 'UserData:Keywords' but it is not writable:

[UserData]      Keywords                        : (err)
[UserData]      UnknownThumbnail                : (Binary data 123911 bytes, use -b option to extract)

exiftool -m -P -overwrite_original_in_place -UserData:Keywords='Keyword1,Keyword2' .
Warning: Sorry, UserData:Keywords doesn't exist or isn't writable
Nothing to do.


3. On the other hand, Photos.app 6.0 can add Titles, Captions and Keywords to movies and export them re-encoded as .mov. I can edit them (and add Author) with a command like:

exiftool -m -P -overwrite_original_in_place -Keys:DisplayName='Title' -Keys:Description='Description' -Keys:Author='Author' -Keys:Keywords='Keyword1,Keyword2' .

The original 'Keys:Keywords' is as follows but Keywords doesn't seem to be supported anyway in movie apps?

[Keys]          Keywords                        : (Binary data 0 bytes, use -b option to extract)

Keys overrides both ItemList and UserData tags in QuickTime Player and Photos.app and seems to be most robust so it seems it is best to use Keys in movie Titles, Descriptions and Authors in .m4v, .mp4 and .mov?

To add Keys and force any existing ItemList and UserData tags the same a command like this seems to work (I tried a simpler command without explicit Keys but then the edited UserData tags fail to display):

exiftool -m -P -overwrite_original_in_place -Keys:DisplayName='Title' -Keys:Description='Description' -Keys:Author='Author' -Title='Title' -ClipFileName='Title' -Description='Description' -Author='Author' .

- Matti

wywh

Below are the initial tags for those Final Cut Pro 10.5.1 .m4v and .mp4 and Photos 6.0 .mov (exiftool 12.16):

exiftool -a -G1 -s -ee finalcutpro10.5.1.m4v
[QuickTime]     HandlerType                     : Metadata
[ItemList]      Description                     : Description_fcp1051
[ItemList]      Author                          : Author_fcp1051
[ItemList]      Keyword                         : Keyword1_fcp1051,Keyword2_fcp1051
[ItemList]      Title                           : Title_fcp1051
[ItemList]      Title                           : Title_fcp1051
[ItemList]      Title                           : Title_fcp1051
[ItemList]      Description                     : Description_fcp1051
[ItemList]      Author                          : Author_fcp1051

exiftool -a -G1 -s -ee finalcutpro10.5.1.mp4
[UserData]      ClipFileName                    : Title_fcp1051
[UserData]      Description                     : Description_fcp1051
[UserData]      Keywords                        : (err)
[UserData]      UnknownThumbnail                : (Binary data 123911 bytes, use -b option to extract)
[UserData]      Author                          : Author_fcp1051
[UserData]      Title                           : Title_fcp1051

exiftool -a -G1 -s -ee photos6.0.mov
[QuickTime]     HandlerType                     : Metadata Tags
[Keys]          Keywords                        : (Binary data 0 bytes, use -b option to extract)
[Keys]          DisplayName                     : Title_photos60
[Keys]          Description                     : Description_photos60
[Keys]          CreationDate                    : 2020:01:01 12:00:00+02:00

BTW that 'QuickTime:HandlerType=Metadata Tags' vanishes if all Keys are removed and is re-created if some Keys is added.


- Matti

Phil Harvey

#2
Hi Matti,

1.  See the API QuickTimeHandler option.  Maybe I should change the default of this option to 1.

2. What ExifTool version are you using?  Version 12.18 made some changes to the way these tags are handled.  If you still have problems, I'll need sample videos containing the tags that you say ExifTool is not writing properly.

- 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

#3
Thanks, I used exiftool 12.16 and '-api QuickTimeHandler=1' fixed the issue with irreversibly vanishing 'QuickTime:HandlerType=Metadata'.

But for some strange reason 'ItemList:Author' acts weird also with exiftool 12.18:

Final Cut Pro 10.5.1 .m4v export (sample file attached). QuickTime Player shows Title, Description and Author:

exiftool -a -G1 -s -ee finalcutpro10.5.1.m4v
[QuickTime]     HandlerType                     : Metadata
[ItemList]      Description                     : Description_fcp1051
[ItemList]      Author                          : Author_fcp1051
[ItemList]      Keyword                         : Keyword1_fcp1051,Keyword2_fcp1051
[ItemList]      Title                           : Title_fcp1051
[ItemList]      Title                           : Title_fcp1051
[ItemList]      Title                           : Title_fcp1051
[ItemList]      Description                     : Description_fcp1051
[ItemList]      CoverArt                        : (Binary data 123903 bytes, use -b option to extract)
[ItemList]      Author                          : Author_fcp1051


All ItemList tags are removed and added back (now also 'QuickTime:HandlerType=Metadata' is added back so the tags should be displayed):

exiftool -m -P -overwrite_original_in_place -api QuickTimeHandler=1 -ItemList:all= finalcutpro10.5.1.m4v
    1 image files updated

exiftool -m -P -overwrite_original_in_place -api QuickTimeHandler=1 -ItemList:Title='Title' -ItemList:Description='Description' -ItemList:Author='Author' -ItemList:Keyword='Keyword1,Keyword1' finalcutpro10.5.1.m4v
    1 image files updated


Now QuickTime Player shows Title and Description, but for some strange reason fails to display Author although it is present:

exiftool -a -G1 -s -ee finalcutpro10.5.1.m4v
[QuickTime]     HandlerType                     : Metadata
[ItemList]      Author                          : Author
[ItemList]      Keyword                         : Keyword1,Keyword1
[ItemList]      Description                     : Description
[ItemList]      Title                           : Title


So both ItemList and UserData seem flaky while Keys acts as expected. But obviously there is no standard for this yet?

- Matti

Phil Harvey

First, Final Cut Pro is writing Author twice for some reason.  Odd.  Probably a bug.  But it isn't writing the default ItemList:Author that ExifTool uses:

> exiftool finalcutpro10.5.1.m4v -author -a -G1:7
[ItemList:ID-a9aut] Author                      : Author_fcp1051
[ItemList:ID-a9aut] Author                      : Author_fcp1051
> exiftool finalcutpro10.5.1.m4v -itemlist:all=
    1 image files updated
> exiftool finalcutpro10.5.1.m4v -itemlist:author=author
    1 image files updated
> exiftool finalcutpro10.5.1.m4v -author -a -G1:7
[ItemList:ID-auth] Author                       : author
> exiftool finalcutpro10.5.1.m4v -itemlist:id-a9aut:author=author
    1 image files updated
> exiftool finalcutpro10.5.1.m4v -author -a -G1:7
[ItemList:ID-auth] Author                       : author
[ItemList:ID-a9aut] Author                      : author


I think that Final Cut Pro should recognize Author if you write ItemList:ID-a9aut:Author.  (Note that unlike other group/tag names, family 7 group names are case sensitive, except for the leading "ID-".)

Unfortunately nobody seems to care about standardizing video metadata.  ExifTool tries to make the common tags the default ones, but there are too many players in this game, and on top of this they aren't consistent themselves.

- 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

#5
Thanks, that explains the missing .m4v Author!

So Final Cut Pro 10.5.1 .m4v ItemList:ID-a9aut can be edited and it remains the same so QuickTime Player displays it. But if it is deleted and added back as the default -ItemList:Author='Author', it changes to ItemList:ID-auth and QuickTime Player does not display it anymore.

Title, Description and Keywords remain the same even if they are re-created so they behave as expected. In the sample .m4v Author is twice and Title three times. I initially suspected that QuickTime chapters might explain them but that test movie does not have extra chapters.

So this works for ItemList Author for QuickTime Player compatibility:

exiftool -m -P -overwrite_original_in_place -api QuickTimeHandler=1 -ItemList:Title='Title' -ItemList:Description='Description' -ItemList:ID-a9aut:Author='Author' -ItemList:Keyword='Keyword1,Keyword2' .

The other weirdness is that after the Final Cut Pro 10.5.1 .mp4 (sample file attached) tags are edited, QuickTime Player and Photos 6.0 don't display them anymore. Maybe the added UserData:ID-a9nam:Title explains this?

exiftool -a -G1:7 -s finalcutpro10.5.1.mp4
[ExifTool:ID-ExifToolVersion] ExifToolVersion   : 12.18
[UserData:ID-clfn] ClipFileName                 : Title_fcp1051
[UserData:ID-dscp] Description                  : Description_fcp1051
[UserData:ID-kywd] Keywords                     : Keyword1_fcp1051,Keyword2_fcp1051
[UserData:ID-thmb] ThumbnailImage               : (Binary data 123903 bytes, use -b option to extract)
[UserData:ID-auth] Author                       : Author_fcp1051
[UserData:ID-titl] Title                        : Title_fcp1051

exiftool -m -P -overwrite_original_in_place -api QuickTimeHandler=1 -UserData:Title='Title' -UserData:ClipFileName='Title' -UserData:Description='Description' -UserData:Author='Author' -UserData:Keywords='Keyword1, Keyword2' finalcutpro10.5.1.mp4
Warning: Sorry, UserData:Keywords doesn't exist or isn't writable
    1 image files updated

exiftool -a -G1:7 -s finalcutpro10.5.1.mp4
[UserData:ID-clfn] ClipFileName                 : Title
[UserData:ID-dscp] Description                  : Description
[UserData:ID-kywd] Keywords                     : Keyword1_fcp1051,Keyword2_fcp1051
[UserData:ID-thmb] ThumbnailImage               : (Binary data 123903 bytes, use -b option to extract)
[UserData:ID-auth] Author                       : Author
[UserData:ID-titl] Title                        : Title
[UserData:ID-a9nam] Title                       : Title


I wonder why Apple's apps use different tags for the same info in .m4v, .mp4 and .mov. Do the wrapper standards require this? Anyway, Keys in .mov works as expected and seem to work also in .m4v and .mp4 at least in the apps I tested.

ProRes 422 .mov with chapters exported from Final Cut Pro 10.5.1 attached if someone wants sample clips. Unlike Photos, FCP .mov has two Title tags so I adjusted my command for both of them to something like this. But this is a mess and Apple might change things in the next update.

exiftool -m -P -overwrite_original_in_place -api QuickTimeHandler=1 -Keys:Title='Title' -Keys:DisplayName='Title' -Keys:Description='Description' -Keys:Author='Author' -Keys:Keywords='Keyword1,Keyword2' .

Phil Harvey

Quote from: wywh on February 17, 2021, 04:58:50 AM
The other weirdness is that after the Final Cut Pro 10.5.1 .mp4 (sample file attached) tags are edited, QuickTime Player and Photos 6.0 don't display them anymore. Maybe the added UserData:ID-a9nam:Title explains this?

You'll have to investigate this yourself.

QuoteI wonder why Apple's apps use different tags for the same info in .m4v, .mp4 and .mov. Do the wrapper standards require this? Anyway, Keys in .mov works as expected and seem to work also in .m4v and .mp4 at least in the apps I tested.

I don't have any documentation on this.  It would be great if you could work up a document listing which tags are used by Apple in the various file formats.

- 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

#7
Editing any of those UserData tags in .mp4 makes it disappear from macOS 11.2.1 QuickTime Player and Photos.app 6.0.

I tried to edit them exactly the same as in the original .mp4 exported from Final Cut Pro 10.5.1. It does not matter if I do not try to edit Keywords that for some reason fails.

The 'exiftool -a -G1:7 -s -ee .' output looks identical compared to the original .mp4 but the tags are no longer displayed. With more verbosity like -v3 there are lots of differences though (in the original there seems to be a 'U.' prefix for tags like Title = U.Title_fcp1051 and so on).

exiftool -a -G1:7 -s -ee finalcutpro10.5.1.mp4
[ExifTool:ID-ExifToolVersion] ExifToolVersion   : 12.19
[UserData:ID-clfn] ClipFileName                 : Title_fcp1051
[UserData:ID-dscp] Description                  : Description_fcp1051
[UserData:ID-kywd] Keywords                     : Keyword1_fcp1051,Keyword2_fcp1051
[UserData:ID-thmb] ThumbnailImage               : (Binary data 123903 bytes, use -b option to extract)
[UserData:ID-auth] Author                       : Author_fcp1051
[UserData:ID-titl] Title                        : Title_fcp1051
[QuickTime:ID-mdat-size] MediaDataSize          : 1293664
[QuickTime:ID-mdat-offset] MediaDataOffset      : 126857

exiftool -m -P -overwrite_original_in_place -UserData:ID-titl:Title='Title_fcp1051' -UserData:ID-clfn:ClipFileName='Title_fcp1051' -UserData:ID-dscp:Description='Description_fcp1051' -UserData:ID-auth:Author='Author_fcp1051' -UserData:ID-kywd:Keywords='Keyword1_fcp1051,Keyword2_fcp1051' finalcutpro10.5.1.mp4
Warning: Sorry, UserData:ID-kywd:Keywords doesn't exist or isn't writable
    1 image files updated

exiftool -a -G1:7 -s -ee finalcutpro10.5.1.mp4
[UserData:ID-clfn] ClipFileName                 : Title_fcp1051
[UserData:ID-dscp] Description                  : Description_fcp1051
[UserData:ID-kywd] Keywords                     : Keyword1_fcp1051,Keyword2_fcp1051
[UserData:ID-thmb] ThumbnailImage               : (Binary data 123903 bytes, use -b option to extract)
[UserData:ID-auth] Author                       : Author_fcp1051
[UserData:ID-titl] Title                        : Title_fcp1051
[QuickTime:ID-mdat-size] MediaDataSize          : 1293664
[QuickTime:ID-mdat-offset] MediaDataOffset      : 126857


So it looks like the QuickTime Player and Photos.app want some extra tag or atom that vanishes if the UserData tag is edited in .mp4.

The best way seems to be to use Keys -- QuickTime Player shows DisplayName (Title1), Description, Author, Keywords and Photos.app 6.0 shows DisplayName (Title1), Description.

exiftool -m -P -overwrite_original_in_place -Keys:DisplayName='Title1' -Keys:Title='Title2' -Keys:Description='Description' -Keys:Author='Author' -Keys:Keywords='Keyword1,Keyword2' finalcutpro10.5.1.mp4
    1 image files updated

exiftool -a -G1:7 -s -ee -Keys:all finalcutpro10.5.1.mp4
[Keys:ID-12e1]  Author                          : Author
[Keys:ID-12e2]  Description                     : Description
[Keys:ID-12e3]  DisplayName                     : Title1
[Keys:ID-12e4]  Keywords                        : Keyword1,Keyword2
[Keys:ID-12e5]  Title                           : Title2


There seems to be very little info about this and it might be outdated. VLC and Subler seem to use ItemList for those tags.

https://developer.apple.com/library/archive/technotes/tn2174/_index.html
https://kdenlive.org/en/project/adding-meta-data-to-mp4-video/
https://filmora.wondershare.com/video-editing-tips/video-metadata-editor.html

My goal is to copy metadata from a spreadsheet to the old movies but it seems I still have to wait for a proper standard before doing so in a larger scale.

thanks,

- Matti