• 1
  • 11
  • 12
  • 13
  • 14(current)
  • 15
Multiple videos in a Matroska MKV container with Ordered Chapters / Segment Linking?
If anyone wants it here is my 17.3 windows build w/ the OrderedChapter commits from Moritz:

http://www.mediafire.com/file/a6vvp1zuea...OC-x86.exe
Reply
(2017-06-30, 18:58)garretn Wrote: If anyone wants it here is my 17.3 windows build w/ the OrderedChapter commits from Moritz:

http://www.mediafire.com/file/a6vvp1zuea...OC-x86.exe

Is this only for external linking, or would it work for choosing an edition from a 2in1 file created with Xin1generator? (eg single file with Theatrical and Director's Cut)
Reply
(2017-07-24, 00:31)EGOvoruhk Wrote:
(2017-06-30, 18:58)garretn Wrote: If anyone wants it here is my 17.3 windows build w/ the OrderedChapter commits from Moritz:

http://www.mediafire.com/file/a6vvp1zuea...OC-x86.exe

Is this only for external linking, or would it work for choosing an edition from a 2in1 file created with Xin1generator? (eg single file with Theatrical and Director's Cut)

This is only for external linking, I believe the code only uses the default edition currently.
Reply
From looking at the code, I think it just selects the first edition found. Not that it matters much, since the first edition is pretty much always the default edition anyway.

It selects the first (not default) edition, which in almost all cases is the default edition anyway. However, it doesn't honor hidden chapters, so many X-in-1 MKVs still won't work properly.

This patch should fix it:
Code:
xbmc/cores/VideoPlayer/DVDDemuxers/DemuxTimeline.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxTimeline.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxTimeline.cpp
index 5c7d0cb5f2..95b032655e 100644
--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxTimeline.cpp
+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxTimeline.cpp
@@ -218,7 +218,7 @@ CDemuxTimeline* CDemuxTimeline::CreateTimeline(CDVDDemux *primaryDemuxer)
   // collect needed segment uids
   std::set<MatroskaSegmentUID> neededSegmentUIDs;
   for (auto &chapter : edition.chapterAtoms)
-    if (chapter.segUid.size() != 0 && chapter.segUid != mkv.segment.infos.uid)
+    if (chapter.segUid.size() != 0 && chapter.segUid != mkv.segment.infos.uid && !chapter.flagHidden)
       neededSegmentUIDs.insert(chapter.segUid);

   // find linked segments
Reply
This is, for me, a very important issue as I use Kodi via a Shield TV for 99% of my TV and movie watching, and I have several movies with 2 or more cuts (theatrical/director/etc) in one mkv but unfortunately I can only watch the first one, as all the other scenes are placed at the end of the file and Kodi doesn't handle them properly due to the FFmpeg limitation. I've also very recently come across a situation where it would be helpful to use chapter ordering to create different versions of a series of numerous chapters in which they play in different orders, instead of creating separate, large mkv files for each order.

FFmpeg issue #3123 appears to be the critical step everyone is waiting for, so it would be a good idea for everyone wanting this functionality in Kodi to go upvote it.
Reply
(2017-09-04, 21:24)vertigo220 Wrote: FFmpeg issue #3123 appears to be the critical step everyone is waiting for, so it would be a good idea for everyone wanting this functionality in Kodi to go upvote it.

Don't hold your hopes too high concerning that ticket.

For one, the ticket has been opened 4 years ago with no progress whatsoever. In addition, this ticket completely ignores the fact that multi-edition files exist. It focuses on multi-file, single-edition MKVs only (just like mojo-hakase's patch does). As far as I understand, FFMPEG will do the same that Kodi does when encountering multi-edition files: It will play the file in encoded order, ignoring the edition/menu structure in the MKV.

Secondly, FFMPEG devs have repeatedly stated that they see ordered chapter support as a player feature and won't implement it into FFMPEG, while Kodi devs have repeatedly stated that they see it as a demuxer feature and won't implement it in the player. So we have a deadlock here.

IMO, the only viable approach would be, as mojo-hakase already proposed, to get FFMPEG devs to implement an API that presents all ordered chapter tables (the timelines) and segment IDs to the player, so the player can do with it as it pleases (ie. request the needed chapters from the demuxer, open any additional required files, etc.) Meaning, work has to be done on both sides, FFMPEG and Kodi.

Chances of seeing that feature anytime soon? Frankly, if you ask me, zero. There have been multiple proposals and patches for both FFMPEG and Kodi in the past 10 or more years that implemented ordered chapters - none of them was accepted, and the patch authors gave up at some point.

That being said, with mojo-hakase's excellent work implementing multi-file support, it's a piece of cake to add multi-edition support as well. It took me, all in all, little more than half an hour to get a first working version. Of course, it's an ugly ugly hack, since Kodi lacks multi-video-track support at this time, which would be required to get it implemented properly. And because I'm lazy and did as little work as possible, disregarding good coding practice ;-)

Download my 17.4 17.5 17.6 build with Ordered Chapter and Xin1 support here.
Or if you want to compile it yourself: Patches only

I think it works, I just don't have many files to test. And honestly, I didn't feel like rewatching a full Xin1 movie to check whether it's being played back properly all through, all editions... So - take it as it is, it might or might not do what it's supposed to do. Currently, I don't plan on doing any more work on it or fixing any bugs. But I hope it's useful to some of you!

How to use:
  • While playing, press Alt+PageUp/PageDown to switch editions back and forth.
  • When using a remote control, the PageUp/PageDown resp. ChannelUp/ChannelDown buttons will switch editions. This is a change from vanilla Kodi, where these buttons will skip chapters back and forth.
  • There will not be any indication which edition you are playing, you have to guess it based on playing time.
  • Everytime you switch editions, the video will skip a few seconds forward. I don't know why.
  • Playback will always start with the default edition, if one exists, or the first ordered edition, respectively. Non-ordered editions are ignored and cannot be played.
  • When resuming a file, playback will not resume in the previously watched edition, but in the default edition resp. first edition instead.
All required patches against Krypton source are included in the archive. Credits go to mojo-hakase, whose work this is based on, and to garretn for the Krypton fix.

Enjoy.
Reply
Thanks Shine. Believe me, I don't have high expectations for it, but I do hope that maybe by linking this thread and that issue, it will help people from either side to see the issue as a whole and, who knows, maybe the right person will see how important this is and work on it. Just trying to bring more attention to it is all.

Unfortunately, your build wouldn't help me, since I run Kodi on my Shield TV. If the Kodi devs could and would use your work to add the functionality to Kodi, so it would be included in a future build which would also mean the Android version would have it, then I would be happy to help you test it out, as I have multiple MKVs with two editions and even one with three, and I could easily play them simultaneously at 2-3x speed and keep an eye on what they're doing.
Reply
Neato. It'd be cool to select edition via a Simple Menu, like how they're implemented for blu-rays.
Reply
(2017-09-06, 18:07)vertigo220 Wrote: Unfortunately, your build wouldn't help me, since I run Kodi on my Shield TV.
Thats right, my build is Windows only, but the patches should work on all platforms, if you compile yourself or find someone who will compile for you. Unfortunately, I don't have the required Linux build environment for an Android build, so I can't be of help here.

(2017-09-06, 18:20)garretn Wrote: Neato. It'd be cool to select edition via a Simple Menu, like how they're implemented for blu-rays.
That would require actual work, including Kodi GUI work, so don't expect that from my side ;-)
Reply
LibreELEC build with patches from Shine here https://my.hidrive.com/share/le54qfkku6

find details of my community build here https://forum.libreelec.tv/thread/10515-...veracrypt/

There is only a Generic x86_64 build. The RPi2 version does not build because of a patch conflict. You need to use a version with mkv-Xin1-SL in the file name.

@Shine First of all Thank You. I would love to see a version with automatic language selection by the configured audio language for Xin1generator mkv. Can you please add this feature to your patches and explain how to extend the chapters.xml with language tags. I have movies with german/english video e.g. Star Wars. I shortly tested your patches with some Alien movies i created wit Xin1generator and it works fine.
Reply
if I'm not mistaken Kodi now does support multiple video streams you can choose from in the videosettings OSD during playback. Maybe this will help you guys to come up with an acceptable patch now? And with inputstream at hand, it might be possible to add a custom demuxer on top of whatever ffmpeg does - as the MPEG DASH stuff is also not part of ffmpeg and handled by inputstream.adaptive. So if you take inputstream.adaptive as an example and base your work on it, chances might be good to finally get your desired feature in. Hope that does help you guys in some way.
Reply
Potentially good news from da-anda. I hope the coders will be able to make this shine. Smile
For troubleshooting and bug reporting please make sure you read this first (usually it's enough to follow instructions in the second post).
Reply
(2017-12-11, 10:11)da-anda Wrote: if I'm not mistaken Kodi now does support multiple video streams you can choose from in the videosettings OSD during playback. Maybe this will help you guys to come up with an acceptable patch now? And with inputstream at hand, it might be possible to add a custom demuxer on top of whatever ffmpeg does - as the MPEG DASH stuff is also not part of ffmpeg and handled by inputstream.adaptive. So if you take inputstream.adaptive as an example and base your work on it, chances might be good to finally get your desired feature in. Hope that does help you guys in some way.

Hi da-anda

Is there a way currently to map switching the video selection to a keyboard key instead of having to go into video settings each time?

Audio track selection has a working map key.

Maybe something look into for v18

Cheers
Reply
(2017-12-11, 10:11)da-anda Wrote: if I'm not mistaken Kodi now does support multiple video streams you can choose from in the videosettings OSD during playback. Maybe this will help you guys to come up with an acceptable patch now? And with inputstream at hand, it might be possible to add a custom demuxer on top of whatever ffmpeg does - as the MPEG DASH stuff is also not part of ffmpeg and handled by inputstream.adaptive. So if you take inputstream.adaptive as an example and base your work on it, chances might be good to finally get your desired feature in. Hope that does help you guys in some way.
 Just tried on one of my videos made with xin1 and it only showed one available stream and wouldn't even let me select the option, presumably since there was nothing to change. So maybe this works if two completely separate streams are present (which I don't even know what the purpose of that would be) but not where only parts are different, as with a file made with xin1. This is on the Shield TV and my phone (latest version of Kodi on both, Shield and phone both up to date with phone on Nougat).
Reply
(2017-12-15, 11:06)hainguyen1993 Wrote: I think it's fair to say that the devs aren't interested, certainly not without knowing for sure whether it's a matroska "feature" or whether it's something someone else has hacked on. Smile

Another copycat poster... https://forum.kodi.tv/showthread.php?tid...#pid461532
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
  • 1
  • 11
  • 12
  • 13
  • 14(current)
  • 15

Logout Mark Read Team Forum Stats Members Help
Multiple videos in a Matroska MKV container with Ordered Chapters / Segment Linking?4