2
\$\begingroup\$

I had a look at this topic Is there a free program to (batch) change photo file's date to match EXIF? and it was very useful to change my photos' Date Created values to their rightful date in EXIF, but unfortunately the videos are not affected...

I am using EXIFTOOL on my MAC OSX Sierra with the following command

exiftool -r '-DateTimeOriginal>FileModifyDate' directoryname

Any ideas?


EDIT I added this image to help explain.

I'm trying to copy the actual date creation in the EXIF data to the remaining attributes which are used when sorting in my MAC

d

So the following listing options are updated too :

enter image description here

\$\endgroup\$
6
  • \$\begingroup\$ Is your goal to set the file's "creation" time or its "last modified" time? \$\endgroup\$
    – osullic
    Commented Oct 13, 2016 at 17:38
  • \$\begingroup\$ The exact opposite, the file's creation time based on actual EXIF data (when I actually took the video). When I currently export it from my Photos app on mac, the date created is in 2016, but right-click -> info shows 2012. \$\endgroup\$
    – NLed
    Commented Oct 13, 2016 at 17:42
  • \$\begingroup\$ Several times in your question you state incorrectly what you are trying to achieve. In fact, what you want is not to set the file's "creation" time, but to set the file's "last modified" time to that which is recorded in the EXIF as CreationDate. \$\endgroup\$
    – osullic
    Commented Oct 14, 2016 at 9:01
  • \$\begingroup\$ @osullic Under finder's listing, Date Created and Date Modified and Date Added are all the same, but Date Created in the EXIF data is completely different. Hence the confusion in terms. \$\endgroup\$
    – NLed
    Commented Oct 14, 2016 at 9:08
  • \$\begingroup\$ Date Created and Date Modified and Date Added might be the same for some file (or set of files). But these are all distinct file properties, and I'm just saying that you need to be clear (both for yourself and for others) about which one you want to change. \$\endgroup\$
    – osullic
    Commented Oct 14, 2016 at 12:21

2 Answers 2

2
\$\begingroup\$

So you want to set the file's "creation" time, but you are using FileModifyDate in your command, which presumably is for setting a file's "last modified" date. I think you should be using FileCreateDate instead.

I am not that familiar with ExifTool, but I would suggest you at least read the FAQ. See in particular FAQ 16 "Some files not renamed" - I realise you are not renaming files, but this question does say, "By default, ExifTool only processes writable file types when any tag is being written and a directory name is specified on the command line", which may apply to your use case.

\$\endgroup\$
2
  • \$\begingroup\$ That worked, but i used exiftool -r '-CreationDate>FileModifyDate' directoryname thanks \$\endgroup\$
    – NLed
    Commented Oct 14, 2016 at 7:27
  • \$\begingroup\$ Here's what worked for me on Mac OS: exiftool -r '-EXIF:DateTimeOriginal>FileModifyDate' '/path/to/folder credit \$\endgroup\$
    – WhatHiFi
    Commented Dec 21, 2021 at 18:13
0
\$\begingroup\$

I'm late, but nonetheless I recently had the same problem with my iPhone created videos. My iPhone writes the creation date to the CreationDate tag but Lightroom ignores this tag and expects DateTimeOriginal.

I therefore wrote a short Bash script to set DateTimeOriginal from CreationDate if DateTimeOriginal does not exist yet (to avoid unwanted modifications):

#!/bin/bash

# If (video) file(s) miss EXIF tag DateTimeOriginal, copy it from CreationDate.
this=`basename "$0"`
if [[ "$#" == "0" ]]; then
    echo "Copies EXIF tag CreationDate to DateTimeOriginal if DateTimeOriginal is missing."
    echo "Usage: $this [OPTIONS] *FILE*"
    echo "    While *FILE* may be one or file more files or directories."
    echo "    By default original files will be overwritten. To keep a backup file, use -no_overwrite_original."
    echo "    For further options see exiftool --help."
    echo "Example: $this -r -ext mov -ext mp4 ."
    echo "    Processes all MOV and MP4 video files in this directory including subdirectories."
    exit 1
fi
overwrite_original="-overwrite_original"
if [[ "$*" == *-no_overwrite_original* ]]; then
    overwrite_original=""
fi
exiftool -if 'not $DateTimeOriginal' '-DateTimeOriginal<CreationDate' -P $overwrite_original $*
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.