Author Topic: Shifting and matching all Date/Time values including File Creation  (Read 581 times)

-Sulli-

  • Jr. Member
  • **
  • Posts: 10
Hi

I'm trying to shift and match all date/time stamps for a batch of photos.

Here are all the date/time values for an example original photo:

Quote
   Line 7: File Modification Date/Time     : 2019:05:10 17:33:21+01:00
   Line 8: File Access Date/Time           : 2019:05:14 22:44:05+01:00
   Line 9: File Creation Date/Time         : 2019:05:14 22:44:05+01:00
   Line 39: Date/Time Original              : 2019:05:10 16:33:21
   Line 193: Time Stamp                      : 2019:05:10 16:33:21
   Line 279: Date/Time Original              : 2019:05:10 16:33:21.705

I've used the following code:

Code: [Select]
exiftool "-AllDates+=0:00:0 00:02:15" "-filemodifydate+=0:00:0 00:02:15" "-filecreatedate<filemodifydate" "-timestamp+=0:00:0 00:02:15" DIR
Which returns the following results:

Quote
   Line 7: File Modification Date/Time     : 2019:05:10 17:35:36+01:00
   Line 8: File Access Date/Time           : 2019:05:10 17:35:36+01:00
   Line 9: File Creation Date/Time         : 2019:05:10 17:33:21+01:00
   Line 39: Date/Time Original              : 2019:05:10 16:35:36
   Line 193: Time Stamp                      : 2019:05:10 16:35:36
   Line 279: Date/Time Original              : 2019:05:10 16:35:36.705
   
So I'm nearly there but the File Creation Date/Time gets set to the original File Modification Date/Time rather than the new shifted one. I thought maybe having the "-filecreatedate<filemodifydate" command after the "-filemodifydate+=0:00:0 00:02:15" command would mean it picks up the new date/time but it doesn't appear to work that way. Is there anyway I can achieve this with a single line of code?

Thanks
Richard





« Last Edit: May 15, 2019, 04:42:57 PM by -Sulli- »

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16885
    • ExifTool Home Page
Re: Shifting and matching all Date/Tim values including File Creation
« Reply #1 on: May 15, 2019, 09:00:33 AM »
Hi Richard,

Let me know if you have any questions after reading FAQ 28.

- 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: Shifting and matching all Date/Tim values including File Creation
« Reply #2 on: May 15, 2019, 10:07:20 AM »
Thanks, sorry I managed to look down to no. 27.

Code: [Select]
exiftool "-AllDates+=0:00:0 00:02:15" "-timestamp+=0:00:0 00:02:15" "-filemodifydate+=0:00:0 00:02:15"  "-filecreatedate<filemodifydate" -globaltimeshift "+0:00:0 00:02:15" DIR
I've revised the code as above and now appear to be getting the results I'm looking for.  Thanks again for the pointer. 

-Sulli-

  • Jr. Member
  • **
  • Posts: 10
Re: Shifting and matching all Date/Tim values including File Creation
« Reply #3 on: May 15, 2019, 12:44:43 PM »
Any ideas why this code doesn't work on the MP4 files created by the same Panasonic camera?

Code: [Select]
exiftool "-DateTimeOriginal+=0:00:0 00:02:15" "-timestamp+=0:00:0 00:02:15" "-filemodifydate<DateTimeOriginal"  "-filecreatedate<DateTimeOriginal" -globaltimeshift "+0:00:0 00:02:15" DIR
Original MP4 file:

Quote
Line 7: File Modification Date/Time     : 2019:05:10 17:33:25+01:00
Line 8: File Access Date/Time           : 2019:05:14 22:43:58+01:00
Line 9: File Creation Date/Time         : 2019:05:14 22:43:58+01:00
Line 227: Time Stamp                      : 2019:05:10 16:33:25
Line 271: Date/Time Original              : 2019:05:10 16:33:25
Line 341: Date/Time Original              : 2019:05:10 16:33:25.255

After running the above code I get this:

Quote
Line 7: File Modification Date/Time     : 2019:05:10 16:35:40+01:00
Line 8: File Access Date/Time           : 2019:05:10 16:35:40+01:00
Line 9: File Creation Date/Time         : 2019:05:10 16:35:40+01:00
Line 227: Time Stamp                      : 2019:05:10 16:33:25
Line 271: Date/Time Original              : 2019:05:10 16:33:25
Line 341: Date/Time Original              : 2019:05:10 16:33:25.255

It's working as expected for all JPG's but only updating the system (as I understand it) date/time information in the MP4's. The Exif structure appears to be the same/similar between the JPG's and MP4's as they are being created by the same camera. The Time Stamp and Date/Time Original stay as existing.

Thanks


Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16885
    • ExifTool Home Page
Re: Shifting and matching all Date/Tim values including File Creation
« Reply #4 on: May 15, 2019, 12:52:59 PM »
Try adding -G1 when extracting metadata.  It could be that Exiftool can't write in the locations where these are found.  (Although I'm working on improving this situation.)  Manufacturer information is particularly poorly supported for writing at the moment.

- 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: Shifting and matching all Date/Tim values including File Creation
« Reply #5 on: May 15, 2019, 04:42:28 PM »
Thanks. I've had a play around with some simple single command code and it doesn't seem to want to change the [Panasonic] group tags at all in MP4 files, but has not problem with the same [Panasonic] group tags for JPG files.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16885
    • ExifTool Home Page
Re: Shifting and matching all Date/Time values including File Creation
« Reply #6 on: May 15, 2019, 07:12:11 PM »
Yes.  I'll see what I can do about adding write support for the Panasonic maker notes in videos.  Each one of these features represents a significant amount of work, and adding the ability to edit metadata in videos is much more difficult than for other file formats.  But I'm finally putting in the work necessary to get this done for MOV/MP4/HEIC files.

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

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16885
    • ExifTool Home Page
Re: Shifting and matching all Date/Time values including File Creation
« Reply #7 on: May 16, 2019, 10:04:13 AM »
Bad news I'm afraid.  Panasonic is VERY inconsistent in how it stores video metadata for various models.  While ExifTool can extract much of this, it makes it extremely difficult to add write support.

- 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: Shifting and matching all Date/Time values including File Creation
« Reply #8 on: May 19, 2019, 12:21:54 PM »
Thanks for looking into it.

I have a load of timelapse photos at 5 second intervals that I shifted the time by "0:00:1225 12:34:28". This should have resulted in the filemodifydate ending in 4 or 9, such as 04 seconds, 09 seconds, 14 seconds, 19 seconds etc. But for some reason the files that should end in 9 are rounding to the nearest 10 seconds, so 09 is 10, and 19 is 20 etc. Even if I shift the time back say 6 seconds and then forward by 4 seconds it refuses to end in 9, and just rounds again. If I shift it back 1 second nothing changes, if I shift it back 2 seconds it will go from 10 to 08.

It's strange behaviour because I've not seen it happen elsewhere on other groups of timelapse photos I've been shifting. Any ideas what is going on here?


Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16885
    • ExifTool Home Page
Re: Shifting and matching all Date/Time values including File Creation
« Reply #9 on: May 20, 2019, 01:08:17 PM »
Send me a sample file and the command you used and I'll see if I can figure out why the shift is rounding off.  (philharvey66 at gmail.com)

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