ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Andrey Kazak on January 15, 2025, 12:47:42 PM

Title: Rename iOS MOV/MP4 files using com.apple.quicktime.creationdate
Post by: Andrey Kazak on January 15, 2025, 12:47:42 PM
Greetings!

I try to automate renaming a set of MOV/MP4 files using com.apple.quicktime.creationdate.

exiftool.exe -CreationDate  test.movreturns
QuoteCreation Date                   : 2025:01:02 11:34:42+01:00

However,
exiftool.exe "-filename<CreationDate" -d "%Y-%m-%d %H-%M-%S.%le" test.movreturns:
QuoteWarning: [minor] The ExtractEmbedded option may find more tags in the media data - test.mov
Warning: New file name is empty - test.mov
    0 image files updated
    1 image files unchanged

How do I ask exiftool to parse
Quote2025:01:02 11:34:42+01:00
to the following file name:
Quote2025-01-02 11-34-42+0100.mov
?

Thank you.

Title: Re: Rename iOS MOV/MP4 files using com.apple.quicktime.creationdate
Post by: StarGeek on January 15, 2025, 01:29:37 PM
What OS? If Windows, is this a batch file? If so, then FAQ #27, My ExifTool command doesn't work from a Windows .BAT file (https://exiftool.org/faq.html#Q27)

To add the time zone, you would add the %z variable. See Common Date Format Codes (https://exiftool.org/filename.html#codes).
Title: Re: Rename iOS MOV/MP4 files using com.apple.quicktime.creationdate
Post by: wywh on January 15, 2025, 01:36:05 PM
Try something like this and fine-tune to your liking (I prefer no spaces in file names. Check StarGeek's link if you want also time zone):

exiftool -m -P -fileOrder5 FileName -api QuickTimeUTC=1 "-FileName<QuickTime:CreateDate" -d "%Y-%m%d-%H%M-%S%%+2nc.%%e" movie.mov
Replace QuickTime:CreateDate with Keys:CreationDate or just CreationDate, if necessary. Usually they are the same, but sometimes the original date might be in CreationDate or vice versa.