Bug 240409

Summary: Support for chapter navigation in M4B files
Product: [Applications] amarok Reporter: Marcus Ilgner <mail>
Component: Playback/CUE sheet supportAssignee: Amarok Developers <amarok-bugs-dist>
Status: CONFIRMED ---    
Severity: wishlist CC: abhiin1947, aspotashev, bart.cerneels, mail, matej, nhn, teo, unnamedrambler
Priority: NOR    
Version: 2.3.1-GIT   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description Marcus Ilgner 2010-06-02 01:29:39 UTC
Version:           2.3.0 (using KDE 4.4.2) 
OS:                Linux

It would be great if Amarok could navigate between chapter markers in a M4B file.

Reproducible: Didn't try
Comment 1 Casey Link 2010-06-02 01:35:26 UTC
Hm, we definitely have the infrastructure for this (timecodes/position bookmarks).. all that would really be required  would be parsing out the chapter metadata from the files.

I'm not sure what library we use to read tags from m4a/b files, but if it supports reading the chapter metadata this feature should be pretty easy to implement.

I don't have any m4b tracks with bookmarks, do you know of any I can obtain (legally of course)?
Comment 2 Marcus Ilgner 2010-06-02 16:15:36 UTC
That sounds really great. I was under the impression that Amarok uses libmp4v2 but it seems to have been removed from the dependency list and I couldn't find any reference in the source anymore.
You may find M4B-formatted audio books under http://wiki.librivox.org/index.php/M4B_Catalog - I just tried "The Art of War" and it contains cover art as well as chapters.
Also I just read that some of M4B players support bookmarking the current playing position when the user stops playback to allow users to resume listening where they left of the next time the file is played. This seems like a clever thing to do and shouldn't be that hard to implement either.
Comment 3 Casey Link 2010-06-02 17:30:06 UTC
This is a good Junior Job, that is a small task someone who wants to get into Amarok/KDE development.
Comment 4 Marcus Ilgner 2010-06-04 00:23:09 UTC
Ok, even though my knowledge of C++ is quite rusty (to say the least - too much Java the last 7 years...), I decided to give it a shot and dug around in the code for a bit.
And while adding chapter support to Amarok really doesn't seem that difficult, it seems to me that TagLib doesn't (at least explicitly) support MP4 chapters. There was a question regarding this on their mailing list a couple of months ago which unfortunately remained unanswered.
I'll do some testing and meanwhile freshen up my C++ again.

Until then, I'd like to discuss how this would work for the user, workflow-wise.
My current conception is like this:
As the MP4 file is scanned for "traditional" meta-data, it will also be checked for chapter markers. If some are found, a new bookmarks folder with the title of the file is created. 
I'm not sure if it should be created as a sub-folder of a parent called "Audio books" or not... It certainly could make the organization more clear in case the user has lots of audio books as well as other bookmarks. Should there be a preferences option for this?
However, in this folder the chapters are created as individual bookmarks with their names.
Comment 5 Myriam Schweingruber 2010-06-05 01:28:23 UTC
Marcus, I think this discussion is better done in the amarok-devel@kde.org mailing list rather than in a bug report. At least all Amarok developer can follow the discussion
Comment 6 Abhinandan 2013-02-16 16:09:36 UTC
HI, 
I'm a rookie and i am interested in solving this bug. It'll be great if i could get some guidance
Comment 7 Myriam Schweingruber 2013-02-16 17:15:29 UTC
(In reply to comment #6)
> HI, 
> I'm a rookie and i am interested in solving this bug. It'll be great if i
> could get some guidance

Please get in touch with us on the amarok-devel@kde.org mailing list, that's where the code related discussions happen. Please also have a look at http://community.kde.org/Amarok/Development/Join and read the the documents linked there first. You will find all development related information in either the wiki or directly in the code.
Comment 8 Matěj Laitl 2013-02-18 20:00:13 UTC
Unmarking this as a junior-job, this isn't that easy in fact.