PDA

View Full Version : MP4Box :chap option


TwoToad
4th December 2010, 22:59
I've got a couple of quick questions here... How do you use the :chap option when adding a chapter track with mp4box? What format does the chapter file have to be in?

My chapter file looks like this, saved as "chapters.txt":

CHAPTER01=00:00:00.000
CHAPTER01NAME=The Invaders (Main Titles)
CHAPTER02=00:04:04.286
CHAPTER02NAME=The Professionals

I try to use this command line:

MP4Box -ipod -add "Predator (HD)-muxed.m4v#1:lang=en:fps=23.976" -add "Predator (HD)-muxed.m4v#2:lang=en" -add "Predator (HD)-muxed.m4v#3:lang=en" -add "Predator.srt:layout=0x40x0x-1:lang=en" -add "chapters.txt:chap" -new "Predator (HD).m4v"

I'm importing the video, the stereo aac, the ac3, and subtitle tracks from the MeGUI output, and this part works just fine. When it gets to the chapter file, I get this error:

Unknown input file type
Error importing chapters.txt:chap: End Of Stream / File

I'm not sure if the OGG chapter format isn't the right format, or I've got the wrong file extension (.txt), or what. I've tried the help files, and all they tell me is to use :chap when adding a chapter track.

Selur
5th December 2010, 07:07
-chap chap_file: adds chapter information located in chap_file to the destination file. Chapter extensions have been introduced by Nero and are NOT standard extensions of IsoMedia file format, don't be surprised if some players don't understand them.
The following syntaxes are supported in the chapter text file, with one chapter entry per line:

* ZoomPlayer chapter files : AddChapter(nb_frames,chapter name), AddChapterBySeconds(nb_sec,chapter name) and AddChapterByTime(h,m,s,chapter name). One chapter entry per line.
* Time codes : h:m:s name, h:m:s:ms name and h:m:s.ms name. One chapter entry per line.
* SMPTE codes : h:m:s;nb_f/fps name and h:m:s;nb_f name with nb_f the number of frames and fps the framerate. One chapter entry per line.
* Common syntax : CHAPTERX=h:m:s[:ms or .ms] on one line and CHAPTERXNAME=name on the other - the order is not important but chapter lines MUST be declared sequencially (same X value expected for 2 consecutive lines).
source: http://gpac.sourceforge.net/doc_mp4box.php#meta

-> -add "chapters.txt:chap needs to be -chap "chapters.txt"

TwoToad
5th December 2010, 18:33
I was reading the changelog from MP4Box-0.4.6-dev_20100612 which reads :

To add a chapter track, you simply have to add ":chap" in the -add command.

I just now tried the -chap chapters.txt option, and while it does successfully import into the movie, Quicktime or iTunes cannot read them. I thought the -ipod option would have fixed this.

Maybe Kurtnoise could shed some light on this?

b66pak
5th December 2010, 18:46
for apple chapters use this template:

<?xml version="1.0" encoding="UTF-8" ?>
<!-- GPAC 3GPP Text Stream -->
<TextStream version="1.1">
<TextStreamHeader width="480" height="368" layer="0" translation_x="0" translation_y="0">
<TextSampleDescription horizontalJustification="center" verticalJustification="bottom" backColor="0 0 0 0" verticalText="no" fillTextRegion="no" continuousKaraoke="no" scroll="None">
<FontTable>
<FontTableEntry fontName="Arial" fontID="1"/>
</FontTable>
<TextBox top="0" left="0" bottom="368" right="480"/>
<Style styles="Normal" fontID="1" fontSize="32" color="ff ff ff ff"/>
</TextSampleDescription>
</TextStreamHeader>
<TextSample sampleTime="00:00:00.000">Intro</TextSample>
<TextSample sampleTime="00:01:00.000">Middle</TextSample>
<TextSample sampleTime="00:02:00.000">End</TextSample>
</TextStream>


edit the blue parts and save is as "chapters.ttxt" (utf-8)...

use it with:
-add "chapters.ttxt:chap"
_

TwoToad
11th December 2010, 00:47
Thank you!! That worked exactly as intended!

For reference, the times are the start times of each chapter. At first, I was unsure if they were start times or durations.

I put this into ChapterXtractor and it works great. But as ChapterXtractor can't load chapter files and convert between the different formats, is there a program that will convert from the standard OGG format to this Apple Format?

Could Kurtnoise add this to MP4Box, like he and the GPAC team did with subtitles (srt -> ttxt)?

One more thing bb6pak...Do you know where I could find documentation on this format?

Selur
11th December 2010, 13:14
Do you know where I could find documentation on this format?
http://gpac.sourceforge.net/doc_ttxt.php