exiv2 icon indicating copy to clipboard operation
exiv2 copied to clipboard

exiv2 reports "corrupted metadata" where exiftool can extract them all

Open notorand-it opened this issue 2 years ago • 2 comments

Describe the bug

On an Andoid-shot MP4 file exiv2 reports "corrupted metadata" while exiftool can extract them all.

To Reproduce

Steps to reproduce the behavior:

  1. Download the attached MP4 file
  2. run "exiv2 pr file.mp4"
  3. run "exiftool file.mp4"
Expected behavior

Both steps output media file metadata

Actual behavior

exiv2 reports corruption error exiftools works

Desktop (please complete the following information):
  • OS and version: ArchLinux (up-to-date)
  • Compiler and version: gcc (GCC) 12.1.0 (irrelevant?)
  • Compilation mode and/or compiler flags: Packages come from distro repo.
Additional context

exiv2 0.27.5 exiftool 12.4

https://user-images.githubusercontent.com/5338874/168466332-67761d35-9357-4649-b001-9cf7d5219d4f.mp4

notorand-it avatar May 15 '22 09:05 notorand-it

Hi @notorand-it, I'm not very familiar with the mp4 handling in exiv2, but after looking into the corresponding source file (src/bmffimage.cpp) it seems as if there is missing some code to parse all the boxes/atoms found in your video file.

The corrupted file error comes from exiv2 when it tries to read another box inside the meta box, which seems to be not present or differently formatted as expected (see line 288 in src/bmffimage.cpp).

I made some tests and when the boxHandler in line 295 is just called for the moov, iprp and ipco tag, no error is thrown but no metadata is found either. To find the metadata I think more boxes have to be parsed. This site can give some hints what boxes are present in your mp4 file and there are many more that exiv2 does not process...

I hope I could help a little bit

VJSchneid avatar May 16 '22 18:05 VJSchneid

I'm not that familiar with this stuff, but here's where the creation_time is from the mp4box.js site:

Screenshot from 2022-08-11 19-54-15

benmccann avatar Aug 12 '22 02:08 benmccann

This request targets the removed video functionality, to be specific quicktimevideo.cpp. Please see https://github.com/Exiv2/exiv2/issues/1748 for further info

hassec avatar Aug 15 '22 16:08 hassec

@benmccann please have a l👀l at https://mediaarea.net/ tools.

Video is very complex and full of bull$#17 $0ftwar€ patents.

1div0 avatar Aug 16 '22 10:08 1div0