Voxbound / Best M4B settings
Best M4B settings for Audiobookshelf, Prologue and Apple Books
What an M4B audiobook needs to play properly in Audiobookshelf, Prologue and Apple Books: the audio format, bitrate, chapters, cover and tags. Each section says what that player's documentation or source code confirms, and where they say nothing.
The short answer
An M4B with these settings suits all three players:
- AAC audio in a file ending in
.m4b; - chapters inside the file, in time order, and no more than 255 of them;
- the cover embedded in the file;
- the book's title in the
titleandalbumtags, the author inartistandalbum_artist, and the narrator incomposer; - for speech, 64 to 128 kbps in mono or 128 kbps in stereo, the lower end of Apple's guidance for podcasts.
The sections below explain where each of these comes from. If chapters already go missing, our guide to M4B chapters not showing covers the causes.
Bitrate, sample rate and mono
None of the three players publishes a bitrate for audiobooks you add yourself. Apple once had an audiobook profile in its audio delivery guide for publishers, but removed the audiobook requirements in 2019. The nearest published guidance from Apple is for podcasts, which are also speech: its podcast audio requirements give 64 to 128 kbps for mono and 128 to 256 kbps for stereo at 44.1 or 48 kHz, and recommend AAC over MP3.
Bitrate decides the file size. At 64 kbps an hour of audio takes about 29 MB, and at 128 kbps about 58 MB, so a 10-hour book is roughly 290 MB or 580 MB.
Two things cost space or time without improving the sound:
- a higher bitrate than the source. Converting a 64 kbps MP3 to 128 kbps AAC doubles the size without bringing back anything the MP3 lost;
- re-encoding files that are already AAC. When every file is AAC with the same sample rate and channels, they can be joined into an M4B without re-encoding, so they lose no further quality.
Audiobookshelf
Audiobookshelf reads a file's tags and chapters with FFmpeg's ffprobe.
Folders
Its directory structure documentation uses Author/Series/Book or Author/Book. A single-file book can sit in the root of the library; otherwise every book needs its own folder, so put an M4B in a folder named after the book rather than straight into a series folder.
Tags
Only the tags of a book's first file are used. The scanner fills each field from these tags, which it looks up without regard to case. The table gives the names Audiobookshelf looks for; in an M4B made with FFmpeg, ffprobe shows the common ones under these names.
| Field | Tag, in order of preference |
|---|---|
| Title | album, then title |
| Author | artist, then album_artist |
| Narrator | composer |
| Series | series, show or mvnm, then grouping |
| Number in the series | series-part, episode_id, mvin or part, or the number in grouping |
| Description | description, then comment |
| Year | date |
| Genre | genre |
Title comes from album first, so a file whose album holds something else, such as the series name, shows under the wrong title. FFmpeg drops a series tag when it writes an M4B, but it keeps grouping, which Audiobookshelf reads as the series and number together, such as The Saga #2.
To add a series to a finished M4B without re-encoding it, copy the book out of the library folder first and run this where the copy is. It makes a new file with the series added, keeping the chapters, the cover and standard tags such as title, author and narrator. FFmpeg drops tags it doesn't know, such as an ASIN.
ffmpeg -i "book.m4b" -map 0:a -map 0:v? -c copy -disposition:v attached_pic -metadata show= -metadata grouping="The Saga #2" -movflags +faststart "book-tagged.m4b"
Replace the series name and number with your own. The empty show= removes any old series left in the show tag, which Audiobookshelf would otherwise read first. Check that book-tagged.m4b plays, then put it in the book's folder in place of the original, under the original's name. Don't leave both in the folder: Audiobookshelf treats every audio file in a book's folder as part of that book.
Then scan the library again. By default the Audiobookshelf metadata file takes priority over the tags in the audio file, as its book metadata documentation explains, so a book it already knows may keep the old details. Audiobookshelf still shows the old chapters covers what to do.
Chapters and cover
For a single file, Audiobookshelf uses the chapters inside it. For a book in several files, it uses the first file's chapters when the first two files have the same list, and otherwise joins every file's chapters in order. If the first file has no chapters, it makes one chapter per file.
When it first scans a book, it uses an image file in the book's folder as the cover and takes the embedded cover only when there isn't one. An image left in the folder is used instead of the cover you embedded.
Prologue
Prologue is an audiobook player for iPhone, iPad and Apple Watch that plays books from your own Plex or Audiobookshelf server. It doesn't publish format requirements. Its release notes show that it reads the chapters embedded in a book's files.
With Audiobookshelf, the book's details come from the server, so the Audiobookshelf settings apply. For Plex, its guide to embedded tags in music libraries says Plex expects Track, Album and Artist tags, and possibly Album Artist, with Prefer local metadata turned on in the library's advanced settings. For a single-file book that means the book's title in title and album and the author in artist and album_artist.
Apple Books
Apple's import guide names MP3 and Audible audiobooks but not M4B, and Apple doesn't document which tags Books reads. What is documented:
- on a Mac you add a book in Books with File, then Import, as Apple's import guide explains;
- the extension matters: Six Colors found that Books treated a
.m4afile as plain audio and the same file named.m4bas an audiobook with chapters; - Books on a Mac lets you jump to a chapter from the chapter list;
- audiobooks you add yourself reach an iPhone or iPad by syncing from the Mac in Finder, under Audiobooks.
With no published spec, AAC at 44.1 kHz with chapters, a cover and title and author tags is the conservative choice.
Checking a file's settings
To see the audio format and main tags of an M4B, run this in PowerShell with FFmpeg installed:
ffprobe -v error -show_entries "stream=codec_name,sample_rate,channels:format=bit_rate:format_tags=title,album,artist,album_artist,composer" -of default=noprint_wrappers=1 "book.m4b"
It prints the codec (aac), sample rate, channels (1 for mono, 2 for stereo), bitrate in bits per second, and each tag that's set. The chapter track, if there is one, shows as bin_data, and a cover as mjpeg or png. Our chapters guide shows how to list the chapters.
Voxbound's player profiles
In Voxbound you pick a profile for your player. After the merge it checks the finished file against the profile and tells you what's missing:
| Profile | Audio | Checked after the merge |
|---|---|---|
| Audiobookshelf | AAC, 44.1 kHz stereo, up to 192 kbps | Codec, sample rate, chapters, cover, title |
| Prologue | AAC, 44.1 kHz stereo, up to 256 kbps | Codec, sample rate, chapters, title |
| Apple Books | AAC, 44.1 kHz stereo, up to 256 kbps | Codec, sample rate, chapters, cover, title |
| Generic M4B | AAC, keeping the sources' sample rate and channels (the highest, if they differ), so a mono recording stays mono | Codec |
Every M4B profile also checks that the file is an M4B holding AAC audio and that the audio decodes at points through the book.
The player profiles always save 44.1 kHz stereo, so every file is re-encoded and a mono recording becomes stereo. A Quality above the profile's limit is lowered to it. For a mono book, or AAC files you'd rather not re-encode, use Generic M4B, which keeps the sources' sample rate and channels but doesn't check for chapters or a cover. With Smart mode on, Gaps set to Preserve and no normalising, trimming or EQ, it joins AAC files that share a sample rate and channels without re-encoding.
With every M4B profile, Voxbound also:
- names the file
.m4band writes the chapters in both formats players read; - puts the title in
titleandalbum, the author inartistandalbum_artist, the narrator incomposer, and the year, genre and description indate,genreandcomment; - embeds the cover you choose;
- flags chapters you've edited or imported that are empty, out of order or overlapping, before you merge.
Choose the bitrate under Quality: 64k, 128k, 192k or 256k.
Get the settings right once
Voxbound makes the M4B, writes the tags and checks the file against your player, for a one-off €9.99.
Get Voxbound