News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Possible to inject capture timestamp for M2TS files?

Started by somy, July 16, 2019, 03:54:01 AM

Previous topic - Next topic

somy

Quote from: Phil Harvey on July 17, 2019, 08:35:53 AM
> exiftool tmp/a.mp4 -DateTimeOriginal="2013:09:01 12:27:46+02:00" -CreateDate="2013:09:01 10:27:46"
    1 image files updated
> exiftool tmp/a.mp4 -DateTimeOriginal -CreateDate -G1 -a
[UserData]      Date Time Original              : 2013:09:01 12:27:46+02:00
[XMP-exif]      Date/Time Original              : 2013:09:01 12:27:46+02:00
[QuickTime]     Create Date                     : 2013:09:01 10:27:46
[XMP-xmp]       Create Date                     : 2013:09:01 10:27:46


Oops, too quick.
I saw something slightly different:

Desktop\Videos>exiftool -DateTimeOriginal -CreateDate -G1 -a "2013-09-01 20130901122746.mp4"
[UserData]      Date Time Original              : 2013:09:01 12:27:46+02:00
[XMP-exif]      Date/Time Original              : 2013:09:01 12:27:46+02:00
[QuickTime]     Create Date                     : 2013:09:01 10:27:46
[XMP-xmp]       Create Date                     : 2013:09:01 12:27:46+02:00


[XMP-xmp] tag still shows local time.
Below is the command I used to write the tags:
exiftool -tagsfromfile %d%f.mts  -all -r -P "-description<ExifTool: ApertureSetting=$Aperturesetting,  Focus=$focus, ImageStabilization=$imagestabilization, Gain=$gain, Make=$make, Model=$model,  ExposureProgram=$exposureprogram, Aperture=$aperture, ShutterSpeed=$shutterSpeed, WhiteBalance=$whitebalance" "-createdate<$datetimeoriginal" -if "($encoder =~ /MkvToMp4/i) and (not $description)" -ext mp4 -api QuickTimeUTC .

Where $datetimeoriginal in original MTS video is "2013:09:01 12:27:46+02:00 DST".
So why XMP Create Date shows local time?

Phil Harvey

When writing XMP you can either write the time zone or not, but it won't convert to/from UTC like the QuickTime tags.

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

somy

Quote from: Phil Harvey on July 17, 2019, 09:38:39 AM
When writing XMP you can either write the time zone or not, but it won't convert to/from UTC like the QuickTime tags.

- Phil
Ok, but looks like the instruction "-createdate<$datetimeoriginal" write to both XMP and QuickTime tags - is there an option that I can instruct ExifTool to write UTC timestamp to both tags?
Sorry I know it's trival but just want to be 100% perfect.

Phil Harvey

I think the simplest option is to not write the XMP.  So do this instead: "-quicktime:createdate<datetimeoriginal"

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

somy

Quote from: Phil Harvey on July 17, 2019, 09:45:19 AM
I think the simplest option is to not write the XMP.  So do this instead: "-quicktime:createdate<datetimeoriginal"

- Phil

Cool thanks for the hint!

somy

Quote from: Phil Harvey on July 17, 2019, 09:45:19 AM
I think the simplest option is to not write the XMP.  So do this instead: "-quicktime:createdate<datetimeoriginal"

- Phil

Hi Phil,
Just want to say thank you very much for the help! I have now tested the following command, and it works great! Hope it helps others with similar issue in the future:
exiftool -tagsfromfile %d%f.mts  -all -m -r -P "-description<ExifTool: ApertureSetting=$Aperturesetting,  Focus=$focus, ImageStabilization=$imagestabilization, Gain=$gain, Make=$make, Model=$model,  ExposureProgram=$exposureprogram, Aperture=$aperture, ShutterSpeed=$shutterSpeed, WhiteBalance=$whitebalance, DateTimeOriginal=$datetimeoriginal" "-quicktime:createdate<$datetimeoriginal" "-quicktime:modifydate<$datetimeoriginal" "-trackcreatedate<$datetimeoriginal" "-trackmodifydate<$datetimeoriginal" "-mediacreatedate<$datetimeoriginal" "-mediamodifydate<$datetimeoriginal" "-filecreatedate<$datetimeoriginal" -if "($encoder =~ /MkvToMp4/i) and (not $description)" -ext mp4 -api QuickTimeUTC .


The only timestamp I can't seem to change is filecreatedate, but it's not a big deal though.