XMP is a media-metadata standard based on XML which may be used
across a variety of media formats. Some video-processing software
writes XMP data without updating the native metadata fields.
Therefore, we should aim at reading XMP metadata and give priority
of XMP data over native fields.
Pros:
- Support for *all* common media formats.
Cons:
- XML (complex, verbose, chaotic).
- Does not even come close to fulfilling its promise of being
well defined (see below).
Implement a simple XMP-parser using libxml2. Connect the XMP-parser to
the existing Quicktime/MP4 parser.
First problem encountered: According to the spec, XMP data supposed
to be put in the 'XMP_' atom. But for example exiftools instead
writes an 'uuid' atom with a special 16-byte uid. Implement both,
more options will probably follow.
Second problem: two versions of recording the creation date were found
1) The content of a <exif:DateTimeOriginal> tag.
2) The xmp::CreateDate attribute of a <rdf:Description> tag.
Here too, more versions are expected to surface and will have
to be supported in due course (with an obvious priority problem).
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
In metadata.cpp, replace a silly
"if (!memcmp(...) != 0)"
by the intended
"if (!memcmp(...))"
Obviously, both have the same effect. Fixes a warning.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Whereas extraction of the dive-duration is trivial, AVIs don't seem
to have a standardized way of saving the creation time. This commit
implements support for two versions randomly found on the internet.
Additional version will follow if need arises. AVI seems not to be
a particular popular format for either vacation or professional
videographers.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
We want the duration of videos for two reasons:
- To display the duration of the video in the profile plot.
- To be able to determine which dive a video is closer to if the
start is not during a dive.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Parse MP4s and related video files and extract the creation timestamp
from the "mdhd" (media header) atom.
Introduce helper function templates to extract arbitrary-length
unsigned integers in big-endian format from file or memory.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Thus, metadata has to be only read once and the picture_load_exif_data()
function can be removed.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>