ExifTool Forum

General => Metadata => Topic started by: Tonio on September 18, 2022, 03:36:16 PM

Title: How to edit IFD0 and ExifIFD video fields?
Post by: Tonio on September 18, 2022, 03:36:16 PM
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
Title: Re: How to edit IFD0 and ExifIFD video fields?
Post by: Phil Harvey on September 18, 2022, 03:53:18 PM
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

Title: Re: How to edit IFD0 and ExifIFD video fields?
Post by: StarGeek on September 18, 2022, 08:07:37 PM
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 (https://exiftool.org/TagNames/Composite.html).
Title: Re: How to edit IFD0 and ExifIFD video fields?
Post by: Tonio on September 19, 2022, 01:44:16 AM
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
Title: Re: How to edit IFD0 and ExifIFD video fields?
Post by: Tonio on September 19, 2022, 01:45:43 AM
(Indeed, you are totally right StarGeek, Composite tags change when I edit the other ones, I can't edit them manually)
thanks!
Title: Re: How to edit IFD0 and ExifIFD video fields?
Post by: Phil Harvey on September 19, 2022, 06:28:45 AM
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
Title: Re: How to edit IFD0 and ExifIFD video fields?
Post by: wywh on September 19, 2022, 08:26:07 AM
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
Title: Re: How to edit IFD0 and ExifIFD video fields?
Post by: Tonio on September 19, 2022, 02:14:23 PM
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
Title: Re: How to edit IFD0 and ExifIFD video fields?
Post by: wywh on September 19, 2022, 04:25:50 PM
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
Title: Re: How to edit IFD0 and ExifIFD video fields?
Post by: Phil Harvey on September 19, 2022, 04:45:20 PM
I think the thumbnail is probably only useful for in-camera display.

- Phil
Title: Re: How to edit IFD0 and ExifIFD video fields?
Post by: 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

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


Tonio
Title: Re: How to edit IFD0 and ExifIFD video fields?
Post by: Tonio on September 24, 2022, 12:06:40 PM
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
Title: Re: How to edit IFD0 and ExifIFD video fields?
Post by: Phil Harvey on September 24, 2022, 07:31:29 PM
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
Title: Re: How to edit IFD0 and ExifIFD video fields?
Post by: Tonio on September 25, 2022, 03:20:30 PM
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
Title: Re: How to edit IFD0 and ExifIFD video fields?
Post by: Phil Harvey on September 25, 2022, 03:45:10 PM
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 (https://exiftool.org/forum/index.php?msg=75194).
Title: Re: How to edit IFD0 and ExifIFD video fields?
Post by: Tonio on September 26, 2022, 02:38:50 PM
Hello Phil,

Thank you for your answer
Sorry I totally forgot a part in my last sentence, I meant I was trying to find a way to set the ExifIFD/IFD0 dates by filename (or a timezoned tag?)
(Matti's post command doesn't work for that type of metadata)

I tried
exiftool -m -P -overwrite_original_in_place -wm w '-Canon:ThumbnailImage<UserData:DateTimeOriginal' movie.movbut it didn't work, it deleted the ExifIFD/IFD0 to add a
---- File ----
Type de fichier:
TXT
File Type Extension:
txt
Type MIME:
text/plain
MIME Encoding:
us-ascii
Newlines:
(none)

Maybe I have to use the 2 other commands to extract the thumbnail before and then put it back in the video's metadata? (it's not even clear in my head) so I tried:
exiftool -ThumbnailImage -b movie.MOV | exiftool -m -P -overwrite_original_in_place '-Canon:ThumbnailImage<UserData:DateTimeOriginal' movie.MOV -wm w - | exiftool -ThumbnailImage'<=-' movie.MOV 
Warning: No writable tags set from -
Error erasing original -
Warning: Error setting file time - -
    1 image files updated
It didn't work

Thank you for your help and sorry for that mistake!


Tonio
Title: Re: How to edit IFD0 and ExifIFD video fields?
Post by: Tonio on September 28, 2022, 03:13:52 PM
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

Hello Mati, I hope you are well,

I am still trying to insert the real date/time with time zone in ExifIFD and IFD0 into this thumbnail data, would you know a way of doing it without setting it manually? With something like:

exiftool -ThumbnailImage -b movie.MOV | exiftool -m -P -overwrite_original_in_place -time:all='-Canon:ThumbnailImage<UserData:DateTimeOriginal' movie.MOV -wm w - | exiftool -ThumbnailImage'<=-' movie.MOV(it doesn't work)

Thank you very much!

Tonio
Title: Re: How to edit IFD0 and ExifIFD video fields?
Post by: wywh on September 29, 2022, 03:47:49 AM
I just ignore that Canon thumbnail image movie date tag because currently none of my apps use it anyway.

- Matti
Title: Re: How to edit IFD0 and ExifIFD video fields?
Post by: Tonio on October 01, 2022, 10:21:12 AM
Hello,

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

This commands works fine to edit IFD0, IFDExif and UserData dates in videos one by one by setting the dates manually so I'll do this now. However, it adds "Unknown Thumbnail: (Binary data 24812 bytes, use -b option to extract)" to the metadata video. I guess it causes no problem so I'll just ignore it but if you guys have an idea to delete this, please tell me!

Thank you all,
Have a good day
Title: Re: How to edit IFD0 and ExifIFD video fields?
Post by: wywh on October 01, 2022, 11:18:53 AM
Quote from: Tonio on October 01, 2022, 10:21:12 AMit adds "Unknown Thumbnail

I get the same extra UnknownThumbnail with my Canon .mov. These seem to be an identical duplicates with the same updated dates.

[Canon]         ThumbnailImage                  : (Binary data 16337 bytes, use -b option to extract)
[UserData]      UnknownThumbnail                : (Binary data 16337 bytes, use -b option to extract)

exiftool -a -G1 -s -api QuickTimeUTC=1 -Time:All ThumbnailImage.jpg
[System]        FileModifyDate                  : 2022:10:01 18:09:05+03:00
[System]        FileAccessDate                  : 2022:10:01 18:11:22+03:00
[System]        FileInodeChangeDate             : 2022:10:01 18:09:05+03:00
[IFD0]          ModifyDate                      : 2020:01:01 12:00:00
[ExifIFD]       DateTimeOriginal                : 2020:01:01 12:00:00
[ExifIFD]       CreateDate                      : 2020:01:01 12:00:00
[Canon]         TimeZone                        : +02:00
[Canon]         TimeZoneCity                    : Cairo
[Canon]         DaylightSavings                 : On

I would either ignore or remove those Canon ThumbnailImages rather than introduce more clutter.

- Matti