Custom Shortcut not working consistently?

Started by jamiboi, February 03, 2022, 06:55:27 PM

Previous topic - Next topic

jamiboi

I have added the following shortcuts to my config:

%Image::ExifTool::UserDefined::Shortcuts = (
VidCreate => ['CreateDate','FileCreateDate'],
PicCreate => ['CreateDate','DateTimeOriginal'],

);


The following command should therefore change both  CreateDate and FileCreateDate to exactly the same date/time, equal to the user-defined "MyDate"

exiftool "-VidCreate<MyDate"  "C:\Users\gyero\Dropbox\PC (2)\Downloads\MOVS"

However, it doesn't seem to consistently change the FileCreateDate value for all MOV files in my directory I have tested the code against individual files and it works. However when I run it through an entire folder, I find instances where FileCreateDate has not changed.

Any help would be appreciated!


StarGeek

Does it happen when you run it on files that are not in your DropBox?  There is the possibility that DropBox is interfering or resetting the time.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

jamiboi

Hi, Thanks for your response! I am afraid that this did not resolve the issue. Perhaps I have specified the shortcuts incorrectly but I cannot spot my mistake.

StarGeek

Ok, this is very strange.  If I write any embedded tag, then the FileCreateDate won't change.  But it will change if I'm only writing FileCreateDate and FileModifyDate.

Here I'm writing a random time to FileCreateDate, FileModifyDate, and Quicktime:CreateDate.  There's no change to FileCreateDate until I remove the write to Quicktime:CreateDate.
C:\>exiftool -G1 -a -s -api QuickTimeUTC -CreateDate -FileCreateDate -FileModifyDate Y:\!temp\aa\Test.mp4
[QuickTime]     CreateDate                      : 2022:02:04 08:32:43-08:00
[System]        FileCreateDate                  : 2022:02:04 08:32:43-08:00
[System]        FileModifyDate                  : 2022:02:04 08:32:43-08:00

C:\>exiftool -d %s "-Quicktime:CreateDate<${Filename;$_=int(rand(1643989411))}" "-FileCreateDate<${Filename;$_=int(rand(1643989411))}" "-FileModifyDate<${Filename;$_=int(rand(1643989411))}" Y:\!temp\aa\Test.mp4
    1 image files updated

C:\>exiftool -G1 -a -s -api QuickTimeUTC -CreateDate -FileCreateDate -FileModifyDate Y:\!temp\aa\Test.mp4
[QuickTime]     CreateDate                      : 1982:12:26 20:22:30-08:00
[System]        FileCreateDate                  : 2022:02:04 08:32:43-08:00
[System]        FileModifyDate                  : 2016:01:25 13:02:27-08:00

C:\>exiftool -d %s "-FileCreateDate<${Filename;$_=int(rand(1643989411))}" "-FileModifyDate<${Filename;$_=int(rand(1643989411))}" Y:\!temp\aa\Test.mp4
    1 image files updated

C:\>exiftool -G1 -a -s -api QuickTimeUTC -CreateDate -FileCreateDate -FileModifyDate Y:\!temp\aa\Test.mp4
[QuickTime]     CreateDate                      : 1982:12:26 20:22:30-08:00
[System]        FileCreateDate                  : 1987:09:25 03:38:48-07:00
[System]        FileModifyDate                  : 1988:10:19 23:45:17-07:00


Adding -v3 to the command shows that exiftool is attempting to write the FileCreateDate (see second to last line), but it isn't working
C:\>exiftool -d %s "-Quicktime:CreateDate<${Filename;$_=int(rand(1643989411))}" "-FileCreateDate<${Filename;$_=int(rand(1643989411))}" "-FileModifyDate<${Filename;$_=int(rand(1643989411))}" -v2 Y:\!temp\aa\Test.mp4
======== Y:/!temp/aa/Test.mp4
Setting new values from Y:/!temp/aa/Test.mp4
Writing QuickTime:CreateDate if tag exists
Writing File:FileCreateDate
Writing File:FileModifyDate
Rewriting Y:/!temp/aa/Test.mp4...
  FileType = MP4
  FileTypeExtension = MP4
  MIMEType = video/mp4
  Editing tags in: File ItemList MOV Meta Movie QuickTime UserData
  Creating tags in: File
  Rewriting Movie
  Rewriting MovieHeader
    - MovieHeader:CreateDate = '2492655750'
    + MovieHeader:CreateDate = '3149190200'
  Rewriting Track
  Rewriting TrackHeader
  Rewriting Media
  Rewriting MediaHeader
  Rewriting MediaInfo
  Rewriting DataInfo
  Rewriting DataRef
  Rewriting SampleTable
  Rewriting Track
  Rewriting TrackHeader
  Rewriting Media
  Rewriting MediaHeader
  Rewriting MediaInfo
  Rewriting DataInfo
  Rewriting DataRef
  Rewriting SampleTable
    + FileModifyDate = '259704397'
    + FileCreateDate = '815739205'
    1 image files updated


I honestly don't know if this is something recently changed with Windows (I'm using Windows 10), because I rarely write the FileCreateDate.  I tried going back to exiftool ver 11.60 and the results were the same.  There's no problem changing FileModifyDate either way.

My only suggestion at this point is to write FileCreateDate separately from any embedded data.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

jamiboi