Shifting and matching all Date/Time values including File Creation

Started by -Sulli-, May 15, 2019, 08:44:25 AM

Previous topic - Next topic

-Sulli-

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:

QuoteLine 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:

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:

QuoteLine 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






Phil Harvey

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/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

-Sulli-

Thanks, sorry I managed to look down to no. 27.

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-

Any ideas why this code doesn't work on the MP4 files created by the same Panasonic camera?

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:

QuoteLine 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:

QuoteLine 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

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/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

-Sulli-

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

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/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

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/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

-Sulli-

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

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/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).