Page 1 of 4

Chapters inside MP4 file

Posted: Tue Feb 06, 2007 12:16 am
by Vidar
I have been using HandBrake for around a year now, and have found it to be the best solution that I have tried for ripping TV shows to my Mac Mini, to watch on my connected HDTV. Many thanks go out to all of you that have been working very hard on bring the masses an updated version.

There is one feature that I have not seen requested yet, and I'm not sure if it is something that is possible or not. I would love to be able to rip a title from a DVD, and have it preserve the chapter inside of it. I got this idea from working on a freelance movie project. I exported a quicktime file from iMovie, and it preserved all the chapter markers. When playing back in quicktime, I was able to chapter skip.

I would love this feature to be incorporated, because that would enable me to skip over the 25, 35, or even 45 second intros in most TV shows, instantly. If you guys can make this work, that would be fantastic. But like I said, I don't know if this is something that can even be accomplished, so I will be happy with a response saying it can't be done.

Thanks for your time, and keep up the good work.


Posted: Tue Feb 06, 2007 5:14 am
by ItsInTheCave
Chapter functionality is part of the MPEG-4 format and can be implemented by some programs.

I too would like to see this feature as it would make the resulting files even more similiar to the original DVD.

Posted: Tue Feb 06, 2007 7:02 am
by jbrjake
I created a Trac ticket for this last month:

I arbitrarily placed it under MediaFork 1.0 because no one's working on it or, to my knowledge, even planning to.

Anyone is, of course, welcome to pick up the Trac ticket and implement it sooner...

Posted: Wed Feb 07, 2007 2:11 am
by Vidar
Thank you guys so much for your fast replies. I apprechiate you creating a ticket for this feature, and look forward to one day having it implemented. I would love to help out on the coding, but I know absolutely nothing in that area. If you need your Mac fixed, I could do that blindfolded, but not coding.

Thanks again, and keep up the good work.



Posted: Fri Feb 16, 2007 5:41 am
by ikeaboy
I think you guys are right, preserving chapters is a great idea. Especially since movies downloaded from iTunes use chapter markers, and the iPod/apple TV work so well with them.

I wish I could give your trac ticket a thumbs up or something.

Posted: Fri Feb 16, 2007 11:17 am
by JAL
Hi everyone

First, MediaFork is really a great application. Love it and use it almost daily!

I would like to have chapters info extraction too.

So far I searched everywhere in the Mac world and wasn't able to find an application that allows the extraction of the chapter info from a DVD's .IFO file (IFO = InFOrmation). Only app I found is an Windows app (ChapterXtractor) which does its job. It extracts the chapter info into different formats, eg the one used by OGM. I use this OGG chapter info then to include the chapters into a MKV file (which leads me to second the request for MKV support... ;-) ). MKV understands OGG or xml chapter information.

So a cool feature for MediaFork would be to automatically include the chapter information into mp4/OGG containers (not sure if AVIs can use them) and to optionally save the information to a text file for use with other apps (MkvMerge). :D

Again, thank you for this great piece of software!

EDIT: Oh - and yep, I am aware of the fact that this is already a ticket, but from the info text of the ticket it sounds a little bit limited. Therefore the additional infos in my post :D

Posted: Sat Feb 17, 2007 10:56 pm
by laser
There is an application for Mac able to extract chapters straight from DVDs. It's called Metadata Hootenanny and has the source code available too! Unfortunately for PowePC only.

Source code:

Having chapters embedded will be truly great. Cheers.

Posted: Sun Feb 25, 2007 6:39 am
by ikeaboy
Thank you laser for pointing out Metadata Hootenanny, its a great app. With it I have been able to create chapter markers by hand, which is awesome. What I would like to do is extract the chapters (just the chapter number and timecode would do) from the DVD, I haven't been able to figure out how I would do that with MH, can you poin me in the right direction? Thanks.

PS. I can get the chapters from osex, but having them in a format that I could use with a applescript would be great.

Posted: Mon Feb 26, 2007 8:24 am
by whimpers
Open Hootenanny, click on the book icon on the bottom right. Click 'read from DVD' and select the VIDEO_TS folder from a DVD (has te be decrypted I believe). Click 'save to text file' and you will have a text file that you can open in QuickTime Pro. Choose Select all and then Copy, open your movie in QuickTime Pro (leave the playhead at the beginning) and choose 'add to movie'. Choose 'Show Movie properties' and click on the text track, click the Other Settings tab. Next to 'chapters' select 'text track'. At that point you should get the chapters in the QuickTime player. Click on the Visual Settings tab and set the text track to layer 2 or higher (the chapter text indications should disappear under the movie). Save as a reference movie if you want to keep all the original assets, or a as a self-contained movie if you want all the tracks (audio, video, chapters...) included.

Posted: Tue Mar 06, 2007 12:05 am
by mbeach01
Okay, I have done as you directed and it worked fine.....for a .MOV file. However when I export it to .MP4 The Chapters are not there. The whole idea here is to get chapters in an M4V file for use with iTunes. Any ideas?

Posted: Tue Mar 06, 2007 3:33 am
by rhester
mbeach01 wrote:Okay, I have done as you directed and it worked fine.....for a .MOV file. However when I export it to .MP4 The Chapters are not there. The whole idea here is to get chapters in an M4V file for use with iTunes. Any ideas?
This is not possible. iTunes/iPod only understand chapters in .mov wrappers, not .mp4.


Posted: Wed Mar 07, 2007 12:51 am
by mbeach01
Interesting. The movie I downloaded from iTunes in .m4v format has chapters. I can play the .mov files that I have added chapters to in iTunes, but it runs slow when I have the controls activated in full screen mode, but it is doable. Thanks.

Posted: Wed Mar 07, 2007 1:14 am
by rhester
Actually, if you look more closely, all iTunes movies are in .mov format with a .m4p extension.


Posted: Wed Mar 07, 2007 1:39 am
by Thinine
How so? They're all .m4v files for me.

Posted: Wed Mar 07, 2007 2:04 am
by rhester
How are you examining the container?


Posted: Wed Mar 07, 2007 4:22 am
by dynaflash
Thinine wrote:How so? They're all .m4v files for me.
.m4v is just a file extension apple chose to tell OSX to open the file natively in iTunes instead of QuickTime. you can name either a .mp4 file or a .mov file .m4v and that is all it does. At least as far as I am aware. Doesnt change anything about the container itself.

This may help

Posted: Thu Mar 08, 2007 1:15 pm
by Kurtz
This is from a guide on doom9's forums at:

"8) How can i place Chapters in MP4 files?
chapters storage is possible by using advanced content (eg by creating a menu), but Nero uses a MP4 feature called "user space" (udta atom) which allows you to attach anything you want in MP4 (iTunes uses the udta atom for storing tags and cd/dvd-covers ("coverart") in MP4 for example).
atm you can place chapters in MP4 automatically during encoding with Nero Recode2 or, on existing files, with MP4Box and the MP4 directshow muxer filter coming with Recode2 (usable in graphedit)
As players, not knowing the info stored in udta, will simply ignore it, you need a player/filter that can handle this special chapters info (eg Gabest, Haali, Nero or 3ivx)"

Im currently playing with Mp4box with the YAMB front end on Windows which can add chapters to mp4/m4v. Ill report back if i have any luck. However OSX options (my main computer platform) seem few and far between. Looks like Apple has its own program for this sort of feature.

Also the Itunes store uses M4v files which are not MOVs. MP4 and M4v are practically the same container standard, that come from some of the standards in MOV. It is correct that M4v is the container that apple has chosen to tell itunes what to open when it comes to Video. However they are different in what they can do compared to MOVs.

Just found an OSX DVD Chapter extracter
Go to:
Hope this helps

Willing to help on this

Posted: Mon Mar 12, 2007 1:10 am
by starkos
I just got an ipod and discovered HB - kudos to all involved, well done!

iPod compatible chapter markers are a killer feature for me, and I'm willing to help out with implementation. I've downloaded and built the HB code (which was easy, again nice job). But after much Googling I haven't had any luck figuring out how to get chapter markers into a video. It seems it must be possible, since the movies from Apple have chapters.

I've read through this topic and tried the ideas mentioned here, but I haven't had any luck. If anyone has any info they can throw my way, I'll try to make good use of it.

Thanks, and again great work everyone.

How apple makes M4v's with chapters

Posted: Mon Mar 12, 2007 2:56 pm
by Kurtz

After doing some intence google hunting and reading, I think ive found how apple adds chapters to its iTunes movies

Compressor 2 has the ability to pass through chapter makers.
Here is the statement in the Late breaking news manual:

Chapter Markers for iPod and QuickTime Output
In previous versions of Compressor, you could add and name chapter markers that
DVD Studio Pro would recognize in MPEG-1, MPEG-2, and H.264 for DVD Studio Pro
output files. Compressor 2.3 expands this feature for iPod video authoring and other
QuickTime authoring. Chapter markers are now passed through (transferred) to other
output files that can be recognized by QuickTime Player, iTunes (.m4v files),

Link to PDF ... _lbn_z.pdf

This wont help us very much but at least we know.

Posted: Mon Mar 12, 2007 6:45 pm
by jbrjake
You're wasting your time.

You want to be looking at how the program mp4creator from the MPEG4IP project adds chapter markers, because HB uses its mp4 library, not QuickTime...

Anotherwords, you need to start learning your way around libmp4v2.

mp4creator source code: ... p4creator/

libmp4v2 source code: ... lib/mp4v2/

Posted: Mon Mar 12, 2007 7:26 pm
by rhester
It doesn't matter. The only chapter format iPod/Apple TV/QuickTime supports is Apple-proprietary. Industry-standard tools can create chapters, but not the same sort Apple uses.


Posted: Mon Mar 12, 2007 8:08 pm
by jbrjake
rhester wrote:It doesn't matter. The only chapter format iPod/Apple TV/QuickTime supports is Apple-proprietary. Industry-standard tools can create chapters, but not the same sort Apple uses.
Blah. Seriously? That is sooooo lame.

So...what does that mean? Using Atomic Parsley code? Can we even do that easily? This is looking like way more trouble than it's worth.

Posted: Mon Mar 12, 2007 8:20 pm
by rhester
As far as I know, the only tools capable of creating Apple-friendly chapters are Apple tools (QT Pro and whatever their high-end video tool is), inside QuickTime containers only.


Posted: Mon Mar 12, 2007 10:58 pm
by jbrjake
rhester wrote:As far as I know, the only tools capable of creating Apple-friendly chapters are Apple tools (QT Pro and whatever their high-end video tool is), inside QuickTime containers only.

This whole time I'd been under the impression that tools like Metadata Hootenanny and AtomicParsley could make QT-friendly chapters....but I guess AtomicParsley can't do chapters, and Metadata Hootenanny can't do .mp4.

Some of the gruesome details of why Lostify doesn't do chapters is recounted here: ... 82954.html

Well now...this request is definitely going on the back burner, eh?

Posted: Tue Mar 13, 2007 4:16 pm
by Vidar
Well, it looks like many of you put a lot of thought and time into my suggestion. I really aprechiate that. I was hoping that this would be a simple addition, but it appears to be totally the opposite. Thanks for taking the time to look into adding this feature. Hopefully someday it will be something that can be implemented.

Thanks for all the hard work you guys are putting into this software. I am a huge fan (and kinda bummed that I can fix anything hardware related to a Mac, but don't know a line of code).