Difference between revisions of "Audiobook"

From ArchWiki
Jump to: navigation, search
(Scenario 3: Make an m4b file from a single mp3 file)
(Scenario 4: Add chapter marks to an existing m4b file without them)
Line 95: Line 95:
  
 
== Scenario 4: Add chapter marks to an existing m4b file without them ==
 
== Scenario 4: Add chapter marks to an existing m4b file without them ==
Overview:
 
# Generate a chapter list which defines the chapter marks
 
# Merge the chapter list with the audio data
 
# Convert the file to qt format
 
# Rename the file to the finalized m4b
 
  
 
Required software:
 
Required software:
Line 107: Line 102:
  
 
Details:
 
Details:
First, determine how long the mp4 file is using mediainfo:
+
This process is identical to steps 3-5
 
+
$ mediainfo --inform="Audio;%Duration/String3%" book.mp4
+
19:04:53.874
+
 
+
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 {{ic|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 {{ic|chapter.list}} with the audio mp4 file.  This is accomplished using {{ic|MP4Box}}:
+
$ MP4Box -add book.mp4 -chap chapters.list book1.mp4
+
 
+
The resulting file now needs to be converted to Quicktime chapter markers using {{ic|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 {{Pkg|vlc}} is easy.  Simply load the file and hit {{Keypress|Ctrl}} + {{Keypress|i}} to bring up a tag window.  Save the metadata before exiting.
+

Revision as of 06:29, 21 May 2012

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 – فارسی

Summary help replacing me

The purpose of this article is to detail a process to create an iPod friendly audiobook from digital media using Linux native tools. It is arranged in goal-oriented scenarios.

Related
iPod

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

Overview:

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

Required software:

Details:

Scenario 2: Make an m4b file from individual mp4 files

Overview:

  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 or from multiple mp3 files

Required software:

Details:

1. Decode and make aac formatted file(s)

Since iPods require aac formatted audio, mp3 files need to be transcoded into aac. First, decode the source mp3 file to wav. Repeat if multiple mp3 files constitute an entire book:

$ lame --decode book.mp3

Encode the wav file(s) to aac:

$ neroAacEnc -q 0.7 -if target.wav -of book1.aac
Tip: If multiple files are used, make use of a for loop if processing them in one line.
$ for i in *.mp3; do lame --decode "$i"; done
$ for i in *.wav; do neroAacEnc -q 0.7 -if "$i" -of "${i%.*}".aac; done

2. Optionally combine multiple aac files into a single file

Multiple aac files need to be concatenated into a single file:

$ MP4Box -cat 1.aac -cat 2.aac book.aac

3. Create metadata for chapter marks

Determine the overall length of the aac:

$ mediainfo --inform="Audio;%Duration/String3%" book.aac
19:04:53.874

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

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.

4. Hardcode the metadata into the audio file =

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

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

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

$ mp4chaps –convert –chapter-qt book.mp4

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

$ mv book.mp4 book.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.

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

Required software:

Details: This process is identical to steps 3-5