[Matroska-devel] requesting "AvgTimePerFrame" or "FieldRate" header field

Moritz Bunkus moritz at bunkus.org
Sat Dec 15 13:19:30 CET 2012


Hey,

you seem to be mixing up some terms here. A Matroska field would not
include "i" or "p" information at all. Instead it would probably be
defined something like this:

AvgFrameDuration  --  everage display duration for a whole video frame
(telecine removal is not taken into account)

So let's draw up some comparisons between this proposed element and
default duration:

* 50 interlaced fields per second; default duration = 1000ms/50 =
20ms; AvgFrameDuration = 1000ms/25 = 40ms
* 25 progressive frames per second; default duration = 1000ms/25 =
40ms; AvgFrameDuration = 1000ms/25 = 40ms

or what would you expect?

> The same format as DefaultDuration for the new field
> would be fine with me. One alternative solution might be
> to use a similar logic as h264. Typical h264 values would
> be 48000/1001, 60000/1001 or 50000/1000, but that would
> require two new fields. So probably the DefaultDuration
> format would be simpler = better.

As a matter of fact the h.264 bitstream's rate fields tell you the
rate of fields per second. They don't tell you how many fields per
frame there are. This is exactly the same value that Matroska's
DefaultDuration stores. mkvmerge simply calculates the DefaultDuration
as 1000000000 * num_units_in_tick / time_scale, and those two values
are exactly the values stored in the h.264 headers.

However, I guess that you always get a definite answer to the question
"is the content interlaced or progressive?" from a different part of
the h.264 headers, and that that information is passed down to your
filter as well. That's what Matroska does not provide even though it
formally has an element called FlagInterlaced in the track headers.
mkvmerge does not write it, unfortunately.

Therefore it makes no sense to store AvgFrameDuration _before_
deinterlacing, because that's exactly what DefaultDuration already is.

Kind regards,
mosu


More information about the Matroska-devel mailing list