Discussion:
[Matroska-devel] last frame duration
YIRAN LI
2017-02-22 23:26:03 UTC
Permalink
Hi guys,

I have an MKV video here
https://dl.dropboxusercontent.com/u/89678527/testsmall_video.mkv

for which the whole movie duration is 4:29 and the last frame position is
3:29

The default duration is set to 0 and block_duration not set, according to
spec, I assume frame duration then will be calculated by next pts - current
pts. But the thing is, when this movie is played in MPC-HOME, total
duration shown is 3:29, when played in MPV, total duration shown 4:29 and
when it reaches 3:29, immediately jumps to the end instead of staying at
last frame for 1 min.

Could anyone help to check if the file is 100% spec-compliant ? If default
duration is 0, do I need to set last frame duration? or should it be
calculated by whole duration - last frame position?

Thanks
Moritz Bunkus
2017-02-24 19:44:17 UTC
Permalink
Hey,
Post by YIRAN LI
Could anyone help to check if the file is 100% spec-compliant ? If default
duration is 0, do I need to set last frame duration?
Yes.
Post by YIRAN LI
or should it be calculated by whole duration - last frame position?
No. The file duration is calculated from the frame timestamps &
duration, not the other way around. Additionally, the file duration
doesn't have to refer to a certain track at all; it can easily be the
difference between the first audio frame's timestamp and the last
subtitle frame's timestamp+duration if that is the biggest
timestamp+duration in the file.

Kind regards,
mosu

Loading...