Adjust all movie dates

Started by wywh, January 16, 2021, 05:14:34 AM

Previous topic - Next topic

wywh

I tried to make a short filename-to-all-movie-dates command with exiftool 12.14. (I'd like to set also QuickTime Tracks the same although they are not used for sorting anywhere).

The timeshift with '-QuickTime:time:all+=' almost does this. But should also Keys and UserData use UTC time here?

exiftool -a -G1 -s -api QuickTimeUTC=1 -time:all 2002-0202-0202-02.m4v
[QuickTime]     CreateDate                      : 2002:02:02 02:02:02+02:00
[QuickTime]     ModifyDate                      : 2002:02:02 02:02:02+02:00
[Track1]        TrackCreateDate                 : 2002:02:02 02:02:02+02:00
[Track1]        TrackModifyDate                 : 2002:02:02 02:02:02+02:00
[Track1]        MediaCreateDate                 : 2002:02:02 02:02:02+02:00
[Track1]        MediaModifyDate                 : 2002:02:02 02:02:02+02:00
[UserData]      DateTimeOriginal                : 2002:02:02 02:02:02+02:00
[Keys]          CreationDate                    : 2002:02:02 02:02:02+02:00

exiftool -overwrite_original_in_place '-QuickTime:time:all+=18:4:4 3:4:4' 2002-0202-0202-02.m4v
    1 image files updated

exiftool -a -G1 -s -api QuickTimeUTC=1 -time:all 2002-0202-0202-02.m4v
[QuickTime]     CreateDate                      : 2020:06:06 06:06:06+03:00
[QuickTime]     ModifyDate                      : 2020:06:06 06:06:06+03:00
[Track1]        TrackCreateDate                 : 2020:06:06 06:06:06+03:00
[Track1]        TrackModifyDate                 : 2020:06:06 06:06:06+03:00
[Track1]        MediaCreateDate                 : 2020:06:06 06:06:06+03:00
[Track1]        MediaModifyDate                 : 2020:06:06 06:06:06+03:00
[UserData]      DateTimeOriginal                : 2020:06:06 05:06:06+02:00
[Keys]          CreationDate                    : 2020:06:06 05:06:06+02:00


But why doesn't a similar command work for the filename-to-dates (even with the added -m)?

exiftool -a -G1 -s -api QuickTimeUTC=1 -time:all 2020-0606-0606-06.m4v
[QuickTime]     CreateDate                      : 2020:06:06 06:06:06+03:00
[QuickTime]     ModifyDate                      : 2020:06:06 06:06:06+03:00
[Track1]        TrackCreateDate                 : 2020:06:06 06:06:06+03:00
[Track1]        TrackModifyDate                 : 2020:06:06 06:06:06+03:00
[Track1]        MediaCreateDate                 : 2020:06:06 06:06:06+03:00
[Track1]        MediaModifyDate                 : 2020:06:06 06:06:06+03:00
[UserData]      DateTimeOriginal                : 2020:06:06 05:06:06+02:00
[Keys]          CreationDate                    : 2020:06:06 05:06:06+02:00

exiftool -overwrite_original_in_place -api QuickTimeUTC=1 '-QuickTime:time:all<filename' 2020-0606-0606-06.m4v
Warning: [minor] The ExtractEmbedded option may find more tags in the media data - 2020-0606-0606-06.m4v
Warning: No writable tags set from 2020-0606-0606-06.m4v
    0 image files updated
    1 image files unchanged


'-AllDates' works also for UserData (UTC time here) but of course fails to update Tracks and Keys and adds unnecessary (?) XMP unless '-wm w' is added:

exiftool -a -G1 -s -api QuickTimeUTC=1 -time:all 2020-0606-0606-06.m4v
[QuickTime]     CreateDate                      : 2002:02:02 02:02:02+02:00
[QuickTime]     ModifyDate                      : 2002:02:02 02:02:02+02:00
[Track1]        TrackCreateDate                 : 2002:02:02 02:02:02+02:00
[Track1]        TrackModifyDate                 : 2002:02:02 02:02:02+02:00
[Track1]        MediaCreateDate                 : 2002:02:02 02:02:02+02:00
[Track1]        MediaModifyDate                 : 2002:02:02 02:02:02+02:00
[UserData]      DateTimeOriginal                : 2002:02:02 02:02:02+02:00
[Keys]          CreationDate                    : 2002:02:02 02:02:02+02:00

exiftool -overwrite_original_in_place -api QuickTimeUTC=1 '-AllDates<filename' 2020-0606-0606-06.m4v
Warning: [minor] The ExtractEmbedded option may find more tags in the media data - 2020-0606-0606-06.m4v
    1 image files updated

exiftool -a -G1 -s -api QuickTimeUTC=1 -time:all 2020-0606-0606-06.m4v
[QuickTime]     CreateDate                      : 2020:06:06 06:06:06+03:00
[QuickTime]     ModifyDate                      : 2020:06:06 06:06:06+03:00
[Track1]        TrackCreateDate                 : 2002:02:02 02:02:02+02:00
[Track1]        TrackModifyDate                 : 2002:02:02 02:02:02+02:00
[Track1]        MediaCreateDate                 : 2002:02:02 02:02:02+02:00
[Track1]        MediaModifyDate                 : 2002:02:02 02:02:02+02:00
[UserData]      DateTimeOriginal                : 2020:06:06 06:06:06+03:00
[Keys]          CreationDate                    : 2002:02:02 02:02:02+02:00
[XMP-exif]      DateTimeOriginal                : 2020:06:06 06:06:06
[XMP-xmp]       CreateDate                      : 2020:06:06 06:06:06
[XMP-xmp]       ModifyDate                      : 2020:06:06 06:06:06


- Matti

Phil Harvey

Hi Matti,

Quote from: wywh on January 16, 2021, 05:14:34 AM
The timeshift with '-QuickTime:time:all+=' almost does this. But should also Keys and UserData use UTC time here?

No.  These are simple strings which include the time zone in the string, so they are not affected by the QuickTimeUTC option.

Quoteexiftool -overwrite_original_in_place -api QuickTimeUTC=1 '-QuickTime:time:all<filename' 2020-0606-0606-06.m4v

If you add -v3 to this command, you will see this message:

Sorry, quicktime:time:FileName doesn't exist or isn't writable

for this reason (from the application documentation):

        A destination group and/or tag name of "All" or "*" writes to the same
        family 1 group and/or tag name as the source.


Quote'-AllDates' works also for UserData (UTC time here) but of course fails to update Tracks and Keys and adds unnecessary (?) XMP unless '-wm w' is added:

from the QuickTime Tags documentation:

        When writing, ExifTool creates both QuickTime and XMP tags by default, but
        the group may be specified to write one or the other separately.


- 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 January 21, 2021, 11:08:53 AM
These are simple strings which include the time zone in the string, so they are not affected by the QuickTimeUTC option.

Thanks for the replies! And thanks for the new production release 12.16 that adds more features to inspect movie dates (enhanced -ee option with -ee2 and -ee3 to allow parsing of the H264 video stream in MP4 files).

https://exiftool.org/forum/index.php?topic=9304.0

Phil Harvey

Quote from: Phil Harvey on January 21, 2021, 11:08:53 AM
Quoteexiftool -overwrite_original_in_place -api QuickTimeUTC=1 '-QuickTime:time:all<filename' 2020-0606-0606-06.m4v

If you add -v3 to this command, you will see this message:

Sorry, quicktime:time:FileName doesn't exist or isn't writable

for this reason (from the application documentation):

        A destination group and/or tag name of "All" or "*" writes to the same
        family 1 group and/or tag name as the source.

I should have also pointed out this from the application documentation:

        Finally, the behaviour is different when a destination tag or
        group of "All" is used.  When copying directly, a destination
        group and/or tag name of "All" writes to the same family 1 group
        and/or tag name as the source.  But when interpolated in a string,
        the identity of the source tags are lost and the value is written
        to all possible groups/tags.  For example, the string form must be
        used in the following command since the intent is to set the value
        of all existing date/time tags from "CreateDate":

                exiftool "-time:all<$createdate" -wm w FILE


- 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 ($).