Video DURATION - can not find this tag

Started by ubacher, April 03, 2019, 12:35:22 AM

Previous topic - Next topic

ubacher

In the thumbnail layout editor I can find the tag DURATION ( in three variations).
Nowhere else I can find this tag.
??????
Wanted to display the duration in a panel in the Metadata Panel.

Mario

This is not a metadata tag.
IMatch calculates this value when it ingests a video file and makes it available via this File Window attribute and the {File.Duration.HMS} variable.
There is no common standard for storing video duration between all the various video formats. Many video formats have no metadata at all. You have to count the frames and divide them by the frames per second value...

Check your video files in the ECP to find a tag you can use.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

QuoteCheck your video files in the ECP to find a tag you can use.

There is duration information in the file. Track1 Media Duration. (and also Track Duration)
Not sure if this is an uncommon way to specify metadata only done on Samsung Smartphones or if
it is quite common. Seems Track 1 is the video, Track 2 is the audio. Interesting I find also the CompressorId which
tells what codec is needed to decode it.

Looking at the Tagmanager in Metadata2 I can not find this. Not sure if it would be worth adding.

Mario

This sounds like standard QuickTime container tags. You can have any number of (vide/audio/...) tracks in a file, each with its own duration.
ExifTool creates the tags for such dynamic metadata on-the-fly, during the import. May of these are not available because they are not part of the static tag table IMatch imports from ExifTool to fill the tag manager. The tags may show up as Track1, Track2, ...

But for QuickTime the MediaHeader etc. has useful data and this is of course available in IMatch. Depends on your file, though. Check the MD Panel in Browser mode and search for duration. Usually you will find {File.MD.QuickTime::MediaHeader\4\MediaDuration\0} or {File.MD.QuickTime::MovieHeader\4\Duration\0} or {File.MD.QuickTime::TrackHeader\5\TrackDuration\0} or or similar.

IMatch fills its variable and Duration attribute based on that FFMpeg delivers when IMatch processes the file.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

I attach the output from exiftool. My conclusion is that the metadata is not following
quicktime standard nomenclature.

A case for Phil?

Also attached what the metadata panel shows. Exiftool must somehow create/fill these tags.

Mario

Nothing unusual. These are QuickTime tags in your file.
No duration is specified for any of the standard headers in the file. This is not uncommon and all headers and QuickTime contents are optional. it depends on the recording device and the software used to process the files if and which QuickTime metadata is added / survives.

This is the reason why IMatch uses the info from FFMPEG to produce its internal Duration attribute - because FFMPEG analyzes the actual video frames and does not rely on crappy metadata.

As I always say: The metadata mess for video files is much worse than for images. And its already a mess for images.

PS. Your exiftool output.txt does not contain and useful info, no metadata dump or anything.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

Sorry - wrong file was produced.
Attached the proper exiftool output.


I am fully aware of the metadata mess and lack of standard. But it irks me that the file does have
useful (if non-standard) metadata and I can not use it in Imatch. Would there be some way around this -
somehow extracting it via exiftool and placing it into (the correct place - or a custom one) so that we can use it
like other meta data? With a script?

Mario

#7
What is the problem? Does IMatch not show all tags? Not import all tags? Did you check the tag mamager to find the tags you are missing? There are over 30 QuickTime tags groups when I remember correctly and only the common ones are enabled in the Tag Manager by default.

It would be helpful to provide a sample video so we can look at the metadata and what ExifTool imports from it.

Dynamic tags like "Track1" or "Track2" are usually not imported because they have different names for different files. ExifTool makes them up as it goes. Hence they are not in the "all tags" list IMatch imports from ExifTool.

Why don't you ask your device vendor (Apple?) why they don't fill in the correct QuickTime tags? This would solve the problem.
Apple hardware is super-expensive and hence should be super-good. Solving the problems at the IMatch end not always works.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

I mail a sample file to support (6mb).
QuoteDoes IMatch not show all tags? Not import all tags? Did you check the tag manager to find the tags you are missing? There are over 30 QuickTime tags groups when I remember correctly and only the common ones are enabled in the Tag Manager by default.

The tags that Im shows are shown in the screen shot of the metadata browser. I did look in the tag manager for the missing tags but I can not find them.
I assume the tag manager shows only what is "standard" - thus I concluded that the metadata is non-standard (maybe "uncommon" would
be a better term for video files.)

The videos in question are from a Samsung!! smartphone S8. (Notice that they do not show the model or the make in the metadata -
maybe they are ashamed of their product!!

Mario

If the tags don't show up in the Tag Manager, they are not available in IMatch.
As I said, ExifTool makes up dynamic tags on-the-fly, numbering repetitive tags like Bla1, Bla2, ...
In your case this refers to the video and audio and maybe narration tags in your video file. There can be any number of them, in any sequence.

Since these tags are not part of the 15,000 tags IMatch knows about, IMatch has no "mapping" and cannot import them. No info is available about these tags, no data type, etc.
If you really need to get this data because none, really none, of all the other QuickTime duration headers is filled in your files (ask Samsung, you paid for your phone) and neither you can use the IMatch variable, you will have to write a script which runs ExifTool on the command line, directs the output into JSON (I recently explained that in the App board) and then start fishing for the dynamic tags you like (note that they may be named differently for each file). Once you have the data, store it in a metadata tag.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Mario

I have received your file. PLEASE always include a link back to the community topic when you send me emails.
I get about 50 emails per day, usually have a backlog of 50 to 100 emails and I cannot keep everything in my head.

I have added your video to a test database. I can see 3 (!) duration timestamp tags, all with the 7.9 second duration value.
No problem at all. This is also was IMatch's own duration attribute / variable reports.

As I said, make sure that you enable all QuickTime tag groups in the Tag Manager. Then do a forced rescan for your files. Then maybe disable unneeded QuickTime tag groups again to reduce database overheard.

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

ubacher

I had looked in the tag manager for appropriate tags.  Here is my problem:
When I have an entry in the exiftool output like:
Quote[QuickTime]     Duration     
how do I relate this to the tag
QuoteQuicktime Movieheader ->Duration
??

Is this a trial and error process? Does exiftool publish a list of correspondences?

Mario

You need to set the correct options to make ExifTool display the full name. See -G and -g in the ET docs.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

Using the -g option helps but still leaves uncertainty.

I ended up enabling all quicktime tags in the tag manager to see which has data. Then I deleted/disabled
the tags that are not wanted. I am OK until I get videos from another camera.

And I learned: QT specifies the use of UTC for creation date. This rule is followed
by the Samsung metadata! I previously considered this incorrect.
(But the time zone is not stored anywhere - so some correction is still needed.)

jch2103

#14
Quote from: ubacher on April 05, 2019, 09:57:29 PM
...
I am OK until I get videos from another camera.

And I learned: QT specifies the use of UTC for creation date. This rule is followed
by the Samsung metadata! I previously considered this incorrect.
(But the time zone is not stored anywhere - so some correction is still needed.)

I've discovered also that a number of video editing programs either drop all metadata in output files (including date/time) or in the case of Photoshop/Lightroom reset the date/times (for XMP as well as QT tags) to the new file's creation date/time in UTC. However, it is apparently possible to put the time zone in QuickTime fields (see e.g., https://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/QuickTime.html#MovieHeader). I haven't done this yet so I don't know if doing so in the original file would change the time display in an output file (in the case of Photoshop).

It seems to be very easy to fall down the rabbit hole with video metadata...
John