How to edit IFD0 and ExifIFD video fields?

Started by Tonio, September 18, 2022, 03:36:16 PM

Previous topic - Next topic

Tonio

Hello!

I hope you are all well.

Today I was editing my media's metadata with GraphicConverter 11 (it worked fine for photos, a real pleasure) and worked partially good for videos (only QuickTime tags). But I run into a problem while trying to change (or delete if editing is not possible) the IDF0 and ExifIFD tags. Would you guys know how to edit or delete those fields as they differ from the real time the video was captured?

https://ibb.co/h2mdqF7
(PS: I heard the composite tags were not embedded. I guess they will be changed if I figure out how to change ExifIFD/IFD0.)

Thank you,

regards
Tonio

Phil Harvey

Hi Tonio,

I would have to be a mind reader to know what camera wrote this video because EXIF metadata is non-standard in videos, and may be stored in many different locations.

... but I'm feeling clairvoyant today so I'll take a guess...

If the EXIF is inside an embedded ThumbnailImage (like some Canon models), it may be deleted like this:

exiftool -thumbnailimage= FILE
- 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 ($).

StarGeek

Quote from: Tonio on September 18, 2022, 03:36:16 PM(PS: I heard the composite tags were not embedded. I guess they will be changed if I figure out how to change ExifIFD/IFD0.)

This is correct.  See the text at the top of the Composite tags page.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Tonio

Quote from: Phil Harvey on September 18, 2022, 03:53:18 PMexiftool -thumbnailimage= FILE

Hello Phil, hello StarGeek,

IT WORKED!!! Thank you so much, Phil!
It also deletes [Track] field however, but I guess it is nothing to add them again. Maybe I could try to find how to edit the fields in this "thumbnail" image instead of deleting them (because GC11 seems not to be able to edit video's metadata unlike photos), but you solved my problem by giving me the name of this field. THANK you again!

By the way thanks for your powerful tool that helped me a lot with my Photos gallery, I would love to encourage your work but I don't know how

Have a great day,

Tonio

Tonio

(Indeed, you are totally right StarGeek, Composite tags change when I edit the other ones, I can't edit them manually)
thanks!

Phil Harvey

Hi Tonio,

Adding back these proprietary EXIF tags after deleting them is not possible with ExifTool.

Your best bet is to write the information back in XMP, not EXIF.

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

wywh

Quote from: Phil Harvey on September 18, 2022, 03:53:18 PMIf the EXIF is inside an embedded ThumbnailImage (like some Canon models), it may be deleted like this:

Oh, great! I have tried to ignore these incorrect Canon date tags that differ from the correct 'QuickTime:CreateDate' and have been hiding at 'Canon:ThumbnailImage':

exiftool -a -G1 -s -api QuickTimeUTC=1 -time:all 2020-0101-1200-00_canon6d.mov

[QuickTime]     CreateDate                      : 2020:01:01 12:00:00+02:00

[IFD0]          ModifyDate                      : 2015:08:08 13:02:57
[ExifIFD]       DateTimeOriginal                : 2015:08:08 13:02:57
[ExifIFD]       CreateDate                      : 2015:08:08 13:02:57
[Canon]         TimeZone                        : +03:00
[Canon]         TimeZoneCity                    : Cairo
[Canon]         DaylightSavings                 : On
[ExifIFD]       SubSecTime                      : 55
[ExifIFD]       SubSecTimeOriginal              : 55
[ExifIFD]       SubSecTimeDigitized             : 55
[Canon]         ThumbnailImage                  : (Binary data 16507 bytes, use -b option to extract)

[Keys]          LocationDate                    : 2015:08:08 13:03:06+03:00

And indeed they all can be zapped with:

exiftool -m -P -overwrite_original_in_place -wm w -Canon:ThumbnailImage= 2020-0101-1200-00_canon6d.mov
    1 image files updated

Obviously also that remaining 'Keys:LocationDate' is from Canon and it can be readily handled with exiftool.

- Matti

Tonio

Yes exactly!!
Quote from: wywh on September 19, 2022, 08:26:07 AMexiftool -m -P -overwrite_original_in_place -wm w -Canon:ThumbnailImage=

This command is also good because it ensures that no new info will be written but I guess the first one does the job perfectly too

Thank you both of you

Tonio

wywh

Quote from: Tonio on September 19, 2022, 01:44:16 AMhow to edit the fields in this "thumbnail" image instead of deleting

I found a command mentioned in these forums that seems to do that:

exiftool -ThumbnailImage -b movie.mov | exiftool -time:all='2020:01:01 12:00:00' -timezone='+02:00' -wm w - | exiftool -ThumbnailImage'<=-' movie.mov
That said, I'll just try to ignore those proprietary Canon movie date tags unless some app happens to use them. AFAIR GraphicConverter used to pick that Canon date when renaming movies via EXIF dates but that is no longer a problem.

Is that Canon ThumbnailImage useful for something? I noticed that it can be extracted and the extracted file seems to be 160x120 EXIF JPEG from the beginning of the movie:

exiftool -b -ThumbnailImage movie.mov > ThumbnailImage.jpg

xxd -l 4 -p ThumbnailImage.jpg
ffd8ffe1

- Matti

Phil Harvey

I think the thumbnail is probably only useful for in-camera display.

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

Tonio

Quote from: wywh on September 19, 2022, 04:25:50 PMexiftool -ThumbnailImage -b movie.mov | exiftool -time:all='2020:01:01 12:00:00' -timezone='+02:00' -wm w - | exiftool -ThumbnailImage'<=-' movie.mov

it worked. Thank you so much. I can't imagine this easy action must be done with such a complex command

I would like to get some explanations on this if someone knows how it works


Tonio

Tonio

Quote from: Phil Harvey on September 19, 2022, 04:45:20 PMI think the thumbnail is probably only useful for in-camera display.
Thank you for your message, I will try this as soon as the videos are sorted in Photos (when I figure out how to set the time zone in the Canon videos). I will put them back in my camera and tell you if the thumbnail works properly after editing IFD0 and ExifIFD data

Tonio

Phil Harvey

Quote from: Tonio on September 24, 2022, 05:37:22 AM
Quote from: wywh on September 19, 2022, 04:25:50 PMexiftool -ThumbnailImage -b movie.mov | exiftool -time:all='2020:01:01 12:00:00' -timezone='+02:00' -wm w - | exiftool -ThumbnailImage'<=-' movie.mov

it worked. Thank you so much. I can't imagine this easy action must be done with such a complex command

It's actually 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.

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

Tonio

Thank you very much Phil!
Yes, it works like a charm.

I am now trying to find the same command but that sets the date automatically based on the file name (YYYYMMDD_hhmmss). So I can automatize this process for more videos without having to set manually each date/time

Thank you again!

Tonio

Phil Harvey

Quote from: Tonio on September 25, 2022, 03:20:30 PMI am now trying to find the same command but that sets the date automatically based on the file name (YYYYMMDD_hhmmss). So I can automatize this process for more videos without having to set manually each date/time

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