Copying ShotDate to CreationDate / Filename MOV

Started by Mistadobalina, February 06, 2018, 08:11:14 AM

Previous topic - Next topic

Mistadobalina

Hi,

I'm trying to copy the ShotDate from a MOV file to the CreationDate and also use the ShotDate to rename the file too. After many days of googling I've narrowed down the possible problem to be with the date formatting.

exiftool "-filename<ShotDate" -d "%Y/%m/%d" /Users/macbookpro/Desktop/Clip1.mov

This produces no return value just a '>'

exiftool -shotdate /Users/macbookpro/Desktop/Clip1.mov
Shot Date                       : 08/22/00, 15:35:22

exiftool -creationdate /Users/macbookpro/Desktop/Clip1.mov
Creation Date                   : 2018:02:05 17:43:33+00:00


I would like the file name to be formatted per example 2000-08-22 15_35_22.mov

I have hundreds of clips to process, would it be possible to format all the clips in a folder rather than individually?

Thank you in advance for any help you can offer.

- Mark

Phil Harvey

Hi Mark,

First, the quotes in your post are odd.  Be sure to use plain ASCII double quotes in your commands.

Second, ShotDate has a very odd format, so you will have to reformat it manually, which can be done using the advanced formatting feature:

exiftool "-testname<${shotdate;my @a=/\d+/g;$_=qq(20$a[2]-$a[0]-$a[1] $a[3]_$a[4]_$a[5])}.%e" DIR

Here I have used TestName for testing.  Change this to FileName after you test it to be sure it is doing what you want.

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

Mistadobalina

Hi Phil,

Thanks for your speedy reply, this is the result I'm getting:-

exiftool "-testname<${shotdate;my @a=/\d+/g;$_=qq(20$a[2]-$a[0]-$a[1] $a[3]_$a[4]_$a[5])}.%e" /Users/macbookpro/Desktop/Clip1.mov

-bash: -testname<${shotdate;my @a=/\d+/g;$_=qq(20$a[2]-$a[0]-$a[1] $a[3]_$a[4]_$a[5])}.%e: bad substitution


- Mark

Phil Harvey

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

Mistadobalina

Hi Phil,

Sorry, I originally did use single quotes but forgot to update my text post, I'm still getting the same results though.

- Mark

Phil Harvey

I get this in bash:

bash-3.2$ exiftool '-testname<${shotdate;my @a=/\d+/g;$_=qq(20$a[2]-$a[0]-$a[1] $a[3]_$a[4]_$a[5])}.%e' Clip1.mov
'Clip1.mov' --> '2000-08-22 15_35_22.mov'
    0 image files updated
    1 image files unchanged


If it doesn't work for you then you must be using a very old version of ExifTool.

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

Mistadobalina

Hi Phil,

Thanks for your help, works a treat. I noticed TextEdit was changing my quotes slightly hence your first post observation. Will I be able change the CreationDate using this method too.

Much appreciated

- Mark