Code to assign json to pics works, it screws up vids

Started by Spadez, June 05, 2020, 05:16:57 PM

Previous topic - Next topic

Spadez

Hi,

I ran the code to extract json details onto my images that I exported from google and it works perfectly. However nearly everyone of my .mov videos is set at some random year far far in the future of today's date.

This is the code I used:
exiftool -tagsfromfile '%d/%F.json' '-AllDates<PhotoTakenTimeTimestamp' -d %s -progress -r -P ~/Downloads/FinalPhoto/Output/

Is there a reason why this code would work perfectly for images (Jpg) but not for movies (mov)?

StarGeek

I'm assuming the missing detail is that the date appears in the future in Apple Photos?

The problem is that AllDates assigns values to the CreateDate, ModifyDate, and the DateTimeOriginal.  While this is fine for the first two, Apple Photos requires that there is a time zone value for DateTimeOriginal, otherwise you get the problem you've encountered.

Either add the time zone or remove the DateTimeOriginal tag.  I don't think anything but Apple Photos (maybe some other Apple programs) reads that tag so it's probably safe to remove.
* 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).

Spadez

Thank you. Can I check then please. Should I use these two commands:

exiftool -tagsfromfile '%d/%F.json' '-FileModifyDate<PhotoTakenTimeTimestamp' -d %s -progress -r -P ~/Downloads/FinalPhoto/Output/

exiftool -tagsfromfile '%d/%F.json' '-FileCreateDate<PhotoTakenTimeTimestamp' -d %s -progress -r -P ~/Downloads/FinalPhoto/Output/

And to check should it be FileCreateDate or CreateDate ?

Thank you

StarGeek

FileCreateDate and FileModifyDate are completely different tags than the CreateDate, ModifyDate, and the DateTimeOriginal that AllDates writes.  The first two are part of the underlying file system.  The latter three are data embedded in the file.

I would suggest using AllDates on image files and just using CreateDate, maybe ModifyDate, on video files.  I don't think adding ModifyDate to videos well help much, but it won't hurt.

You could use the -ext (extension) option to separate the commands.  -ext jpg for the jpgs and -ext mov -ext mp4 for the video files.
* 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).