Author Topic: Time shift MP4  (Read 1487 times)

-Sulli-

  • Jr. Member
  • **
  • Posts: 10
Time shift MP4
« on: August 31, 2016, 06:37:29 PM »
Hi all

I'm trying to shift the time back 1 hour for a collection of JPG and MP4 files that were all taken on the same camera.  For testing I've copied 3 JPG files and 1 MP4 file into a folder along with the exiftool.exe and run the following code.

Code: [Select]
exiftool -AllDates-=1 DIR
This worked great on the JPG files but the date on the MP4 was changed to the date/time I copied the file to the folder.  I've copied the exiftool(-k) information below for the original and adjusted MP4 files and removed all information that I didn't think was relevant.

Original MP4
Code: [Select]
ExifTool Version Number         : 10.25
File Name                       : P1020564.MP4_original
...
File Modification Date/Time     : 2016:08:01 11:33:30+01:00
File Access Date/Time           : 2016:08:31 22:51:38+01:00
File Creation Date/Time         : 2016:08:31 22:51:28+01:00
...
Track Create Date               : 2016:08:01 11:33:31
Track Modify Date               : 2016:08:01 11:33:31
...
Media Create Date               : 2016:08:01 11:33:31
Media Modify Date               : 2016:08:01 11:33:31
...
Modify Date                     : 2016:08:01 11:33:31
...
Date/Time Original              : 2016:08:01 11:33:31
Create Date                     : 2016:08:01 11:33:31
...
Create Date                     : 2016:08:01 11:33:31.590
Date/Time Original              : 2016:08:01 11:33:31.590
Modify Date                     : 2016:08:01 11:33:31.590

Time Adjusted MP4
Code: [Select]
ExifTool Version Number         : 10.25
File Name                       : P1020564.MP4
...
File Modification Date/Time     : 2016:08:31 23:16:34+01:00
File Access Date/Time           : 2016:08:31 23:16:33+01:00
File Creation Date/Time         : 2016:08:31 22:51:28+01:00
...
Track Create Date               : 2016:08:01 11:33:31
Track Modify Date               : 2016:08:01 11:33:31
...
Media Create Date               : 2016:08:01 11:33:31
Media Modify Date               : 2016:08:01 11:33:31
...
Modify Date                     : 2016:08:01 11:33:31
...
Date/Time Original              : 2016:08:01 11:33:31
Create Date                     : 2016:08:01 11:33:31
...
Create Date                     : 2016:08:01 11:33:31.590
Date/Time Original              : 2016:08:01 11:33:31.590
Modify Date                     : 2016:08:01 11:33:31.590

This is a screenshot of what I'm seeing in Windows.



For this example file I'd like all date/times to be 1 hour earlier at 2016:08:01 10:33:31.

What am I doing wrong?

Thanks
Richard



Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14438
    • ExifTool Home Page
Re: Time shift MP4
« Reply #1 on: August 31, 2016, 10:04:38 PM »
Hi Richard,

I think that reading FAQ 24 may help.

I'll check back again later when I have more time  to think about this.

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

-Sulli-

  • Jr. Member
  • **
  • Posts: 10
Re: Time shift MP4
« Reply #2 on: September 01, 2016, 04:49:17 AM »
Hi Phil

I used the below code and it seems to have worked (at least for Windows Explorer). 

Code: [Select]
exiftool -alldates-=1 -filemodifydate-=1 \DIR
Although not all dates have changed when I view the exiftool(-k) information.

Thanks
Richard

« Last Edit: September 01, 2016, 05:00:15 AM by -Sulli- »

Hayo Baan

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 938
  • Professional Photographer & Software Developer
    • Hayo Baan – Photography
Re: Time shift MP4
« Reply #3 on: September 01, 2016, 06:30:15 AM »
The reason you do not see the updates is that alldates does not include the quicktime dattime tags. You need to specify these explicitly (luckily you can use wildcards to match tag names), e.g, like so
Code: [Select]
exiftool '-*CreateDate-=1' '-*ModifyDate-=1' -DateTimeOriginal-=1 MOVIEFILESorDIRS(use double quotes insteads of single quotes when on Windows, in fact here you can leave them off altogether)

This might not update the DataTimeOriginal, however if it inside makernotes (to verify run exiftool -G0:1 -DateTimeOriginal on the file. A while ago I wrote a script that is able to change these dates, please see this forum post for details. If the script doesn't fully do what you want, please let me me know so I can have a look at improving it.

Edited to complete answer…
« Last Edit: September 01, 2016, 07:22:47 AM by Hayo Baan »
Hayo Baan – Photography
Web: www.hayobaan.nl