ExifTool Forum

General => Metadata => Topic started by: MrSimmo on May 28, 2024, 11:48:01 AM

Title: Video file creation date not reading after update?
Post by: MrSimmo on May 28, 2024, 11:48:01 AM
Hi all,

Wonder if you could help me?

I've used Photomator to batch convert a bunch of HEIC files to still image MP4 video files. This works fine but it didn't copy across the original creation dates from the HEIC source files.

So I used exiftool to do that - using this script (MacOS) -

for file in ./*.heic; do
    exiftool -overwrite_original -TagsFromFile "$file" "-CreateDate>alldates" "${file%.heic}.mp4"
done


When I run exiftool to analyse any of the mp4 files, all the dates have been updated as planned...but

When I look at the mp4 file in Mac OS's Finder or when I import the mp4 file into DaVinci resolve; the creation date is still listed as the wrong date rather than the exif tags that I've just written.


Does anyone know how I can fix this?


Many Thanks
Title: Re: Video file creation date not reading after update?
Post by: Phil Harvey on May 28, 2024, 02:15:46 PM
MacOS Finder shows the filesystem FileCreateDate as the creation date.  AllDates is a shortcut for the common EXIF date/time tags, and doesn't include FileCreateDate.  Try adding "-CreateDate>FileCreateDate" to your command, and maybe write FileModifyDate as well.

- Phil
Title: Re: Video file creation date not reading after update?
Post by: MrSimmo on May 29, 2024, 03:18:26 AM
Great stuff, thanks Phil - works a treat. Thanks!


This is what I updated the script to for anybody who has similar question in the future:

for file in ./*.heic; do
    exiftool -overwrite_original -TagsFromFile "$file" "-CreateDate>alldates" "-CreateDate>FileCreateDate" "-CreateDate>FileModifyDate" "${file%.heic}.mp4"
done
Title: Re: Video file creation date not reading after update?
Post by: Phil Harvey on May 29, 2024, 10:11:43 AM
This is common mistake #3 (https://exiftool.org/mistakes.html#M3).

You can do this in a single ExifTool command.  I could give you the command, but I don't know that "${file%.heic}.mp4" is doing.  Maybe it is replacing the ".heic" with ".mp4", in which case the command could be:

exiftool -overwrite_original -TagsFromFile %d%f.heic "-CreateDate>alldates" "-CreateDate>FileCreateDate" "-CreateDate>FileModifyDate" -ext mp4 .

- Phil
Title: Re: Video file creation date not reading after update?
Post by: MrSimmo on July 22, 2024, 01:38:54 PM
Quote from: Phil Harvey on May 29, 2024, 10:11:43 AMThis is common mistake #3 (https://exiftool.org/mistakes.html#M3).

You can do this in a single ExifTool command.  I could give you the command, but I don't know that "${file%.heic}.mp4" is doing.  Maybe it is replacing the ".heic" with ".mp4", in which case the command could be:

exiftool -overwrite_original -TagsFromFile %d%f.heic "-CreateDate>alldates" "-CreateDate>FileCreateDate" "-CreateDate>FileModifyDate" -ext mp4 .

- Phil

Thanks Phil - my script was reading the tags from a batch of source .heic files and then applying them to the converted .mp4 files. Sorry - my mistake for not including the narrative