Voxbound / Guides / 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.
Voxbound writes these series tags from the Series and Series # fields. To add a series to an M4B you already have, 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.
Audiobookshelf not finding books
When Audiobookshelf isn't finding a book, or isn't finding all your books, the causes its documentation and source give are the file type, a folder with no audio file in it, a name it skips, and books grouped together by mistake. Its scanner only counts files with these extensions as audio: m4b, mp3, m4a, flac, opus, ogg, oga, mp4, aac, wma, aiff, aif, wav, webm, webma, mka, awb, caf, mpg and mpeg. Its documentation doesn't list them, so this list is from the source.
A folder needs at least one such file, or an ebook in a library that reads ebooks, to become a book, and a file loose in the library root counts only if it is an audio file or, in such a library, an ebook. A file with any other extension is not read as audio.
The scanner also skips some names. The check runs on each file's path from the library root, so a file is skipped when its own name or the name of any folder above it starts with a dot, when its path contains @eaDir, or when its extension is .part, .tmp, .crdownload, .download, .bak, .old, .temp, .tempfile or .tempfile~. A folder that holds a file named .ignore is skipped as well, along with everything under it, unless it is the library root (this comes from the source; the documentation doesn't mention it). An unfinished download or a backup copy of an M4B, and any book inside a hidden folder, is therefore left out.
If several books show up as one, its server FAQ says this is almost always a folder layout with more than one book in a folder. It adds that the wrong grouping can stay after you fix the folders, because Audiobookshelf tracks moved files by inode: you have to remove the book from Audiobookshelf's database and scan again. The FAQ also warns that another tool moving files around the library while watch for file changes is on can make the server merge files by mistake.
An M4B can also fail to scan because of its codec. The FAQ says that some M4B files use xHE-AAC, which FFmpeg 7 and older can't read, so scanning them fails with an [AudioFileScanner] SyntaxError in the log. Its fix is to re-encode the book to AAC or Opus first.
The logs documentation says scan logs are kept in /metadata/logs/scans to help with debugging, and that the daily logs can be read in the web client. The reason a file was skipped is written as a debug message (in the source), and the documentation says logs are stored only for the current level and that new installations use Info, so you won't see those lines unless the server's log level is set to Debug. The FAQ says scans can run automatically, through the file watcher or periodic scans.
Can Audiobookshelf merge files into an M4B
Yes: Audiobookshelf can merge a book's files into one M4B itself. Its introduction lists an audiobook tool that will "merge multiple audio files to a single m4b". In its source, the merge works on a book that has audio tracks and, through the tools route, is limited to admin users.
It runs FFmpeg and always re-encodes, to AAC at 128k stereo unless you pick other options. To finish, it copies the first track to its cache folder, moves the other tracks there, copies the new M4B over the first track's file and renames that file to the M4B's name. The M4B is named after the book's folder, or after the file for a single-file book (the naming). Voxbound also joins a book's files into one M4B with chapters.
Audiobookshelf MP3 vs M4B
Audiobookshelf plays both MP3 and M4B, and its FAQ leaves the choice to you. It says MP3 is supported by pretty much everything, M4B is convenient for one file per book, and M4B has less support than MP3 across devices, though most phones and web browsers shouldn't have problems. It also says Audiobookshelf has outstanding issues with seeking within very long MP3 files.
So an M4B plays in Audiobookshelf, apart from the xHE-AAC case above. A book of MP3 files keeps working too. The two differ in how chapters are read, which Chapters and cover describes. Voxbound's Generic M4B profile can join matching AAC files into an M4B without re-encoding, under the conditions its help page lists.
Audiobookshelf on Linux or Docker: using Voxbound from a Windows PC
Make the book on a Windows PC, then copy the finished book folder into the server's library. Voxbound runs only on Windows 10 and 11, while an Audiobookshelf server can run on Linux or in Docker (its installation pages cover both).
- In the Output card on the Editor tab, press Change, choose the Audiobookshelf profile and type
{Author}/{Series}/{Title}in Subfolder. Under Save to, pick a folder on the PC itself, such as a new empty one. - Merge the book. With the default Filename template,
{Title}, Voxbound saves it asAuthor/Series/Title/Title.m4binside that folder, with the names taken from the Book card. A level whose field is empty is left out, so a book with no series isAuthor/Title/Title.m4b. This is theAuthor/Series/BookorAuthor/Booklayout from the directory structure documentation, with the book in a folder of its own. - When the merge has finished, copy the book folder, with the
AuthorandSeriesfolders above it, into the server's library folder in one go. How the PC reaches the server's disk, with a shared folder or a copy tool say, is your own arrangement and isn't covered here. For Docker, Audiobookshelf's Docker page says the path to the left of the colon in a volume mapping is a path on the machine that runs Docker. - If the book doesn't appear on its own, scan the library again. Audiobookshelf's FAQ says scans can also run through the file watcher or periodic scans.
Audiobookshelf treats every audio file in a book's folder as part of that book, and its FAQ warns that other tools managing or moving files around the library while watch for file changes is on can make the server merge files by mistake. That is why step 3 copies a finished folder rather than saving into the library: it shortens the time a half-written book is there, but it does not remove the risk, because a scan can still run during the copy. Audiobookshelf not finding books has the details.
Nothing here has been run against an Audiobookshelf server: Voxbound's side comes from its code, and Audiobookshelf's from its documentation and source. In particular, we haven't tested saving straight into a library, on the same machine or over a network share. Voxbound writes an unfinished book under a name that starts with a dot, such as .Title.voxbound-partial-1234-5678.m4b, and renames it when the merge is done, and Audiobookshelf's scanner and file watcher skip such names in the source. That is read from code, not seen working, so copy a finished folder instead.
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, and you can merge this book free in Voxbound before you pay. 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 (an M4A, if you chose M4A output) 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
.m4b(.m4aif you chose M4A) and writes the chapters in both formats players read; - puts the title in
titleandalbum, the author inartistandalbum_artist, the narrator incomposer, the series and its number inshow,episode_idandgrouping, the year indate, the genre ingenre, and the description in bothdescriptionandcomment; - 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 plus VAT or sales tax where it applies.
Try one book free Buy Voxbound