Problem with change creation time on MP4 files

Started by michelemengascini, April 09, 2023, 05:52:28 PM

Previous topic - Next topic

michelemengascini

Hi everyone, I've been trying for almost two days to do this simple operation, to change creation date of some .mp4 files, taken from a dashcam.
I created a small script on python, to extract from filename the date and time of file creation, but for some limitations I can only set them to "FileModifyDate" and "FileAccessDate".
I had initially tried to extract from a sample string "EMER230408-200802-001027.MP4" this information, but did not get what I wanted.

Now with python I can set those two values correctly, but with exiftool I cannot set the creation date as it should be.

The command I run is as follows.
exiftool '-CreateDate<FileModifyDate' -overwrite_original_in_place /actual/folder/path which correctly gets me the value if I pass it a specific file as input, but if I pass it the whole folder, or through -ext MP4, I get some kind of reset of these timestamps set through python. If viewed through either system properties (fedora), or even through exiftool -time:all -s /path/file.MP4 they are correctly set before going to exiftool.

Now what I would like to do is the following, set -AllDates to -FileModifyDate, on all files in the folder, could someone give me some advice?

Phil Harvey

Add the -P option to preserve filesystem date/times when writing with ExifTool.

But the CreateDate should be set properly by your initial command.  Add the -v2 option to see more details about exactly what ExifTool is writing.

- 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

One additional note, you're copying the local time (FileModifyDate) into a tag which is supposed to be set to UTC (Quicktime:CreateDate).

My standard copy/paste regarding video time stamps

Most video time stamps are supposed to be set to UTC and the program is supposed to adjust this to the local time zone when displayed (see 4th paragraph on the Quicktime tags page), with the most common exceptions being the Quicktime:CreationDate (not to be confused with the Quicktime:CreateDate) and the Quicktime:DateTimeOriginal.

If your computer is in the same time zone as where the video was shot, ignoring differences for Daylight/Summer time, then you can add the -api QuickTimeUTC option and exiftool will automatically adjust the time to UTC.  Otherwise, you either have to figure out the UTC yourself or use this -api option and include the correct time zone, e.g. "2023:02:03 04:05:06±07:00".

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

michelemengascini