Help to repair corrupted video metadata of one file

Started by ben, October 11, 2023, 03:43:13 PM

Previous topic - Next topic

ben

Hello,

is it somehow possible to repair the following corrupted metadata of one video file?

The error occurred when i tried to write back an updated creation date.
The writeback was not successful (iMatch error message shown).


Metadata Analyst Results. Version 2023.3.6. 11/10/2023 15:40:34
File analyzed: D:\Bilder\2023\..\VID-20230829-WA0008.mp4
Errors: 0
Warnings: 3

Warning: [System] File has unwritten metadata (pending write-back).<br/>The metadata loaded from the image and the data in the database may not match.
Warning: [Metadata] Warnings: 'Truncated '\x1a\x17\x00\x00' data'
Warning: [Detailed Validation] Truncated '\x1a\x17\x00\x00' data

Thanks a lot for your help
Ben

Mario

The Metadata Analyst warning does not help much. It's "after the fact".
What did ExifTool report in the Output Panel after the write-back (warnings and errors are also logged to the IMatch log file).
Which video file format? Which workflow and software was used to create the file?

I'm not ware of any case where ExifTool damaged a file during write back.
During write-back, ExifTool creates a copy of the file and only when everything works correctly, the original file is removed and replaced with the new file. If ExifTool notices any problems with the file or write-back, it aborts, deletes the copy of the file and the original file remains unmodified.

If you really ran into this problem, ExifTool did not notice any issue while reading the file. But then the MDA should also not notice anything.

Video files usually contain no EXIF data, so changing a time stamp in IMatch and writing back does only add/modify the XMP data in the video (if the video format is MP4 or some of the other rare video formats with embedded XMP). Else the data is only written to the sidecar file.

Restore the backup of the video and make a copy. Repeat the process that produced this unsatisfactory result.
Preserve the contents of the Output panel (View menu > Panels > ...) and the IMatch log file from that session and ZIP/attach here. Open the ExifTool output panel before you write back.

If you can reproduce this with a specific file, make it available for download and send me a link. If I can reproduce it here, I will contact Phil and send him the sample of the video. Video files and the metadata contained are an even bigger mess than image metadata, and who knows...?

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ben

Thanks so much for helping, hope i did everything you asked for.
I attached all outputs.
I will provide the video by eMail link.

File info:
- smartphone video file (i don't know which vendor)
- Container format: mp4
- Codec as retreived from tool MediaInfo: MPEG-4 / AVC  (attached)


The steps i did:
- copied original file to a new folder inside iMatch
- force update
- Logging = Debug
- Open output panel

-> iMatch yellow pen indicates many metadata to write back (screenshot attached)

- writeback

-> error shown; iMatch log file in debug mode (attached)

- run exiftool command processor with preset "list metadata" (attached)


Mario

IMatch attempts to write XMP metadata to a MP4 file.
Exiftool refuses and reports: 1 files weren't updated due to errors.

Warning: Truncated &#39;\x1a\x17\x00\x00&#39; data - D:\Bilder\2023\100_Incoming\_test\VID-20230829-WA0008.mp4
Warning: No writable tags set from D:\Bilder\2023\100_Incoming\_test\VID-20230829-WA0008.mp4
Error: Truncated &#39;0x1a170000&#39; atom - D:/Bilder/2023/100_Incoming/_test/VID-20230829-WA0008.mp4

Apparently it has found some native / QuickTime metadata in the file that was invalid.
No change you have been done to the video, according to the output and log file.
The problem metadata was already in the file before ExifTool started to write to it.

A typical workflow to fix this kind of problem is to use something like the free Handbrake (https://handbrake.fr/) (or FFMeg if you are a command line wizard) to re-encode the file, which may fix the mangled metadata in the QuickTime atoms.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Mario

#4
Thanks for sending the file.
The truncated metadata in some of the QuickTime atoms exist in the file (before touching the file or writing back).
ExifTool reports it as a minor warning while reading the metadata.

To fix the file, I've used a free and open source software called "Lossless Crop" (https://github.com/mifi/lossless-cut/tree/master). I've just cropped the first two seconds from the video and let Lossless Crop produce a new video. This operation is super-fast, no re-encoding of the video is performed!

The new video shows no warnings in ExifTool anymore and adding XMP data (rating/label/headline/keywords/datetime) works perfectly fine.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ben


Mario

Good result!
If you want to lean more about crappy metadata and metadata problems, I could entertain you for a week or two with anecdotes... 
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook