ExifTool Forum

ExifTool => Newbies => Topic started by: -Sulli- on August 31, 2016, 06:37:29 PM

Title: Time shift MP4
Post by: -Sulli- 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.

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
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
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.

(https://lh3.googleusercontent.com/mdvEQV6XXKzHUpdVURsM4kiZXvCP9i6bBkSPNUoH9WL9FfI9-YJg5YJOZsm2ymgdItNkV6JxEUPkbVjfL5kIKKUsbUF4oUVAWyMYo1BGxAcHkcJt7z0sK_KgSEOHE1b4sSOLbVoWPEpz8ZkxWqFJhXMHAA5244rb2aHqcyhCZNIe5Zy4wNkT6FSayyC80m6Oa-h2-g-SF-7f_k20A94N7XaE3St7QRf2hFLI4bkaqfFXZBBcJaj9OMlKcrvJg-ATIZvEMUM4zPX2udP1IgkaQHm2qm5yfPv0o60dRGuJ9wBz7EJZ-ls6jTmuGhx4zUj7r_A2D4WHBLZ8iCD5UYm5nAgFKWQwZAWR5sw3_DtJTl0LlFP54aIu1qqZVigJeTXXCbMYM3UGgiWVTL4qsj4UwTJYtY6htHn1HUIeSH-G3Q1OF-v1PgGOW71wBgjeUU0LgSpV__zJoqIVsIuFJb1PFAcAE929PbgsFaS2I1AkZLY-ioVOZwjPJjdLNRrlhSqD5HvMi_rW6Y2JooZLpz2k1QeyM3x-Guk228UExDDJZVLxWRShjzw_F9u7VtMvzfIlqFg-LQQi7QtjfCArBuEkODAs4unPzm-k9tw-98x2Z7VJD_Sj8w=w424-h223-no)

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


Title: Re: Time shift MP4
Post by: Phil Harvey on August 31, 2016, 10:04:38 PM
Hi Richard,

I think that reading FAQ 24 (https://exiftool.org/faq.html#Q24) may help.

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

- Phil
Title: Re: Time shift MP4
Post by: -Sulli- 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). 

exiftool -alldates-=1 -filemodifydate-=1 \DIR

Although not all dates have changed when I view the exiftool(-k) information.

Thanks
Richard

Title: Re: Time shift MP4
Post by: Hayo Baan 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
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 (https://exiftool.org/forum/index.php/topic,6938.msg35046.html#msg35046) 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...