Iphone videos change to Date Taken

Started by rebmamber, July 10, 2023, 02:51:06 PM

Previous topic - Next topic

rebmamber

Hello, thank you for all the replies. I have read through tons of them, FAQ, etc, but I just can't get anything to work for me. I used to code Fortran in college, so I know how one character can ruin everything!

Anyway, I have downloaded photos and videos from iPhoto onto my mac. The photos retain the correct date, but the videos are the date the file is added to my computer. I am hoping to organize all file in Lightroom and iMovie to make some projects, so sequential dates is crucial. I have a whole folder of video files with the wrong date, can you please help me with the proper commands? Below are a few failed attempts.

ambers-laptop-3:~ rebmamber$ exiftool -ver
12.64
ambers-laptop-3:~ rebmamber$ exiftool -filecreatedate -createdate
No file specified
ambers-laptop-3:~ rebmamber$ exiftool -filecreatedate -createdate /Users/rebmamber/Pictures/2023-06-GREECE/GREECE TEST3
Error: File not found - /Users/rebmamber/Pictures/2023-06-GREECE/GREECE
Error: File not found - TEST3
    0 image files read
    2 files could not be read
ambers-laptop-3:~ rebmamber$ exiftools /Users/rebmamber/Pictures/2023-06-GREECE/GREECE\ TEST3/greecetest3\ -\ 2.mov
-bash: exiftools: command not found
ambers-laptop-3:~ rebmamber$ exiftool "-FileCreateDate<CreateDate" -ext Mov /Users/rebmamber/Pictures/GREECE\ TEST/IMG_2901.MOV
Warning: [minor] The ExtractEmbedded option may find more tags in the media data - /Users/rebmamber/Pictures/GREECE TEST/IMG_2901.MOV
Warning: Error 256 running "/usr/bin/setfile" to set FileCreateDate - /Users/rebmamber/Pictures/GREECE TEST/IMG_2901.MOV
    0 image files updated
    1 files weren't updated due to errors
ambers-laptop-3:~ rebmamber$ exiftool '-filemodifydate<createdate' '-filecreatedate<createdate' -r /Users/rebmamber/Pictures/GREECE\ TEST/IMG_2901.MOV
Warning: [minor] The ExtractEmbedded option may find more tags in the media data - /Users/rebmamber/Pictures/GREECE TEST/IMG_2901.MOV
Warning: Error 256 running "/usr/bin/setfile" to set FileCreateDate - /Users/rebmamber/Pictures/GREECE TEST/IMG_2901.MOV
    1 image files updated
ambers-laptop-3:~ rebmamber$

rebmamber

Oh, and the files are a combination of .MP4 and .mov, not sure if that matters.

rebmamber

#2
Holy cow, 2 days later, I don't know what iteration, I finally got something to work!! This is the command that I used (Drag folder is obviously where I dragged the folder I wanted to convert, it was not written in the command).

exiftool DRAGFOLDERHERE '-FileModifyDate<CreationDate'

This worked only on .mov files. The .MP4 files remained unchanged. So, wondering if there is a command which would take care of .MP4 or even both together, but I am happy to process them separately.

Phil Harvey

Try using CreateDate instead of CreationDate.  Also, you may need to add -api quicktimeutc if CreateDate is stored as UTC.

This command of yours wasn't working:

exiftool -filecreatedate -createdate /Users/rebmamber/Pictures/2023-06-GREECE/GREECE TEST3

because you need quotes around arguments with spaces.  ie)

exiftool -filecreatedate -createdate "/Users/rebmamber/Pictures/2023-06-GREECE/GREECE TEST3"

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

StarGeek

#4
Quote from: rebmamber on July 10, 2023, 02:51:06 PMambers-laptop-3:~ rebmamber$ exiftool -filecreatedate -createdate /Users/rebmamber/Pictures/2023-06-GREECE/GREECE TEST3
Error: File not found - /Users/rebmamber/Pictures/2023-06-GREECE/GREECE
Error: File not found - TEST3
    0 image files read
    2 files could not be read

As Phil said, you need quotes around it.  The clue here is that it says two files couldn't be read.  As you've learned, you can drag/drop files onto the command line.

Quoteambers-laptop-3:~ rebmamber$ exiftools /Users/rebmamber/Pictures/2023-06-GREECE/GREECE\ TEST3/greecetest3\ -\ 2.mov
-bash: exiftools: command not found

There's an S at end of exiftool.  That's why the command isn't found.

Quoteambers-laptop-3:~ rebmamber$ exiftool "-FileCreateDate<CreateDate" -ext Mov /Users/rebmamber/Pictures/GREECE\ TEST/IMG_2901.MOV
Warning: [minor] The ExtractEmbedded option may find more tags in the media data - /Users/rebmamber/Pictures/GREECE TEST/IMG_2901.MOV
Warning: Error 256 running "/usr/bin/setfile" to set FileCreateDate - /Users/rebmamber/Pictures/GREECE TEST/IMG_2901.MOV
    0 image files updated
    1 files weren't updated due to errors

The Warning: [minor] The ExtractEmbedded option can be ignored.  This is to let you know that there might be more data in the file and the -ee (-extractEmbedded) option can be used to check for it.  Most commonly, this would be GPS data, which can be extensive, so it's not extracted by default.

The second error is because you seem to be using a Linux machine and FileCreateDate doesn't exist in Linux, only Mac/Windows.[/quote]
* 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).

rebmamber

I am on a Mac, so not sure what made you think Linux. But, I see some of the previous errors. They were all just copy/paste from forums on here, so I really wasn't sure what I was doing.  ;D

rebmamber

#6
Quote from: Phil Harvey on July 11, 2023, 07:34:26 AMTry using CreateDate instead of CreationDate.  Also, you may need to add -api quicktimeutc if CreateDate is stored as UTC.

This command of yours wasn't working:

exiftool -filecreatedate -createdate /Users/rebmamber/Pictures/2023-06-GREECE/GREECE TEST3

because you need quotes around arguments with spaces.  ie)

exiftool -filecreatedate -createdate "/Users/rebmamber/Pictures/2023-06-GREECE/GREECE TEST3"

- Phil

Ok, so I had a few additional files and now, even though I am using the EXACT command that I used yesterday (copy/paste), now it is not working for these new .mov files? I am so confused! I used the command above with the quotes as Phil suggested (though I had to use single quotes for Mac) and it outputs the correct creation date in Terminal, but it's not actually changing it on the file so that it will be recognized by Finder or another program. When I put in the exact command from yesterday, it just gives me a blank cursor, not even an error message. But again, nothing is changing on the file like it worked yesterday. I swear I'm not crazy, but I feel like it!! 😂 (below first is the command from Phil, then the same one I used yesterday which leads to a blank cursor)

ambers-laptop-3:~ rebmamber$ exiftool -filecreatedate -createdate '/Users/rebmamber/Pictures/GREECETEST3/Video.mov'
File Creation Date/Time        : 2023:07:11 13:39:36-04:00
Create Date                    : 2023:06:09 18:59:41
ambers-laptop-3:~ rebmamber$ exiftool /Users/rebmamber/Pictures/GREECETEST3/Video.mov '-FileModifyDate<CreationDate'
>

rebmamber

And one more issue, even though the new date is changed in Finder, when I import into Lightroom, it's still accessing the date they were added to the computer. This may be outside your realm on here, but figured I would ask, what else possibly would we need to change for it to recognize it? In Finder, the Created and Modified are the right date.

StarGeek

Quote from: rebmamber on July 10, 2023, 05:15:41 PMThis worked only on .mov files. The .MP4 files remained unchanged. So, wondering if there is a command which would take care of .MP4 or even both together, but I am happy to process them separately.

It helps to know what the exiftool output said.  That command will work on any file that exiftool can read as long as there is a CreationDate in the file.  If there isn't one, then exiftool should return Warning: No writable tags set

You can use this command to see all the time stamps in the file.
exiftool -time:all -G1 -a -s /path/to/files/

One thing to take note of is that many video time stamps are UTC and would need the -api QuickTimeUTC option to adjust the output to local 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).

StarGeek

Quote from: rebmamber on July 11, 2023, 01:52:08 PMI am on a Mac, so not sure what made you think Linux.

It was the fact that you weren't able to set the FileCreateDate, though re-reading the error, it seems that maybe you don't have the setfile command installed.  I'm not on Mac, so I'm not sure.


* 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).

rebmamber

#10
Quote from: StarGeek on July 11, 2023, 03:13:19 PMYou can use this command to see all the time stamps in the file.
exiftool -time:all -G1 -a -s /path/to/files/

Thank you for your replies. I'm sorry I am so new to this, it's like learning a foreign language! I ran the command that you listed in your reply, and this is what the output is. The only correct date is the last one listed as [Keys] Creation Date. Does that help? The weirdest thing is the command I finally got to work on a test batch of files now won't work at all!! I just get a blank cursor, no errors. I've been trying to get this to work for 3 days 😵�💫


ambers-laptop-3:~ rebmamber$ exiftool -time:all -G1 -a -s /Users/rebmamber/Pictures/GREECETESTING2/greecetesting2\ -\ 2.mov
[System]        FileModifyDate                  : 2023:07:12 10:08:11-04:00
[System]        FileAccessDate                  : 2023:07:12 10:12:18-04:00
[System]        FileInodeChangeDate            : 2023:07:12 10:08:26-04:00
[QuickTime]    CreateDate                      : 2023:07:12 14:08:11
[QuickTime]    ModifyDate                      : 2023:07:12 14:08:11
[Track1]        TrackCreateDate                : 2023:07:12 14:08:11
[Track1]        TrackModifyDate                : 2023:07:12 14:08:11
[Track1]        MediaCreateDate                : 2023:07:12 14:08:11
[Track1]        MediaModifyDate                : 2023:07:12 14:08:11
[Track2]        TrackCreateDate                : 2023:07:12 14:08:11
[Track2]        TrackModifyDate                : 2023:07:12 14:08:11
[Track2]        MediaCreateDate                : 2023:07:12 14:08:11
[Track2]        MediaModifyDate                : 2023:07:12 14:08:11
[Track3]        TrackCreateDate                : 2023:07:12 14:08:11
[Track3]        TrackModifyDate                : 2023:07:12 14:08:11
[Track3]        MediaCreateDate                : 2023:07:12 14:08:11
[Track3]        MediaModifyDate                : 2023:07:12 14:08:11
[Track4]        TrackCreateDate                : 2023:07:12 14:08:11
[Track4]        TrackModifyDate                : 2023:07:12 14:08:11
[Track4]        MediaCreateDate                : 2023:07:12 14:08:11
[Track4]        MediaModifyDate                : 2023:07:12 14:08:11
[Keys]          CreationDate                    : 2023:06:03 05:33:47-04:00
ambers-laptop-3:~ rebmamber$

rebmamber

#11
Ok, and one more thing. I don't know what I did, but on my 50th retry 😂 I got the command to work again. After it changes the dates that I see in Finder, I ran the command to see the time stamps in the updated files. This is what I get.

ambers-laptop-3:~ rebmamber$ exiftool -filecreatedate -createdate '/Users/rebmamber/Pictures/GREECETESTING2/greecetesting2-8.mov'
File Creation Date/Time        : 2023:06:03 13:45:49-04:00
Create Date                    : 2023:07:12 14:08:12
ambers-laptop-3:~ rebmamber$

So, the Create Date is still incorrect, but the File Creation Date/Time is correct. I suppose lightroom is accessing the Create Date rather than the File Creation Date? Is there a way I can command to change that too?

wywh

Quote from: rebmamber on July 12, 2023, 10:17:24 AMonly correct date is the last one listed as [Keys] Creation Date

I always add '-api QuickTimeUTC=1' to all time-related commands because it converts movie QuickTime:CreateDate UTC times to local times and does not affect local image dates:

exiftool -a -G1 -s -fileOrder5 FileName -api LargeFileSupport=1 -api QuickTimeUTC=1 -Time:All .

In iOS movies Keys:CreationDate (or in some non-Apple movies UserData:DateTimeOriginal) have the timezone as '2004:04:04 12:04:04+02:00' and in images in ExifIFD:OffsetTime* as '-08:00'. GPS location and GPS:GPSTimeStamp might also affect sorting in some apps <sigh>.

In some apps .mp4, .m4v and .mov might behave differently <sigh>.

If Keys:CreationDate displays the correct time, I suspect that some workflow has changed the QuickTime:CreateDate and file dates?

...but I wonder how greecetesting .mov 'Keys:CreationDate:2023:06:03 05:33:47-04:00' has timezone -04:00 when Greece is +02 or (at 2023:06:03) +03 DST?

- Matti

- Matti

StarGeek

Quote from: rebmamber on July 12, 2023, 11:45:19 AMSo, the Create Date is still incorrect, but the File Creation Date/Time is correct. I suppose lightroom is accessing the Create Date rather than the File Creation Date? Is there a way I can command to change that too?

If the CreationDate is correct, then you could use
exiftool -api QuickTimeUTC '-CreateDate<CreationDate' /path/to/files/

or to change all the other time tags
exiftool -api QuickTimeUTC '-CreateDate<CreationDate' '-ModifyDate<CreationDate' '-Track*Date<CreationDate' '-Media*Date<CreationDate' /path/to/files/

If the FileCreateDate is the correct one, just swap that for CreationDate.

Maybe one problem that popped up is the quotes.  If I recall correctly, on some Mac systems, the regular quotes would automatically get swapped with fancy/curly quotes


edit:  I tried to show the different quotes, but the forum changed them to regular quotes for me.  Might just be my old browser though.  Added image instead
* 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).

rebmamber

Quote from: StarGeek on July 13, 2023, 11:28:17 AMor to change all the other time tags
exiftool -api QuickTimeUTC '-CreateDate<CreationDate' '-ModifyDate<CreationDate' '-Track*Date<CreationDate' '-Media*Date<CreationDate' /path/to/files/

If the FileCreateDate is the correct one, just swap that for CreationDate.

So, I tried the commands above and oddly, they change it today! Not even the date that the files were downloaded as before, but they now say today. I tired the command with both CreateDate and FileCreateDate in the part after < and it was the same result. I'm just so confused! 😂

Luckily, the exiftool DRAGFOLDERHERE '-FileModifyDate<CreationDate' is still working to change the dates back to the correct dates, the videos are still just not recognized in Lightroom with these dates. I really liked your idea of changing all the possible date/times to the Date Taken, so I would love to see if there is a tweak you can think of that might make this work??