ExifTool Forum

ExifTool => Newbies => Topic started by: user56468 on June 24, 2020, 10:58:22 PM

Title: Modify Date Taken from filename in video
Post by: user56468 on June 24, 2020, 10:58:22 PM
I converted all my home video's with Handbrake but the "Date Taken" field has changed to a recent date.

The filename for example is 'Vid 20160131 204350' and with Advanced Renamer i changed Modify, Create, Last Opened but Date Taken still stays the same.

Is there an command in my case? I hope so because this give me sorting problems in OneDrive.

I tried "-datetimeoriginal<filemodifydate" -P -overwrite_original DIR" without any succes.

See attachments.

Thank you very much.
Title: Re: Modify Date Taken from filename in video
Post by: StarGeek on June 24, 2020, 11:25:57 PM
While DateTimeOriginal exists in video files, it's not the tag that Windows reads (Apple Photos does but also needs a timezone).

Handbrake will change these tags to the current time (not sure if it's when the writing starts or ends)
CreateDate
ModifyDate
TrackCreateDate
TrackModifyDate
MediaCreateDate
MediaModifyDate


The first is the one that Windows will read and display under Properties, though you can change the others as well.

I'm guessing that the filename is the date/time that you want the video to be set to?  If so, you could run this command:
exiftool -api QuickTimeUTC "-CreateDate<Filename" /path/to/files

If you wanted to update all the above timestamps, you could use
exiftool -api QuickTimeUTC "-CreateDate<Filename" "-ModifyDate<Filename" "-Track*Date<Filename" "-Media*Date<Filename" /path/to/files

These commands create backup files.  Add -Overwrite_Original (https://exiftool.org/exiftool_pod.html#overwrite_original) to suppress the creation of backup files.  Add -r (https://exiftool.org/exiftool_pod.html#r-.--recurse) to recurse into subdirectories. 
Title: Re: Modify Date Taken from filename in video
Post by: user56468 on June 25, 2020, 08:42:39 AM
Thank you so much sir for contributing in your free time to help other people! It works, changed hundreds of video's in a few seconds ❤.