From ArchWiki
Revision as of 05:56, 21 May 2012 by Graysky (talk | contribs) (Scenario 4: Add chapter marks to an existing m4b file without them)
Jump to: navigation, search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.

Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어

External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Template:Article summary start Template:Article summary text

Template:Article summary heading Template:Article summary wiki Template:Article summary end

Background and Tools

An audiobook for iPod or a "m4b" file, is nothing more than a chapter-index audio file (usually encoded to aac). Multiple tools can be used to create these: Template:Wikipedia

  • m4bakerAUR - Available from the AUR, used to combine a group of already ripped audiofiles into a single m4b file with chapter marks.
  • gpac - Available from [community], this collection of CLI tools are more flexible than m4baker and can be used to create chapter marks for existing m4b files that are without them.
  • mp3splt - Available from [extra], used to split a single, large mp3 file into smaller mp3 files.
  • makechapterlistAUR - Available from the AUR, used to generate a chapters file for MP4Box (part of gpac).

Scenario 1: Make an m4b file from individual mp3 files


  1. Use m4baker to combine many mp3 files into a single m4b file

Required software:


Scenario 2: Make an m4b file from individual mp4 files


  1. Concatenate several mp4 files with MP4Box

Required software:

Details: Individual mp4 files are easily cat'ed together using MP4Box's cat mode:

$  MP4Box -cat file1.mp4 -cat file2.mp4 output.mp4

The cat switch works with all streams supported in MP4Box, like ASP, AVC, AAC, MPEG-1/2 Audio and Video (eg MP3), TTXT and even on Vobsubs and ALAC.

Scenario 3: Make an m4b file from a single mp3 file


  1. Split the single mp3 file into even breaks constituting chapters
  2. Use m4baker to combine into a single m4b file

Required software:


Scenario 4: Add chapter marks to an existing m4b file without them


  1. Generate a chapter list which defines the chapter marks
  2. Merge the chapter list with the audio data
  3. Convert the file to qt format
  4. Rename the file to the finalized m4b

Required software:

Details: First, determine how long the mp4 file is using mediainfo:

$ mediainfo --inform="Audio;%Duration/String3%" book.mp4 

In this example, the mp4 file is 19h 4m and 54 s.

Next, create a chapter list to break up the file into "chapters" or more digestible parts. The list itself is nothing more than a text file in a specific format (Nero chapter format to be precise). Use makechapterlist to make this automatically.

Note: The current version of makechapterlist simply makes chapter marks at 10 minute intervals. To have the chapter marks coincide with the actual chapter breaks in the audio file, knowledge about when a chapter begins/ends is needed.

The example file calls for roughly 19h 5m of content, but the script uses 10 m intervals so a sane value is simply 19x6=114 chapters.

$ makechapterlist
Writes chapter files using a 10 min interval for each chapter
How many chapters are needed: 114
Done!  /home/facade/chapter.list written.

The next step is to make the metadata in chapter.list with the audio mp4 file. This is accomplished using MP4Box:

$ MP4Box -add book.mp4 -chap chapters.list book1.mp4

The resulting file now needs to be converted to Quicktime chapter markers using mp4chaps:

$ mp4chaps –convert –chapter-qt book1.mp4

The final step is to simply rename the mp4 file to the m4b extension:

$ mv book1.mp4 book1.m4b

Users can now optionally edit the tags in the file with any number of tools. Using vlc is easy. Simply load the file and hit Template:Keypress + Template:Keypress to bring up a tag window. Save the metadata before exiting.