Change created date on imported .MP4 file from Phone MacOS

Started by Hrbo, December 29, 2022, 08:33:07 AM

Previous topic - Next topic

Hrbo

Hello

After importing videofiles from different phones (android) the created date are all the same, the date I imported them to my MacBook

Some files contain the correct date of creation stored in "last changed" date.
possible to copy that to creation date? what will the command be for that.

All files have the correct created date in their filenames "20210327_170231"
possible to use this as the source to copy that into created date?


would like to to this to all files in a directory

Will be happy for a solution for the problem, so sorting I several programs (iMovie for example) would be correct chronological


//Henrik

StarGeek

The basic command for copying from one tag into another is this.  The -api QuickTimeUTC option is also included to correct time stamps on a video file
exiftool -api QuickTimeUTC '-TARGET_TAG<SOURCE_TAG' /path/to/files/

So the next step is to figure out which tags you want to use.

Find a file that sorts correctly, then run this command on it.
exiftool -api QuickTimeUTC -time:all -G1 -a -s /path/to/files/

Look for a time stamp that shows the correct time.  That will be your "TARGET_TAG" target tag.  There may be more than one and you'll have to experiment to figure out the right one.  Or you can copy to multiple tags in the same command.  Just duplicate the '-TARGET_TAG<SOURCE_TAG' part for each tag you want to copy to.

Then you have to figure out what your "SOURCE_TAG" tag is by looking at a file that isn't sorting correctly.

Then run the command with the correct tag names on a test file to see if it works correctly.

For files that have the correct date with all 14 numbers (YearMonthDayHourMinuteSecond), you can use Filename as the "SOURCE_TAG".  Exiftool will properly parse the numbers as a date (see FAQ #5, paragraph starting "Having said this").
* 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).

Hrbo

#2
Thanx for answering, looking at the file it says:

======== /Users/henrik/Movies/Jeanette/20210327_170231.mp4
[System]        FileModifyDate                  : 2021:03:27 17:05:17+01:00
[System]        FileAccessDate                  : 2022:12:29 18:52:12+01:00
[System]        FileInodeChangeDate             : 2022:12:26 13:37:23+01:00
[QuickTime]     CreateDate                      : 2021:03:27 17:05:17+01:00
[QuickTime]     ModifyDate                      : 2021:03:27 17:05:17+01:00
[Track1]        TrackCreateDate                 : 2021:03:27 17:05:17+01:00
[Track1]        TrackModifyDate                 : 2021:03:27 17:05:17+01:00
[Track1]        MediaCreateDate                 : 2021:03:27 17:05:17+01:00
[Track1]        MediaModifyDate                 : 2021:03:27 17:05:17+01:00
[Track2]        TrackCreateDate                 : 2021:03:27 17:05:17+01:00
[Track2]        TrackModifyDate                 : 2021:03:27 17:05:17+01:00
[Track2]        MediaCreateDate                 : 2021:03:27 17:05:17+01:00
[Track2]        MediaModifyDate                 : 2021:03:27 17:05:17+01:00


so QuickTime date is correct. but in finder it says:
created: Tuesday, 1 February 2022 at 17:42.    (wrong date, needs to be corrected)
Modified: Saturday, 27 March 2021 at 17:05. (correct date)

looking at this it confuses me as the created date (actually date I copied files from phone to computer) is not to find at any tag in exiftool's listing?

StarGeek

Someone with Mac experience will have to comment.

But try adding
-api RequestAll=2
to the same command.  It might be that one of the Mac only file system tags is getting read.
* 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).

Hrbo

Adding as in last after file path?

======== /users/henrik/movies/Jeanette/20210327_170231.mp4
[ExifTool]      Now                             : 2022:12:29 20:53:24+01:00
[System]        FileModifyDate                  : 2021:03:27 17:05:17+01:00
[System]        FileAccessDate                  : 2022:12:29 20:05:39+01:00
[System]        FileInodeChangeDate             : 2022:12:26 13:37:23+01:00
[MacOS]         FileCreateDate                  : 2022:02:01 17:42:56+01:00
[MacOS]         MDItemContentCreationDate       : 2022:02:01 17:42:56+01:00
[MacOS]         MDItemContentCreationDate_Ranking: 2022:02:01 01:00:00+01:00
[MacOS]         MDItemContentModificationDate   : 2021:03:27 17:05:17+01:00
[MacOS]         MDItemContentModificationDate_Ranking: 2021:03:27 01:00:00+01:00
[MacOS]         MDItemDateAdded                 : 2022:12:26 13:37:19+01:00
[MacOS]         MDItemDateAdded_Ranking         : 2022:12:26 01:00:00+01:00
[MacOS]         MDItemFSContentChangeDate       : 2021:03:27 17:05:17+01:00
[MacOS]         MDItemFSCreationDate            : 2022:02:01 17:42:56+01:00
[MacOS]         MDItemInterestingDate_Ranking   : 2022:12:26 01:00:00+01:00
[MacOS]         MDItemLastUsedDate              : 2022:02:01 17:42:45+01:00
[MacOS]         MDItemUsedDates                 : 2022:02:01 00:00:00+01:00
[MacOS]         XAttrLastUsedDate               : 2022:02:01 16:42:45
[QuickTime]     CreateDate                      : 2021:03:27 17:05:17+01:00
[QuickTime]     ModifyDate                      : 2021:03:27 17:05:17+01:00
[Track1]        TrackCreateDate                 : 2021:03:27 17:05:17+01:00
[Track1]        TrackModifyDate                 : 2021:03:27 17:05:17+01:00
[Track1]        MediaCreateDate                 : 2021:03:27 17:05:17+01:00
[Track1]        MediaModifyDate                 : 2021:03:27 17:05:17+01:00
[Track2]        TrackCreateDate                 : 2021:03:27 17:05:17+01:00
[Track2]        TrackModifyDate                 : 2021:03:27 17:05:17+01:00
[Track2]        MediaCreateDate                 : 2021:03:27 17:05:17+01:00
[Track2]        MediaModifyDate                 : 2021:03:27 17:05:17+01:00



seems to me that [MacOS]         FileCreateDate                  : 2022:02:01 17:42:56+01:00. is the one to change

Phil Harvey

Adding at the end is fine.  Or almost anywhere else will work too.  The only exception is that it can't go between -api and QuickTimeUTC

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

Hrbo

so the command would look like this?

exiftool -api QuickTimeUTC '-FileCreateDate<FileModifyDate' /path/to/files/


as a real noob at this I guessing here? and that you need to insert the -api QuicktimeUTC as it is a videofile?  not needed att all if it was an jpeg


Phil Harvey

Yes.  But the -api QuickTimeUTC is unnecessary in this command because you aren't using any QuickTime tags.

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

Hrbo

thank you for your help

after installing some sdk files its all worked fine,
using both filename and filemodifydate as source.