mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.51k stars 2.92k forks source link

Matroska playback #11780

Closed hubblec4 closed 11 months ago

hubblec4 commented 1 year ago

Hi all

I'm a EBML/Matroska developer helper and the author of chapterEditor.

I've been working with Matroska files since 2008 and since 2015 I've started to actively help in the development of Matroska, as well as in the development of MKVToolNix.

I'm a specialist in the Matroska Chapters/Tags as well as anything related to Matroska-Linking.

That's why I started programming my own chapter editor in 2013, because many (the most important and best) Matroska features are included in the chapters.

My goal is still to realize the Matroska Menu. A lot of time has passed and it is still not foreseeable when the Matroska Specs will be expanded accordingly.

But the biggest problem remains in the end, that a player supports all of that.

A while ago I set up a git repo that deals with playing Matroska files and the players. I also tested mpv and then didn't bother with mpv because too few features were supported. But I think mpv has the best chance of becoming a really good Matroska player. Especially because it looks very bad with Linux with good Matroska support.

But mpv has a wonderful thing that I have never seen with any other player. I mean scripting. I've started looking into it and I see all the possibilities. If I thought it through correctly, I could program a Matroska menu as a script completely independently.

However, mpv still has a few bugs and missing features and I really hope that I can find a team here that is willing to bring Matroska forward. I will be there with all my experience and help where I can.

I'm creating a checklist here for a better overview of everything I've already found in the Issues and PR's.

Hidden and Enabled Flag

The Enabled flag is indeed easy to handle. Such a chapter is fully ignored for non-ordered and ordered chapters. The Hidden flag is an important flag because it is used for some ordered chapters structures where you add content to the virtual timeline silently.

To create a multi-Edition mkv of a Blu-ray with multiple editions/movie cuts, it is necessary to use hidden ordered chapters. My chapterEditor is currently the only tool which can create such mkv's.

Nested chapters

This kind of chapter is indeed not widely used. Maybe because only few players support this. For all my Mainmenu.mkv's I use a Nested chapter structure, because it looks like a simple menu in the player(MPC-HC). All nested chapter names get a "+" in front for the first nested level and a "++" for the second level and so on. In a chapter menu (mostly a popup menu) it is now easy to find the correct chapter.

Nested ordered chapters

This topic is not really well defined in the specs. My suggestions how to handle this kind of chapters was rejected. At the moment my chapterEditor uses a workaround for that to simulate Nested ordered chapters. Unfortunately mpv don't handle this chapter structure correctly.

Hard-Linking

This is a popular kind of linking mkv's for users which don't want to use ordered chapters. My chapterEditor has an easy to use editor for this kind of linking. Only 2 Matroska elements are used for this feature and it is the weakest linking kind. Soft- and Medium-Linking "overrides" the Hard-Linking. But Hard-Linking has many "traps" and restrictions.

Only MPC-HC handles Hard-Linking correctly. VLC and other players have issues on the transitions and the video hangs sometimes a bit.

Native Matroska menu

This feature sounds worse than it actually is. A demuxer doesn't have to worry about the content of the data at all. Only the ChapProcess element has to be triggered, the rest then has to be managed by a Chapter-CODEC. Only VLC supports this and it works and is a nice feature. My chapterEditor also supports this.

Content grouping

This is maybe the best feature ever. With Haali's TRACKSETEX you can switch multiple things in one go. On Matroska is a discussion for implementing this feature.(but in a wrong direction). I'm sure this could be coded via script. Maybe I will try this as first, to learn more about scripting for mpv.

Can the mpv team imagine working on these Matroska features?

hubblec4 commented 1 year ago

There is a new release of mpvMatroska.

@CogentRedTester I had looked into the double chapter issue by splitting an mkv with MKVToolNix. IMO it is not a good idea to insert more data while splitting an mkv, and to remove such double chapters is a workaround only for that case. But I think it will be possible on my end to implement this workaround, but wit a very low priority.

Timestamp issue

I can't reproduce it on my end, and I need a working sample or more data to re-create this issue here.

The next step: I will try to implement the Matroska Native Menu feature.