mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 12:10:37 +00:00
5fcb7f715a
This fixes a bug where in some files mehd.fragment_duration is one unit less than the actual duration of the fragmented movie, as explained below: mehd.fragment_duration is computed by scaling the end timestamp of the last frame of the movie in (in nanoseconds) by the movie timescale. In some situations, the end timestamp is innacurate due to lossy conversion to fixed point required by GstBuffer upstream. Take for instance a movie with 3 frames at exactly 3 fps. $ gst-launch-1.0 -v videotestsrc num-buffers=3 \ ! video/x-raw, framerate="(fraction)3/1" \ ! x264enc \ ! fakesink silent=false dts: 999:59:59.333333334, pts: 1000:00:00.000000000, duration: 0:00:00.333333333 dts: 999:59:59.666666667, pts: 1000:00:00.666666666, duration: 0:00:00.333333334 dts: 1000:00:00.000000000, pts: 1000:00:00.333333333, duration: 0:00:00.333333333 The end timestamp is calculated by qtmux in this way: end timestamp = last frame DTS + last frame DUR - first frame DTS = = 1000:00:00.000000000 + 0:00:00.333333333 - 999:59:59.333333334 = = 0:00:00.999999999 qtmux needs to round this timestamp to the declared movie timescale, which can ameliorate this distortion, but it's important that round-neareast is used; otherwise it would backfire badly. Take for example a movie with a timescale of 30 units/s. 0.999999999 s * 30 units/s = 29.999999970 units A round-floor (as it was done before this patch) would set fragment_duration to 29 units, amplifying the original distorsion from 1 nanosecond up to 33 milliseconds less than the correct value. The greatest distortion would occur in the case where timescale = framerate, where an entire frame duration would be subtracted. Also, rounding is added to tkhd duration computation too, which potentially has the same problem. https://bugzilla.gnome.org/show_bug.cgi?id=793959 |
||
---|---|---|
.. | ||
atoms.c | ||
atoms.h | ||
atomsrecovery.c | ||
atomsrecovery.h | ||
descriptors.c | ||
descriptors.h | ||
fourcc.h | ||
gstisoff.c | ||
gstisoff.h | ||
gstqtmoovrecover.c | ||
gstqtmoovrecover.h | ||
gstqtmux-doc.c | ||
gstqtmux-doc.h | ||
gstqtmux.c | ||
gstqtmux.h | ||
GstQTMux.prs | ||
gstqtmuxmap.c | ||
gstqtmuxmap.h | ||
gstrtpxqtdepay.c | ||
gstrtpxqtdepay.h | ||
isomp4-plugin.c | ||
LEGAL | ||
Makefile.am | ||
meson.build | ||
properties.c | ||
properties.h | ||
qtatomparser.h | ||
qtdemux.c | ||
qtdemux.h | ||
qtdemux_debug.h | ||
qtdemux_dump.c | ||
qtdemux_dump.h | ||
qtdemux_lang.c | ||
qtdemux_lang.h | ||
qtdemux_types.c | ||
qtdemux_types.h | ||
qtpalette.h |