Rocky wrote: ↑Wed Jan 17, 2024 7:44 pm
@
hubblec4
"Actually, the playing time of the MKV should have the highest value of all the tracks used."
Should, hehe. I made an MKV by just doubling the streams so it was 4 hours+. Then I applied the original chapters file and opened it in MPC-HC. The reported duration is always the same as the end timestamp of the last chapter. If I edit that in the chapters file, the reported duration changes accordingly. Did you know that?
I'm not entirely sure if I got everything translated correctly.
By “original chapter file” which file do you mean?
If there were ordered chapters and the chapter times are all consecutive, then the last end timestamp is always the play duration.
Whenever ordered chapters are used, the player must create a new virtual timeline and then calculate a total playing time from all chapter durations.
You could also place an ordered chapter in the 4h video, which should only play 10 minutes of a certain part.
Then the player only shows 10 minutes as the playing time.
That's why I love these ordered chapters so much. I can always tailor the content of the films or homemade videos to make them fun.
Without any hassle cutting or re-muxing.
Just change chapters, that's all.
Rocky wrote: ↑Wed Jan 17, 2024 7:44 pm
Without cues wouldn't seeking have to linearly search a multi-GB file? Or is there some kind of binary search with file seeking? Or can you skip millisecond by millisecond, as clusters seem to come at that interval?
I'm currently working on my own EBML and Matroska lib for FreePascal.
Finding the next cluster is super quick and the player can do this in the background while the video starts.
In VLC there is an option to preload all clusters.
This is more or less the nature of Matroska, parsing is very fast, because only a few bytes are read out and a parser knows where is the next Element.
EDIT:
There is no fix interval for Clusters. Only recommended restriction of 5mb or 5 seconds, MTX would then write a new Cluster at the latest.
If a large jump is requested, the player can do a "guess-jump" calculated of the current position.
Find a Cluster and check the timestamp. If it's close to the requested timestamp then the next Clusters can be parsed quickly.