Problems changing the quicktime creation date of a mov file

Started by craigdpenn, August 20, 2017, 01:10:48 AM

Previous topic - Next topic

craigdpenn

Hi there. I would like to change a specific tag (the one in red) that the following command lists.

exiftool -a -s -G1 -time:all theFile.mov

[System]        FileModifyDate                  : 2017:08:20 15:39:34+12:00
[System]        FileAccessDate                  : 2017:08:20 16:13:38+12:00
[System]        FileInodeChangeDate             : 2017:08:20 15:40:19+12:00
[QuickTime]     CreateDate                      : 2012:07:23 15:13:55
[QuickTime]     ModifyDate                      : 2017:08:20 03:39:34
[Track1]        TrackCreateDate                 : 2012:07:23 15:13:55
[Track1]        TrackModifyDate                 : 2017:08:20 03:39:34
[Track1]        MediaCreateDate                 : 2012:07:23 15:13:55
[Track1]        MediaModifyDate                 : 2017:08:20 03:39:34
[Track2]        TrackCreateDate                 : 2012:07:23 15:13:55
[Track2]        TrackModifyDate                 : 2017:08:20 03:39:34
[Track2]        MediaCreateDate                 : 2012:07:23 15:13:55
[Track2]        MediaModifyDate                 : 2017:08:20 03:39:34
[QuickTime]     CreationDate                    : 2012:07:23 16:13:55+01:00
[QuickTime]     ContentCreateDate               : 2012:07:23 16:13:55+01:00

I've tried the following command and variations of it but it gives an error

exiftool  -quicktime:creationdate="2012:07:24 16:13:55+12:00" theFile.mov

Warning: Tag 'quicktime:CreationDate' is not defined
Nothing to do.


I'm a bit stumped and would appreciate any help anyone may have.
Thanks in advance, Craig.


Stephen Marsh

It does not appear to be a writable tag:

https://exiftool.org/TagNames/QuickTime.html

Hayo Baan

CreationDate is indeed not a writable tag, using exiftool. I have written a little perl script with which you are able to change the tag. Have a look at it on GitHub: https://github.com/HayoBaan/matchDateTime
Hayo Baan – Photography
Web: www.hayobaan.nl

craigdpenn

Thank you for your matchDateTime perl script Hayo Baan. This worked for me.

I travel between London and Wellington, New Zealand, every year and have found the time zone tags have become a little mixed up.

When using Final Cut Pro on the Mac I was unable to get the Date/Time title, that overlays a movie file, to display the time correctly as it is taking its input from the [QuickTime] CreationDate tag instead of the files creation date.

It actually took quite a while just to find out which tag it was referencing?!

I'm now going to try and automate this through my 4860 videos. If you have any tips please let me know.

Thanks again, Craig.


Hayo Baan

Good to hear the script was helpful!

One tip I can give you is that QuickTime times should be in UTC, but since many cameras actually write the local time instead, Exiftool by default assumes the times are in local time. If you see discrepancies between the QuickTime times, it might be worthwhile to try to make Exiftool see QuickTime times as UTC. You do that by specifying -api QuickTimeUTC on the exiftool command line.
Hayo Baan – Photography
Web: www.hayobaan.nl

craigdpenn

Hello again Hayo.

I'm wanting to automate your matchDateTime perl script. I'm trying to accomplish this through applescript using the following 'do shell script' command.

do shell script ("/usr/local/bin/matchDateTime -tz 12  " & theFilePath)

But this creates the following error.

"Skipped: Unable to find FileModifyDate in /Volumes/Silver Passport 1TB/Test copy/2012 - 1 UK.MOV"

But when I run the exact same string in a terminal window it works fine.

/usr/local/bin/matchDateTime -tz 12  '/Volumes/Silver Passport 1TB/Test copy/2012 - 1 UK.MOV'

Updated CreationDate 2012-07-23T16:13:55+0100 => 2012-07-23T15:13:55+1200 in /Volumes/Silver Passport 1TB/Test copy/2012 - 1 UK.MOV (2 times)
OK: Changed date 2 times in /Volumes/Silver Passport 1TB/Test copy/2012 - 1 UK.MOV


I apologise if this is a bit off topic but it has had me stumped for a few days so I thought I'd ask as a last resort.

Any help would be appreciated. Thanks in advance, Craig.


Hubert

I think this may be an issue with your AppleScript coding - the path needs to be in single quotes just as it is in your command line script.

This should work:

do shell script ("/usr/local/bin/matchDateTime -tz 12  " & (quoted form of theFilePath))

Hope this helps.


H

Hayo Baan

If Hubert's suggestion does not work, can you send me the automater code so I can have a look at what happens?
Hayo Baan – Photography
Web: www.hayobaan.nl

craigdpenn

Hi there Hubert & Hayo. Thank you for your replies.

I tried your idea within the do shell script, Hubert, though I had already created the variable in this way at the start. It didn't seem to make a difference, unfortunately.

This is how I initaially set theFilePath variable :
set theFilePath to quoted form of POSIX path of theFilePath

I've attached the applescript file for you to take a look if you've got a moment.

MatchDateTime is running on my iMac from /usr/local/bin/matchDateTime

Though the script runs it doesn't change the file at all and result's in this error

"Skipped: Unable to find FileModifyDate in /Volumes/Silver Passport 1TB/Test copy/2017 - 3 USA.MOV"


Again thanks in advance, Craig

Hayo Baan

Weird, when there's only one file in the directory, the repeat loop doesn't work???

Anyway, after playing a bit (I needed to get some files that could be used), I can finally reproduce and solve your problem.

It has to do with the execution environment that is different between running from the command-line and from the Script Editor. When run from the editor, the path does not contain /usr/local/bin so matchDateTime can't find exiftool. If you prefix the do shell command with PATH=$PATH:/usr/local/bin; your script should work.
Hayo Baan – Photography
Web: www.hayobaan.nl

Hubert

Quote from: Hayo Baan on September 21, 2017, 07:09:54 AM
Weird, when there's only one file in the directory, the repeat loop doesn't work???

That's because if there's only one item in the folder, it's returned as a single Finder item rather than as a list containing a single Finder item.

Coercing to a list fixes it:

tell application "Finder" to set everyFile to (every file of entire contents of theUserFolder) as list

return item 1 of everyFile -- works even on a folder with one file in it

Hubert

Quote from: craigdpenn on September 21, 2017, 05:16:47 AM


I tried your idea within the do shell script, Hubert, though I had already created the variable in this way at the start. It didn't seem to make a difference, unfortunately.

This is how I initaially set theFilePath variable :
set theFilePath to quoted form of POSIX path of theFilePath


Ah, wasn't aware of that.  :)

craigdpenn

Thank you Hubert for the single file problem and thank you Hayo for the script environment fix. Both of these worked perfectly!

I can now move forward with taming my unkempt videos files. Very much appreciated, Craig.


Scarparo

Quote from: craigdpenn on September 22, 2017, 03:53:15 AM
Thank you Hubert for the single file problem and thank you Hayo for the script environment fix. Both of these worked perfectly!

I can now move forward with taming my unkempt videos files. Very much appreciated, Craig.

Craig, i'm newbie in this tool, and I have the same problem with my videos. Could you share your scripts to automate the process and work with list?