Override "DateTimeOriginal" with the first numbers (the date) of my images

Started by mariebb, November 16, 2022, 03:43:08 PM

Previous topic - Next topic

mariebb

My filename system:
20221116-213900-name-camera-0001.jpg
yyyymmdd-hhmmss...

I export either jpg's, png's or for video mp4 and mov.

Background:
I'm annoyed by Google Photos – it always sets the date to the time I exported the photos / videos, and not the damn real date!

From Germany,
– Marie

Phil Harvey

Hi Marie,

Use this command to set DateTimeOriginal from your file name for all files in directory DIR:

exiftool "-datetimeoriginal<filename" DIR

But I'm not sure you really want to set DateTimeOriginal.  Use this ExifTool command to see what date/times you really want to change:

exiftool -a -G1 -s -time:all FILE

I'm guessing you probably want to set FileModifyDate and/or FileCreateDate or something like that, which are the filesystem date/times.

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

mariebb

Hi Phil!

Thanks for the answer – I'll try it out, with some backuped footage, right now.

But: my filename contains more than just the date, in fact, it looks like this:
yyyymmdd-hhmmss-NAME-CAMERA-0001.jpg/mp4/mov

I'll try! :)
Getting back soon

Phil Harvey

The command should work fine as long as the date comes before any other numbers.

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

mariebb

Hi Phil,
since I'm an complete beginner, what am I doing wrong? ->

I'm on Mac, so I'm opening the terminal. And I'm entering this:
exiftool "-datetimeoriginal<filename" /Volumes/MG 2,5" G1 5TB/2021-05-15-Adv-02-Roadtrip/exiftool

and then, nothing happens inside of the terminal – maybe thats right?!
On Google Photos it's still not working, so maybe I need to add the other Date's as well – or I've done the terminal thing wrong.

(I also tried to type "exiftool" before entering this command, but then, if I try to paste it below the absurd long information wall, I hear a few sounds and nothing happens)

Hehe :) xD

Phil Harvey

The quotation mark in your volume name is a problem.  Try this:

exiftool "-datetimeoriginal<filename" '/Volumes/MG 2,5" G1 5TB/2021-05-15-Adv-02-Roadtrip/exiftool'

...but again, I don't think you want to be setting DateTimeOriginal, especially for video files.

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

mariebb

Hey Phil,
you have been right. It worked.

I'm actually a tiny bit frustrated, that new files are being created? Is there an option for overwriting the existing files - orrr, even better bc thats the main problem, just change the metadata in the file itself, instead of writing (my usecase video files) hundreds of GB each time on my disk.

Thanks Phil, you're rocking this exif tool hm? 19K posts? damn
_ Sincerely

Phil Harvey

You can add -overwrite_original to the file to avoid saving the backups, but ExifTool rewrites the entire file each time, there is no way around this.

- Phil

Yeah, 19K posts, but that is in 12 years, which is only an average of 4 posts per day.
...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 ($).