ExifTool Forum

ExifTool => Newbies => Topic started by: Andur1l on November 14, 2022, 02:46:28 PM

Title: Batch copy .mov video create/modify date to reencoded .mkv videos
Post by: Andur1l on November 14, 2022, 02:46:28 PM
Hiya guys,

a total exiftools newb here, just had some experience with exiftoolgui and that ain't working for me no more.

My camera records videos in .mov, which I reencode with Handbrake into smaller .mkvs - but that of course messes up the system and exif date values, which I need for Google Photos.

I used this topic (https://exiftool.org/forum/index.php?topic=10322.0) as my starting point, my dir structure is:

d:\Temp\mov\ - location of my original .MOV files
d:\Temp\mkv\ - location of my reencoded .mkv files
exiftool.exe is in d:\Temp\

"exiftool -g1 -a -s -time:all" on my .MOV files gives me:

PS D:\Temp> exiftool -g1 -a -s -time:all MVI_0100.MOV
---- System ----
FileModifyDate                  : 2022:08:05 23:46:30+02:00
FileAccessDate                  : 2022:11:14 12:29:26+01:00
FileCreateDate                  : 2022:11:14 11:53:39+01:00
---- IFD0 ----
ModifyDate                      : 2022:08:04 11:39:51
---- ExifIFD ----
DateTimeOriginal                : 2022:08:04 11:39:51
CreateDate                      : 2022:08:04 11:39:51
SubSecTime                      : 40
SubSecTimeOriginal              : 40
SubSecTimeDigitized             : 40
---- QuickTime ----
CreateDate                      : 2022:08:04 11:39:51
ModifyDate                      : 2022:08:04 11:39:51
---- Track1 ----
TrackCreateDate                 : 2022:08:04 11:39:51
TrackModifyDate                 : 2022:08:04 11:39:51
MediaCreateDate                 : 2022:08:04 11:39:51
MediaModifyDate                 : 2022:08:04 11:39:51
---- Track2 ----
TrackCreateDate                 : 2022:08:04 11:39:51
TrackModifyDate                 : 2022:08:04 11:39:51
MediaCreateDate                 : 2022:08:04 11:39:51
MediaModifyDate                 : 2022:08:04 11:39:51
---- Composite ----
SubSecCreateDate                : 2022:08:04 11:39:51.40
SubSecDateTimeOriginal          : 2022:08:04 11:39:51.40
SubSecModifyDate                : 2022:08:04 11:39:51.40

And from this I came to:

exiftool -TagsFromFile d:\Temp\mov\%f.MOV "-alldates<ExifIFD:DateTimeOriginal" d:\Temp\mkv\
... wanting to copy the exif date from .MOV to system dates in the .mkv, but all I get is:

PS D:\Temp> exiftool -TagsFromFile d:\Temp\mov\%f.MOV "-alldates<ExifIFD:DateTimeOriginal" d:\Temp\mkv\
    1 directories scanned
    0 image files read

I also tried it with "-FileCreateDate -FileModifyDate" from the other topic but with the same result.

I can't figure out what I'm doing wrong. Help, please?  :-*

Title: Re: Batch copy .mov video create/modify date to reencoded .mkv videos
Post by: StarGeek on November 14, 2022, 03:14:52 PM
I only skimmed over your post but these problems jumped out at me.

See Supported File Types table (https://exiftool.org/#supported).  MKV files are not writable by exiftool.

Another problem is that EXIF data in a video file is non-standard and every camera company forcefully embeds such data in different ways.  Because of this, EXIF data can't be copied into video files.  The closest workaround would be to copy the EXIF tags into the corresponding XMP tags.  The exif2xmp.args file (https://raw.githubusercontent.com/exiftool/exiftool/master/arg_files/exif2xmp.args) can be used for this (see the -@ (Argfile) option (https://exiftool.org/exiftool_pod.html#ARGFILE)).  For an MKV file this would have to be a sidecar file using exiftool.

Actually, thinking about it, I'm not sure MKV files can hold embedded XMP.
Title: Re: Batch copy .mov video create/modify date to reencoded .mkv videos
Post by: Andur1l on November 14, 2022, 04:44:24 PM
Thanks for taking the time and answering!

But shouldn't exiftool work at least with writing the system dates like "-FileCreateDate -FileModifyDate", so copying only system dates from .mov to .mkv?
Title: Re: Batch copy .mov video create/modify date to reencoded .mkv videos
Post by: Phil Harvey on November 14, 2022, 08:28:52 PM
Yes.  But see FAQ 16 (https://exiftool.org/faq.html#Q16).

- Phil
Title: Re: Batch copy .mov video create/modify date to reencoded .mkv videos
Post by: Andur1l on November 15, 2022, 03:10:35 AM
PS D:\Temp> exiftool -TagsFromFile d:\Temp\mov\%f.MOV -ext MOV -ext MKV "-FileCreateDate<ExifIFD:DateTimeOriginal" "-FileModifyDate<ExifIFD:DateTimeOriginal" d:\Temp\mkv\
    1 directories scanned
    8 image files updated

YES! Thanks so much to both of you, this is gonna save me so much time and work in the future, yaaay!