Skip to main content

A collection of command line utilities for creating, editing, and generally working with m4b files.

Project description

m4b-util

A command line utility for creating, editing, and generally working with m4b files.

Sub-commands

This application is split into a number of subcommands which can be run from the main command. For a list of available commands, run m4b-util --help. For details on a specific sub-command, run m4b-util <command> --help.

Bind

The bind sub-command is designed to take a folder of audio files and convert them to a single m4b, treating each individual file as its own chapter. It can get chapter names from the original files' metadata, original files' names, from command line arguments, or just number them sequentially. By default, it only scans for mp3 files, but any file extension can be added via arguments.

Cover

The cover command adds and extracts cover images.

Example:

$ m4b-util cover /path/to/book.m4b --extract /path/to/old/cover.png --apply-cover /path/to/new/cover.png

Labels

The labels command converts between Audacity labels, FFMPEG metadata, and Audiobook chapter metadata. Label end times are ignored, as audiobooks need contiguous, non-overlapping chapters. When converting from a label file, the end time of each segment is set from the start time of the next segment.

Example:

$ m4b-util labels --from-label-file /path/to/labels.txt --to-book /path/to/existing/book.m4b --to-metadata-file /path/to/new_labels.txt

Example:

$ m4b-util bind /path/to/inputs  --title "My Book" --cover /path/to/cover.png -e m4a -e .mp4 --output-dir /path/to/output 

Slide

The slide command moves all chapters in a file by a specified duration, keeping the start and end times the same. It can optionally trim audio from the start of the file, shifting all chapters an equal amount.

Example:

$ m4b-util slide /path/to/input.mp3 --duration 5.1 --trim-start 2.5

Split

The split command takes a mode and a single audio file input, scans for silence or chapters (depending on mode), and writes out individual files containing the audio in-between.

Example:

$ m4b-util split silence /path/to/input.mp3 --output-dir /path/to/output --output_pattern "chapter_{:03d}.mp3"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

m4b_util-2025.4.16.tar.gz (47.0 kB view details)

Uploaded Source

Built Distribution

m4b_util-2025.4.16-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file m4b_util-2025.4.16.tar.gz.

File metadata

  • Download URL: m4b_util-2025.4.16.tar.gz
  • Upload date:
  • Size: 47.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for m4b_util-2025.4.16.tar.gz
Algorithm Hash digest
SHA256 0b8b5f2f04a25dabcb94ad6b8c12781eb43e2915045d0389e2c20b3e4aa1a5d4
MD5 d59ae9fded820d5c122dd294f836be29
BLAKE2b-256 3ad158b9d3097d170026216529ac46861427e8cc9b453af280345b76931318ed

See more details on using hashes here.

File details

Details for the file m4b_util-2025.4.16-py3-none-any.whl.

File metadata

  • Download URL: m4b_util-2025.4.16-py3-none-any.whl
  • Upload date:
  • Size: 29.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for m4b_util-2025.4.16-py3-none-any.whl
Algorithm Hash digest
SHA256 2af84824665e9b2337fb4761399d230af8dc82133a4c7a899c1b4b6211ec5dbe
MD5 cd61279c548ffeccb4c813dcf5178726
BLAKE2b-256 e05066673780e4897867980b2b4916b883260c7d25dd8f9e80586b1bf2d08e48

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page