fiqs8sjn5by0n

Chapter support in Matroska (MKV)

By cfz | January 6, 2009

  • is it possible to add the chapter information (txt file from dvddecrypter ) in mkv container to allow chapter selection in bookmark window of the osd ??? :idea:

    and better : add jpg picture to illustrate chapters ... *:thumbsup:

    maybe this could be fine new features ?! :saint:

    thanks to coders for this fabulous work !!! *:bowdown:


  • +1 :) I recently muxed some chapters into a Concert. Hopefully it won't be long now till a Dev adds chapter support incl "title" support for chapters


  • Well, i initially didn't add it that way. Up/Down skips chapters instead of doing large seeks when file supports chapter.

    I've now also added so the > works fine for non dvd's with chapters, which didn't work before.

    Thanks elupus.

    The "up/down" works well on my xbox, I just didn't know how to do it.

    I think the > will be nice too, though.

    Wes


  • Just to bump this up a bit, I thought I'd try clarifying what I mean when I'm requesting "chapter support" in matroska.

    I use Handbrake to rip our family's DVD's to MKV files (using xVid) with the chapter markers preserved. A MediaInfo dump of the meta information in the MKV looks like this:


    General #0
    Complete name : C:Documents and SettingsAdministratorDesktopDVDsxVidsBatmanBe ginsxVidAC3.mkv
    Format : Mk
    File size : 1.91 GiB
    PlayTime : 2h 19mn
    Bit rate : 1953 Kbps
    Writing application : HandBrake 0.9.1
    Writing library : libmkv 0.6.1.2

    Video #0
    Codec : MPEG-4 ASP
    Codec/Info : MPEG4 ISO advanced simple profile
    PlayTime : 2h 19mn
    Width : 720 pixels
    Height : 360 pixels
    Display Aspect ratio : 2.35
    Frame rate : 23.976 fps

    Audio #0
    Codec : AC3
    Codec/Info : Dolby AC3
    Channel(s) : 2 channels
    Sampling rate : 48 KHz
    Language : English

    Chapters #0
    1 : 00:00:00.000 Chapter 01
    2 : 00:03:38.301 Chapter 02
    3 : 00:07:30.324 Chapter 03
    4 : 00:11:33.025 Chapter 04
    5 : 00:16:14.682 Chapter 05
    6 : 00:19:43.348 Chapter 06
    7 : 00:24:18.373 Chapter 07
    8 : 00:28:23.785 Chapter 08
    9 : 00:31:24.299 Chapter 09
    10 : 00:35:52.859 Chapter 10
    11 : 00:38:23.676 Chapter 11
    12 : 00:41:13.679 Chapter 12
    13 : 00:43:07.167 Chapter 13
    14 : 00:46:56.855 Chapter 14
    15 : 00:49:42.896 Chapter 15
    16 : 00:53:25.076 Chapter 16
    17 : 00:55:54.100 Chapter 17
    18 : 00:58:01.352 Chapter 18
    19 : 01:03:30.848 Chapter 19
    20 : 01:05:51.989 Chapter 20
    21 : 01:08:37.822 Chapter 21
    22 : 01:11:24.822 Chapter 22
    23 : 01:13:18.435 Chapter 23
    24 : 01:16:15.112 Chapter 24
    25 : 01:19:49.743 Chapter 25
    26 : 01:23:53.361 Chapter 26
    27 : 01:29:01.627 Chapter 27
    28 : 01:32:35.716 Chapter 28
    29 : 01:37:47.987 Chapter 29
    30 : 01:40:32.651 Chapter 30
    31 : 01:45:08.135 Chapter 31
    32 : 01:49:31.106 Chapter 32
    33 : 01:51:28.348 Chapter 33
    34 : 01:54:48.006 Chapter 34
    35 : 01:58:10.083 Chapter 35
    36 : 02:01:54.015 Chapter 36
    37 : 02:05:00.159 Chapter 37
    38 : 02:06:05.891 Chapter 38
    39 : 02:09:17.541 Chapter 39
    40 : 02:10:56.056 Chapter 40


    What I'm specifically requesting is the ability to press << or >> on the remote control and skip to the previous/next chapter marker in the Matroska file, using either DVDPlayer or MPlayer.

    Would be great if this worked in AVI files and other containers that support chapters as well, but Matroska is the most desirable, I think.

    Hope this helps.

    -Wes


  • I believe that chapters (working the same as DVD-Video chapters) is supported in OGM containers with the latest XBMC SVN builds of XBMC (google "T3CH XBMC binary build") using the DVDPlayer in XBMC, however in my opinion OGM is off-topic for this thread, so if you want to discuss OGM chapter support then please go to this other thread instead => http://xbmc.org/forum/showthread.php?t=2441

    MKV (Matroska) chapters is not yet supported in XBMC as far as I know, ...however I think I remember reading recently that chapter support for MVK has now been implemented in FFmpeg (http://ffmpeg.mplayerhq.hu) (can anyone confirm this?), and since FFmpeg is used in XBMC's DVDPlayer (http://xboxmediacenter.com/wiki/index.php?title=DVDPlayer) (one of XBMC's video player) it could possibly be as simple for our developers as updating FFmpeg (http://ffmpeg.mplayerhq.hu) in XBMC and then activating/linking that feature in the DVDPlayer (http://xboxmediacenter.com/wiki/index.php?title=DVDPlayer), though I am not sure.


  • It is now in the XBMC SVN, thanks elupus![Xbmc-svn] SF.net SVN: xbmc: [13293] trunk/XBMC/xbmc/cores/dvdplayer

    Revision: 13293
    Author: elupus
    Date: 2008-05-28 16:04:26 -0700 (Wed, 28 May 2008)

    added: chapter support for mkv files.

    Modified Paths:
    --------------
    trunk/XBMC/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h
    trunk/XBMC/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
    trunk/XBMC/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h
    trunk/XBMC/xbmc/cores/dvdplayer/DVDPlayer.cpp
    trunk/XBMC/xbmc/cores/dvdplayer/DVDPlayer.h


  • Added to trac #4414 (http://xbmc.org/trac/ticket/4414)


  • I know the Media Control Plugin for Vista

    http://damienbt.free.fr/index.php

    has support for mkv chapters. The impression I get is that the requisite chapter coding comes from Haali splitter

    http://damienbt.free.fr/phpBB2/viewtopic.php?t=275

    I don't know much beyond that. XBMC doesn't use haali splitter for audio streams purposes, right?


  • Any update on when this can get into SVN? [url=http://capnbry.net/~bmayland/fi/code/chaptername_support.diff]Link to patch again[url] for chapter name support in MKV files.


  • I believe that chapters (working the same as DVD-Video chapters) is supported in OGM containers with the latest XBMC SVN builds of XBMC (google "T3CH XBMC binary build") using the DVDPlayer in XBMC, however in my opinion OGM is off-topic for this thread, so if you want to discuss OGM chapter support then please go to this other thread instead => http://xbmc.org/forum/showthread.php?t=2441

    MKV (Matroska) chapters is not yet supported in XBMC as far as I know, ...however I think I remember reading recently that chapter support for MVK has now been implemented in FFmpeg (http://ffmpeg.mplayerhq.hu) (can anyone confirm this?), and since FFmpeg is used in XBMC's DVDPlayer (http://xboxmediacenter.com/wiki/index.php?title=DVDPlayer) (one of XBMC's video player) it could possibly be as simple for our developers as updating FFmpeg (http://ffmpeg.mplayerhq.hu) in XBMC and then activating/linking that feature in the DVDPlayer (http://xboxmediacenter.com/wiki/index.php?title=DVDPlayer), though I am not sure.

    Thanks I'll check it out!


  • I see now that chapters for Matroska is in the svn, but i cant seem to get them to work. I bring up the dvdplayer osd & try to jump to a chapter & it takes me back to my videos page.

    Tried playing it with mplayer & dvdplayer

    I checked my test video & the chapters work fine using vlc media player on the pc.

    I have i missed something ?


  • Oh absolutely. The DVDDemuxFFmpeg::GetChapters() returns 0 if there's no m_pFormatContext, if m_iCurrentPts is DVD_NOPTS_VALUE, if the AVContext has no chapters, or if the PTS value is outside the range of all the chapters. I rely on GetChapter() to do all the work and return 0 if there's anything wrong, which makes the patch pretty small.

    Switching gears slightly, for anyone who doesn't want to wait for this to get properly integrated into skins, here's the change for PM3 I used for testingIndex: skin/Project Mayhem III/PAL/DialogFullScreenInfo.xml
    ================================================== =================
    --- skin/Project Mayhem III/PAL/DialogFullScreenInfo.xml (revision 13974)
    +++ skin/Project Mayhem III/PAL/DialogFullScreenInfo.xml (working copy)
    @@ -268,8 +268,8 @@
    Chapter Pos No
    200
    680
    - 80
    -
    + 60
    +
    player.chaptercount + !Control.HasFocus(2) + !Control.HasFocus(61)
    right
    font10
    Index: skin/Project Mayhem III/PAL/DialogSeekBar.xml
    ================================================== =================
    --- skin/Project Mayhem III/PAL/DialogSeekBar.xml (revision 13974)
    +++ skin/Project Mayhem III/PAL/DialogSeekBar.xml (working copy)
    @@ -200,7 +200,7 @@
    60
    center
    center
    -
    +
    player.chaptercount
    right
    font13


  • Doesn't work on January 6th, 2008 SVN either, with mplayer or DVDPlayer.


  • Oh dammit I should have previewed first. This is actually that link (http://capnbry.net/~bmayland/fi/code/chaptername_support.diff)@CapnBry, please create a new patch ticket on Trac for it.
    http://xbmc.org/trac

    @waldo22, you should also create new ticket on trac for your feature request.


  • does anyone know if xbmc supports chapters in matroska files? i have a few matroska files containing xvid video, vorbis audio and chapters, but if i press the next chapter button on the remote the playback tops and returns me to the selections list, just as if i pressed stop. if i load the file in vlc the chapters all show up.

    thank you for any reply.


  • I do not know (do not have a Matroska file with chapters to test), why don't you simply try playing back a file with the DVDPlayer to find out?


  • i would also very much like to see chapter support implemented for .mkv(matroska)-files. i have a lot of music-concert videos in matroska and the different songs can be jumped to immediately in for example media player classic using page-up and page-down keys. it would be even more beneficial in xbmc since you cannot fast forward using the mouse like on a pc.

    right now if i press the skip-next button on the remote (the one you use to skip to next chapter in a dvd movie) xbmc just terminates the video and drop me back to the xbmc gui. i don't know if this is best implemented by loading the bookmarks for the video-file with the chapter-information extracted from the mkv-file or using similar routines as in the xbmc dvdplayer or some other solution, but hopefully some good dev familiar with the mkv-format could implement this.


  • Well, i initially didn't add it that way. Up/Down skips chapters instead of doing large seeks when file supports chapter.

    I've now also added so the > works fine for non dvd's with chapters, which didn't work before.

    Is this functionality in the xbox build too, or just the Linux/Mac/Windows builds?


  • Sorry I didnt realise that.


  • Looks good to me. The only thing I can think of that could go wrong is checking that GetChapter() returns 0 whenever there is no chapters (i.e. ensuring that chapterIdx is actually in the set [1 .. m_pFormatContext->chapters.size()])

    Assuming that is OK, it looks fine. Mind checking?

    Cheers,
    Jonathan


  • This chapter code only appears to be in the DVDPlayer core and support for MKV chapters is only in the ffmpeg demuxer, so unless Xbox builds don't use the mplayer any more there's no chance of it being in Xbox.

    Capn,

    This thread has quickly gone over my head, but could you explain this statement?

    Do you mean "DVDPlayer core" as opposed to the DVDPlayer that is in all branches?

    Isn't the ffmpeg demuxer used for DVDPlayer for the xbox build as well?

    Is it a lot of work to compile this version of DVDPlayer for xbox as well?

    Clearly, DVDPlayer is now the player of choice for all platforms.

    I can finally play Apple's h.264 product demos on my xboxex perfectly in DVDPlayer, when they jerk like crazy in mplayer.

    Thanks for the work you're doing for the other platforms, even if I don't understand :o

    -Wes


  • try to use 'Long Seek' (dpad Up)=Chapter fwd, see if that makes a difference
    afaik, We no longer rely on > in OSD to change chapter


  • Oh dammit I should have previewed first. This is actually that link (http://capnbry.net/~bmayland/fi/code/chaptername_support.diff)


  • elupus,

    Do you think you'll have time to roll this into the xbox build?

    I'd send beer, but I think all the good stuff is already on your side of the Atlantic.

    -Wes


  • This would probably have to be done in DVDPlayer, right?

    Do you think it's a simple matter of DVDPlayer "catching" and handling the << and >> buttons for non-DVD content, jumping to the previous or next chapter's timestamp, and refilling the buffers, or is it something that will have to be implemented in the demuxer (ie. does ffmpeg have to support it?)

    Wes


  • Added to trac #4414 (http://xbmc.org/trac/ticket/4414)

    CapnBry, looks like this is done now. (Thanks Jezz_X!)

    Thanks for all your work on this Elupus, Jezz_X, FFMPEG guys, and others.

    I'll look for the next T3ch build. (next week maybe).

    Wes


  • I'll put a new patch against head in trac tomorrow morning. I would have done it when trac went back up but there was a conflict and I didn't have the time to look at it. I was afraid of making a sloppy patch so I held off.


  • Well, i initially didn't add it that way. Up/Down skips chapters instead of doing large seeks when file supports chapter.

    I've now also added so the > works fine for non dvd's with chapters, which didn't work before.


  • not long now till it hits linux branch :)


  • will chapters be finaly avaible? is it possible guys? :bowdown:


  • What are the chances of getting this into the xbox build?

    I don't even have the xbox controller, I only use the remote, so how would I do chapter fwd with that?

    In a DVD, using DVDPlayer, I use the > key on my remote control (Yamaha Home Theater remote programmed for RCA DVD Player) and it skips forward to the next chapter.

    Is this not the way it works in the other builds?

    -Wes


  • you can't fast forward using a mouse, but you can do basically the same thing with the right analog stick on the xbox controllers (assuming you are using one of those).


  • Maybe you could try to catch elupus on IRC for discussion :;):
    http://xbmc.org/wiki/?title=Appendix_D:_Development_Notes#Contact_metho ds


  • Is this functionality in the xbox build too, or just the Linux/Mac/Windows builds?
    This chapter code only appears to be in the DVDPlayer core and support for MKV chapters is only in the ffmpeg demuxer, so unless Xbox builds don't use the mplayer any more there's no chance of it being in Xbox.

    To change topic: I'm really shaky on how things should be coded but here's a go at a patch to add support for chapter names for mkv files, which can be accessed through skins via the player.chaptername $INFO tag. I welcome comments from developers
    Link to diff vs r13974 since sf's tracker is down (http://capnbry.net/~bmayland/fi/code/chaptername_support.diff)

    Things I'm not sure if I did the XBMC Way:
    -- When adding a GUI Info constant (i.e. PLAYER_CHAPTERNAME) should it go with the other constants related to chapter and move the rest down, or just at the end like I did?
    -- Should IPlayer::GetChapterName() return a string vs modify a passed one? Other functions in the class seem to work with the passed string, so I copied that.

    Tested on the Win32 and Linux builds on DVDs, mkvs with chapters, mkvs with no chapters, mp4s with chapters and without (although chapters do not work at all in mp4), and avi files.


  • Actually waldo22, checking the code I may or may not be completely accurate because the linuxport branch and trunk (which I believe the xbox builds still come from) have different code. I have not built a xbox build since my xbox is experiencing the Autumn of its years and doesn't work so well any more.

    Ok so when xbmc wants to play something it needs a player, and that top level object is called the Player Core. XBOX has DVDPlayer, MPlayer, PAPlayer and maybe ModPlayer. By default xbox hardware prefers the mplayer core to the dvdplayer core. And I've just realized that you've already realized that you can override the default core with the "Play using..." context menu option sooooo you know all this already. But to finish the concept for academic purposes: then player core picks a demux, and the demux picks the codecs.

    I guess the question is does the > button chapter skip, right? Yeah it was added to trunk's ffmpeg demux in r13293 (May 28) and DVDPlayer in r13533 (Jun 11). It should be bound to the "skipplus" and "skipminus" actions in your remote map.


  • I do not know (do not have a Matroska file with chapters to test), why don't you simply try playing back a file with the DVDPlayer to find out?

    Sorry for the long delay... I didn't get a notification that you replied.

    I tried using DVDPlayer on the November 25th SVN build, and it doesn't work.

    I'll try updating to the latest SVN and report back.

    Wes


  • :joker:

    no ideas ? ...

    eh ?! i'm in feature suggestion ?! :nuts:

    if it's in feature suggestion : it could be very fine to associate a small picture to chapter, in mkv it's not very hard i think, like "chapter001.jpg", "chapter002.jpg" ... and display it in bookmark window ... :evil:


  • any progress on this?


  • FYI; FFmpeg (http://www.ffmpeg.org) just added support for chapters in MKV containers to their SVN two days ago, so it should now hopefully not be too much work for XBMC developers to add support for it to our DVDPlayer video-player core, handled the same way as IFO-VOB/DVD-Video chapters, (but I do not know about our MPlayer video-player core).
    http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2008-May/thread.html#46915
    http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2008-May/046915.html


    XBMC doesn't use haali splitter for audio streams purposes, right?No, XBMC only use native code (FFmpeg (http://www.ffmpeg.org)), and not DirectShow. Read this (http://xbmc.org/wiki/?title=Codec_and_Format_requests).
    No external decoders or demuxers/splitters is possible to plugin like that.


  • I'm ecstatic! Thanks, elupus!

    And thanks Gamester for noticing this in the ffmpeg svn.

    -Wes


  • Excellent - thanks for saving me the legwork of looking through the code myself :)

    Will get it in to SVN later tonight if someone else doesn't beat me to it.

    Cheers,
    Jonathan


  • Matroska chapters are not yet supported under XBMC for Xbox, only for XBMC for Linux, Mac OS X, and Windows, ...or?


  • Does any version of XBMC support chapters in MKV or OGM files? If so which ones... If not how would I go about implementing it?


  • I'm glad you added your support, Nate. I'm honestly surprised that no one else seems to think this is a useful feature.

    Maybe it's just extraordinarily difficult to do?

    Wes


  • I'd like to second this request. Now that I've finally installed xbmc onto Linux, all my pretty chapters don't do anything in my hd mkv files. It's possible that there isn't a great demand for this yet (or possibly ever), but it sure would be nice to see some mkv chapter love.







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Chapter support in Matroska (MKV) , Please add it free.

    Topics: enart.xn--fiqs8sjn5by0n.com | edit

    Cash Loan: Affable Financial Assistance for Emergencies Learn Spoken English Through the Correct Method