Author Topic: Copying ShotDate to CreationDate / Filename MOV  (Read 924 times)

Mistadobalina

  • Newbie
  • *
  • Posts: 4
Copying ShotDate to CreationDate / Filename MOV
« on: February 06, 2018, 08:11:14 AM »
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16724
    • ExifTool Home Page
Re: Copying ShotDate to CreationDate / Filename MOV
« Reply #1 on: February 06, 2018, 08:20:53 AM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Mistadobalina

  • Newbie
  • *
  • Posts: 4
Re: Copying ShotDate to CreationDate / Filename MOV
« Reply #2 on: February 06, 2018, 09:06:11 AM »
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16724
    • ExifTool Home Page
Re: Copying ShotDate to CreationDate / Filename MOV
« Reply #3 on: February 06, 2018, 09:08:52 AM »
Hi Mark,

Read my signature.  ;)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Mistadobalina

  • Newbie
  • *
  • Posts: 4
Re: Copying ShotDate to CreationDate / Filename MOV
« Reply #4 on: February 06, 2018, 09:19:10 AM »
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16724
    • ExifTool Home Page
Re: Copying ShotDate to CreationDate / Filename MOV
« Reply #5 on: February 06, 2018, 09:27:05 AM »
I get this in bash:

Code: [Select]
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Mistadobalina

  • Newbie
  • *
  • Posts: 4
Re: Copying ShotDate to CreationDate / Filename MOV
« Reply #6 on: February 06, 2018, 10:02:18 AM »
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