DateTimeOriginal change of MP4 files fails

Started by okiev, October 31, 2022, 02:58:22 PM

Previous topic - Next topic

okiev

Hi, I am facing an issue when trying updating the above tag:
$ exiftool -ver
12.40
$ exiftool -s -G -H -datetimeoriginal P1110076.MP4 P1110078.JPG
======== P1110076.MP4
[EXIF]          0x9003 DateTimeOriginal                : 2022:09:07 09:00:26
======== P1110078.JPG
[EXIF]          0x9003 DateTimeOriginal                : 2022:09:07 11:13:08
    2 image files read
$ exiftool -overwrite_original_in_place -P -DateTimeOriginal+=1:0:0  P1110076.MP4 P1110078.JPG
    1 image files updated
    1 image files unchanged
$ exiftool -s -G -H -datetimeoriginal P1110076.MP4 P1110078.JPG
======== P1110076.MP4
[EXIF]          0x9003 DateTimeOriginal                : 2022:09:07 09:00:26
======== P1110078.JPG
[EXIF]          0x9003 DateTimeOriginal                : 2022:09:07 12:13:08
    2 image files read
Works as usual for pics.
Any idea?

StarGeek

Because EXIF data is non-standard in video files, exiftool may not be able to update EXIF data in a video file.

The fact that EXIF is non-standard in video files doesn't seem to matter to camera manufacturers and, unfortunately, when they shove such data into a video, they don't all do it in the same way.  That means that exiftool can't always edit such EXIF data and still keep the video uncorrupted.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

wywh

#2
There is no standard for embedding EXIF data in a movie but that has not stopped a lot of camera makers from forcing it into the file. If that kind of EXIF is inside an embedded ThumbnailImage (like in some Canon models), it might be edited or deleted if some app erroneously grabs it. The maker notes in most Canon movies are stored inside the ThumbnailImage, which is writable, so you can do something like this (it is 3 commands: the first to extract the thumbnail, the second to add metadata to the thumbnail, and the third to write the thumbnail back into the video):

exiftool -ThumbnailImage -b movie.mov | exiftool -Time:All='2020:01:01 12:00:00' -timezone='+02:00' -wm w - | exiftool -ThumbnailImage'<=-' movie.mov
exiftool -m -P -overwrite_original_in_place -wm w -Canon:ThumbnailImage= movie.mov
https://exiftool.org/forum/index.php?topic=13951.msg75028#msg75028
https://exiftool.org/forum/index.php?topic=13951.msg75078#msg75078

I just ignore those dates and edit the more important 'QuickTime:CreateDate' and 'Keys:CreationDate' if it exists or in some very old (1902-1970 or even down to year 1) movies where only it works with my apps.

- Matti

Phil Harvey

#3
This issue has surfaced a number of times recently.  I will alleviate the situation somewhat by raising the priority of the QuickTime tags so that they will take precedence over the non-standard EXIF tags when the Duplicates option is not enabled.

- Phil

Edit:  Instead of raising the priority of QuickTime tags (which would override XMP tags which I think should probably be higher priority), I will lower the priority of EXIF and MakerNotes tags.

Edit2: Tag prioritization is tricky.  Using the existing mechanism in the code, lowering the priorities of both EXIF and MakerNotes had an undesirable effect on the relative priority between these two.  So I will have to come up with a more flexible scheme to allow better control over the relative priorities between EXIF, MakerNotes, QuickTime and XMP tags.
...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

Quote from: Phil Harvey on November 01, 2022, 09:13:22 AMI will alleviate the situation somewhat by raising the priority of the QuickTime tags so that they will take precedence over the non-standard EXIF tags when the Duplicates option is not enabled.

This change won't make it into the next release.  I need more time to work on this -- I need to be careful because I don't want to affect the current behaviour for other file types.

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