How to add chapters to one long audiobook file on Mac

You can turn a single MP3, M4A, M4B, or video into one M4B audiobook with named chapters. The finished book stays in one file, and you can jump to a chapter by name.

Add chapters for free with FFmpeg

1. Find where each chapter starts

Finding the chapter starts takes most of the work. Open your recording in a player that shows the elapsed time. Write down the time and title of each chapter as you go. If the narrator announces chapter numbers or titles, play a few seconds around each announcement to place the marker just before the first word.

Gaps of silence can help you find places to check. A long pause might fall within a chapter, and some chapters start without a pause. If you have timestamps from a table of contents, check that they match your recording. A different narrator, edition, or introduction can shift every time. If there is an introduction you want to skip later, give it its own chapter starting at zero.

Compare your list with the book's table of contents if you have one. If the numbering jumps from chapter four to chapter six, go back through that stretch before you export. For a book divided into parts and chapters, give the chapter both names or numbers. For example, use “Part 2, Chapter 1” so you can tell it apart from the first chapter in Part 1.

2. Write the chapter list

Install FFmpeg if you need it. If you use Homebrew, run brew install ffmpeg in Terminal. The package also includes ffprobe. Put your recording in a working folder and open that folder in Terminal. You can type cd followed by a space, drag the folder from Finder onto the Terminal window, and press Return. FFmpeg on Homebrew.

Make a plain text file named chapters.txt in that folder. In TextEdit, choose Format, then Make Plain Text. The example below gives a 12.5-second recording three chapters.

;FFMETADATA1

[CHAPTER]
TIMEBASE=1/1000
START=0
END=4250
title=Introduction

[CHAPTER]
TIMEBASE=1/1000
START=4250
END=8900
title=Chapter 1

[CHAPTER]
TIMEBASE=1/1000
START=8900
END=12500
title=Chapter 2

TIMEBASE=1/1000 measures times in milliseconds. Multiply the total seconds by 1,000. For example, 1 hour, 12 minutes, and 5.250 seconds is 4,325.250 seconds, so write START=4325250. Set each chapter's END to the next chapter's START. End the last chapter where the audio ends. If a title contains #, ;, =, or a backslash, put a backslash before that character. FFmpeg metadata format.

For an audio file, run this command to get its duration in seconds. Replace book.mp3 with your file's name.

ffprobe -v error -show_entries format=duration \
    -of default=noprint_wrappers=1:nokey=1 "book.mp3"

3. Make the M4B

Replace book.mp3 with your file's name. Keep the quotes if its name contains spaces. The same command works with video such as MP4, MOV, or M4V. It takes the first audio track, copies supported book tags from the source, and reads the chapter list from chapters.txt. Embedded cover art is omitted. The -n flag protects any existing output file.

ffmpeg -n -i "book.mp3" -f ffmetadata -i chapters.txt \
    -map 0:a:0 -map_metadata 0 -map_chapters 1 \
    -c:a aac -b:a 128k "book-with-chapters.m4b"

For an existing M4A or M4B that contains AAC, replace -c:a aac -b:a 128k with -c:a copy to keep the audio without re-encoding it. Use a new output name if you already made an M4B.

4. Check the chapters before importing

Run the command below to see the chapter start times, end times, and titles. With the example above, look for Introduction at 0.000 seconds, Chapter 1 at 4.250, and Chapter 2 at 8.900.

ffprobe -v error -show_entries chapter=start_time,end_time:chapter_tags=title \
    -of compact=p=0 "book-with-chapters.m4b"

If a start time is wrong, update that chapter's START and the previous chapter's END to match. Run FFmpeg again with a new output filename and check the new file before importing it.

In Apple Books on Mac, choose File, then Import, and select the M4B. For Audiobookshelf, put it in its own folder inside your audiobook library and scan the library. Open the book's chapter list and jump to a few chapters to check that you hear their opening words. Apple Books import instructions.

If you need a separate file per chapter

Use the timestamps to make individual tracks. For example, Chapter 1 above starts at 4.250 seconds and lasts 4.650 seconds. Run the command once per chapter, changing the start time, duration, and output name each time.

ffmpeg -n -ss 00:00:04.250 -i "book.mp3" -t 4.650 \
    -map 0:a:0 -map_chapters -1 -c:a aac -b:a 128k "01-chapter.m4a"

Find chapter starts and titles with Abobi

Abobi is our Mac app for making audiobooks from audio and video files. Drop in an MP3, M4A, or M4B, or a video in MP4, MOV, or M4V. Turn on Add chapter titles in the menu next to Find Chapters, then click Find Chapters. Abobi suggests where each chapter starts and what to call it based on the recording. That replaces step 1 above, the part that takes the most time.

Open the chapter editor to see the list and the places Abobi marks for a closer look. Use Audition to hear the seconds around a chapter start. Move a start if it cuts off an opening word. Add any missing chapters. Rename chapters in the title field. Save your changes before you export. Getting started with the chapter editor.

In the Export tab, choose M4B for Apple Books or Audiobookshelf. Abobi also exports M4A with chapters. If you keep your library on an Audiobookshelf server, you can save the book in its library folder or send it to the server from Abobi. Abobi and Audiobookshelf.

Audiobookshelf showing the chapter list for Alice's Adventures in Wonderland.
The chapter list from an M4B made with Abobi, shown in Audiobookshelf.

Abobi needs a Mac with Apple silicon, M1 or newer, and macOS 14 Sonoma or later. Every feature is free for books up to three hours. Most short LibriVox books fit, including the recording of Alice's Adventures in Wonderland shown above. For longer books, the U.S. launch prices are $8.99 for the full version and $1.49 for a 7-day pass. Both are one-time purchases.

Get Abobi on the Mac App Store or join the Windows or iPad waitlist.