-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an option to link subtitle tracks to audio tracks #717
Comments
There is a |
The And every player could handle such a Link-system different.
It makes in my eyes totally sense, that Matroska provides such a Link-system. The good is, Haali has such a Link-system in his Splitter and it works great and is a pleasure to use it. The TRACKSETEX can be easy created and edit with an older version of chapterEditor. This Haali TRACKSETEX system takes also the video track and an Edition into account. I have two ways in my mind:
For all |
I don't think hardcoding groups of tracks is a good thing. One user may want the commentary in one language and subtitles in another. It is a user (and therefore a player) preference. Not something that should be hardcoded in the file. It should match the commentary and subtitle tracks with the preferred language (+combination) of the user. All it takes is the commentary and the language info of the track. And when linking segments, when you switch to the another segment, you pick the track with the same rule, it will work even if the segment is remuxed/transcoded/reordered/etc. |
I agree with you that a player should offer such preferences to the user. But on the other hand, Hardcoding groups of tracks is not a MUST for a player. With the players preferences, only one combination of tracks can be set.
I think there is no restriction when hardcoding groups of tracks is used. Both systems, player preferences and hardcoding, are fine. |
The Commentary flag works fine if you have a single commentary track, but some movies have more, for example LOTR has 3 audio commentary tracks. Being able to link the correct subtitles for these tracks would be very nice. |
Very good example @magistingen. On Terminator 2 Blu-ray there are also multiple Audio commentary tracks and a lot of Subtitle commentary tracks. With Haali's TRACKSETEX it was easy to combine the correct tracks together. |
@eddilara yes that's also possible with the Haali TRACKSETEX and with my suggestion for the new elements to group tracks. |
Many thanks for this inspiration. I have thought about it and it is fantastic and the best, it works :-) I like to have a simple menu within the player, and Matroska seems to be the best way. Until now I was sure I have to preserve extra stuff from discs (Blu-ray, DVD) in separated files, because the video streams uses different codecs. But storing everything in one file offers new possibilities. I have made for this a test with my favorite Test-Blu-ray: Terminator 2 (T2). Creating a multi-Edition.mkv of all three movie versions and with outtakes and other content is no big deal. I'm very impressed, because there is no longer a Matroska Linking feature required to link files, because there is only one file with all the content and the player handles all the streams. Perfect.
My test file has also different Editions with the chapters of each extra stuff and the main movies. Additionally, to build multi-Edition-mkv's you MUST use Grouping of video, audio and subtitles is NOT enough. Also the Editions have to be taken into account. Hey Steve, I count 4 users who like this new Matroska feature, could you imagine to change your opinion? |
Multiple editions of a film this way seems a bit inefficient tho. On BluRays they can link multiple files to have all 3 editions of Apocalypse Now come on one 100GB disc, but those 3 editions take up like 250GB in MKVs due to all the duplicated scenes. I assume implementing something like that into MKV would be out of the question but it sure would be neat. |
Interleaving unrelated content for the sake of having one file seems wrong. Multiple video tracks should be used for content that happens at the same time. If you want something happening at a different time, use different segments (in the same file if you want) or Ordered Editions that plays only a part of the file (beginning = actual movie, end of file = bloopers).
That sounds like Ordered Editions is exactly what you need. |
I do agree there's something needed here. The problem is to find the correct solution. We could add some element to tell a subtitle track corresponds to a given audio track. If we don't restrict it to subtitles that mean you can tell an audio track corresponds to a video track. But that means you can also do it the other way around, you can tell a video track corresponds to an audio track. But then you need to be able to tell all the audio tracks that correspond to that video track. So we would need a list of tracks for that. As you can see it can become complicated quickly. What if a video track tells it corresponds to an audio track and that audio track tells it corresponds to another video track ? A player needs to know what rule to apply with certainty. The problem is not to add an element to link one track with another or one track with multiple tracks, but the proper rules to use with it. I think we need a list. In a multi angle video, each audio track would correspond to all the video tracks. In the absence of this list, each track is considered to correspond to all the other tracks (current situation). |
Had no idea Ordered Editions was a thing in MKV and it does indeed sound like exactly what I want. However it seems support for it isn't all that common, I tried to search it up but there are few relevant results. Where can I read more about how to use it? As for the linking, although rare, I can think of scenarios where different video tracks would have their own audio track, so it should be possible to link audio to video tracks. A list seems like the best idea, I would use Link1, Link2 etc though there may be a better way. I would also like the ability to link multiple subtitle tracks to an audio track. This would be useful with my copy of Sleeping Beauty, which features still photographs in a separate subtitle track that's supposed to play alongside the commentary track, and should ideally have its own tag to tell the player that it isn't subtitles. |
You are a fully wrong. :)
My Matroska-Playback repo is a good point to start. |
To complicated like you think would I say. We don't need a linking system for the tracks, all what we need is a grouping of tracks and the Edition together so that a player change all this in one go. I'm very sure you have never tried Haalis TRACKSETEX and you don't know from what I speech. How simple it works, how simple to create it and how wonderful it is to use. A group of tracks which have to set by the player when the user activate such a group thats all what we need. Linking between tracks is not the right way in my opinion. |
As I'm working on a player on my dayjob (VLC) I do care a lot about not making specs too complicate that people won't bother with some features of Matroska. So it's important to do this right. It seems the consensus is to use a group of tracks that should go together. It's probably cleaner than having one track declare its dependency or one track declare its "children". IMO it's still opening a can of worms on the player side. For example if you select a subtitle track, should it switch to the corresponding audio (commentary) track as well ? (SHOULD as in a normative should, and even possibly a MUST). Also the presentation of this group is not a common thing in players. It doesn't exist in VLC, so a whole UI has to be built around that. Groups should have a name that people can recognize (main, directory commentary, actor commentary, etc). That could be an ID (type of group) that the player translates to its UI. But tags with different translations are probably better. Or maybe in addition to the ID so the author can refine the text. That means we need a |
Many thanks from me for all your work on VLC it will be the best chance to have a good working Matroska player on Linux in future.
Yes, grouping of tracks AND the Edition will be a simple and powerful solution. Please don't forget the Edition, it is not a track but it belongs to these grouping system, like Haali TRACKSETEX it does.
IMO definitive no. The stream selection should still work independent of the new "track-grouping" feature.
Yes, no player has currently a support for this new feature and no player has taken over the Haali TRACKSETEX feature. I'm very sure the UI is not so much work and simple to implement. Haali uses the existing popup menu from system TrayIcon and added on top the Track Sets if some found in the Matroska Tags.
Yes a name for a group is important and also supported by Haali(and support for a language code). To restrict or combine a group name with IDs makes the things again complicated and IMO not necessary. Here a link to Haali TRACKSETEX feature. I hope you have time to read. I had above posted a possible element structure for this new feature. I will add some descriptions.
What do think about this element structure? |
Imo, the link hierarchy should be video > audio > subtitles. Selecting a higher track should automatically select the lower tracks, but not vice versa. It should ideally also only select subtitles if the user wants subtitles, and in the correct language if available. In Plex, the user can configure language preferences so it should be relatively simple. In VLC, it could be done by detecting which subtitle language is already selected, and switching to the corresponding subtitle track for the commentary. If there is no corresponding track, default to whatever's there. For example, the user has French subs enabled, but the commentary only has English subs, so selecting the commentary audio automatically enables the English commentary subtitles. One way you could do the UI is by only showing the subtitles linked to the current audio track, so when you select Commentary 2 audio, and go to enable subtitles, only Commentary 2 subtitles are available. That way you don't need unique flag names and can just go by whatever the higher track is named. |
Actually I think watching a movie with the commentary (just) as subtitles could be interresting. Or the other way around, listening to the commentary but having the original dialogs shown at the same time can be nice. In general the format should not block people from using things the way they want. It is however necessary to "group" tracks for when people want the automatic feature, that information can't be guessed by the player. |
This is a good first step. I would not put a string there, for the same reason we don't have a track name. Adding translations means updating the beginning of the file when tags are usually at the end. But that means we need an ID (track group ID or UUID) so it can be addressed in tags. I don't think the Chapter Edition should be in there either for the reason I already gave:
Tracks and editions should be completly separated. If you need unrelated content in the same Segment then reuse the same track groups, or don't use the same Segment at all if you can't. Otherwise it becomes close to implement this spec in any player. |
I'm a bit confused. We have no track names??? YES we have track names.
What do mean with "translations"?
Oh Steve....why? :-) I'm now sure you have no experience (or to less) with Multi-Angle Blu-ray discs. And Haali TRACKSETEX uses also the Edition and I don't know why we not simple copy his work. |
For me it seems it is a feature, not a restriction or a thing what have to be restricted. MPC-HC plays fine such files and I'm sure VLC too(I have not tested). |
Yes, my bad, I forgot about it (and didn't look properly). Still IMO it's not very useful in modern Matroska as we have flags telling what kind of track it is (for example commentary). A player will do a better job of having all the translations it needs for this kind of tracks, and even some fancy icons. IMO we should not use a single language name, nor hundreds of languages for the track group feature. If you really want that you can use tags. On the other hand we probably want group types (like commentary flags). Maybe we just need a new track type that would reference other tracks in a Child element (like we have for audio and video elements). Then we can reuse all the existing features of tracks (including the legacy name and tagging). |
No but that sounds like content that should be played within the same timeline, so it totally falls into one Segment category. |
We will never use tags for playback features. |
Yes and the conclusion is, you have to switch the Edition if you want watch another Angle. |
I would say you are wrong. For a m2ts playlist it is not a problem to use content of other files.
Of course and I don't want use Tags, I want to make a copy of his work with new Elements. |
OK than we should not use a Display for Editions for should tag them. the same for Chapter or Track names, it would be better to tag this in future.... (ironic)
Oh...now it would be crazy :-) It seems you need a presentation of Haalis TRACKSETEX, should I prepare something for the Matroska Meeting? |
No need, you already presented it here at length. It's not rocket science to make a list of tracks. The "problem" is just to put it in a nice place. And I think a track type is the most adequate choice I've seen so far. It would be similar to the "program" list in TS streams. And it would likely be implemented using the same feature in VLC. If you look at the TS example, it's used in DVB to select channels (which comes with their group of audio and caption tracks). This is one case were a bitstream of multiple unrelated audio/video content are interleaved at the same time. And a track for grouping them means we could remux such TS streams to Matroska more accurately. Having a group separate from the usual track would work too. But we lose features available to tracks like FlagCommentary, FlagOriginal. That's the only 2 I could find. On the other hand a lot of things found in TrackEntry would make no sense for a track group, for example the mandatory track language (it includes multiples languages) or the codec ID. So in the end I think it can't be another kind of track. The TrackSets you proposed is close to what we need. I think we would need a "group type" in addition to tell what kind of group it is, like the main group, commentary group, or TV channels (if coming from DVB). |
Ahhh ha, very interesting and why have you implemented for a long time the We should to remove this immediately. :-) |
You can keep your sarcasm to yourself. We have a code of conduct that doesn't accept that.
The Adding a I looked at your example. I don't know how Haali's (closed source) code works, but it shows 2 editions. The TrackSet and Edition can potentially be contradictory, if you select Edition 1 and a TrackSet that uses Edition 2. Which one has priority ? If you select an Edition while you were using a TrackSet using a different Edition, which TrackSet is it going to use ? Or is Edition selection disabled when TrackSets have editions ? IMO this is the wrong way to do it, they should be completely separated. I can't think a real world example where you would want some video has a specifc set of audio/subtitle tracks not available to the other editions. That just means the video content is not related to the other parts of the video and should be in a separate Segment. Also if you have 20 editions, are you going to list all the TrackSets for each of the 20 editions ? And again, who has priority between TrackSet selection and Edition selection ? IMO this is way too complicated for some use case that doesn't exist in the real world. |
No. To set only an Edition without streams makes no sense, but it is possible.
When I set in Haalis TRACKSETEX an EditionUID and there is no Edition with this UID, simple nothing happens.
Cool, and thank you. And now maybe I understand you a bit better after I read all your questions.
It feels a bit to me that you think in a wrong direction. A TrackSet entry is not grouped like the Audio tracks or the Subtitle tracks. After selecting a TrackSet entry from a TrackSet list which is provided by a media-player, all the tracks/Edition will be set which are defined in these TrackSet entry. There is one thing what the player has to do after a user has used a TrackSet:
Again you are wrong here. Like I mentioned this is a normal and common case for Multi-Angle-Disc, Blu-ray and DVD. Lets say we have a Multi-Blu-ray disc with only 4 m2ts file and two Angles. The duration for all m2ts files are 60 seconds. An MKV stores this 4 m2ts in this order: 00001, 00100, 00002, 00200. With two Editions of ordered chapters it is now possible to play both Angles. Chapters When I want to change the Angles I have currently to make 3 changes. The same is used by DVDs, I had updated my chapterEditor for a while, so that is also possible to preserve multi-Angle-DVDs.
Mmmh I see I had maked a small issue with naming of the TrackSets and this could be irritating. The example is not really good to show when it makes sense to change also the Edition with other streams together. I also have no access to the source code but it is really a simple piece of code.
20 Editions are more or less not really used for normal mkv files, but ok, let's say we have a movie with 20 Angles.
Like I mentioned above a priority don't exists. Everything is independent of each other.
I think it is at this time too complicate because it is new to you. I had also need some time to understand what Haali has coded and for what I can use it. But after I get my first Multi-Angle Blu-ray I was interested how it works. Ok and now I still have to mentioned that Matroska already has a TrackSet system, but it is misplaced and not good useable. In your PR you have used only a This feature is also presented in my Matroska-Playback repo but no player supports these elements. |
I thjnk is a very good idea for example a star warsa movie with 4 audiocomments of the director, the scy fi guy etc, and 12 subtitles, for some languages and for these audio tracks, is nice to know wich subtitle is for each sound track. |
Hi @eddilara @felisucoibi @ehsope I have used the time to learn Lua and scripting for mpv. |
This would be very useful for commentary tracks, so that if you select a commentary track for a movie, the subtitles for that track are also automatically selected.
The text was updated successfully, but these errors were encountered: