From m4b-audiobook
Assemble m4b audiobook from audio files with chapters, metadata, and cover art.
How this skill is triggered — by the user, by Claude, or both
Slash command
/m4b-audiobook:m4b-audiobookThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Assemble a single `.m4b` audiobook from a directory of audio files. Adds chapter markers, metadata, and cover art.
Assemble a single .m4b audiobook from a directory of audio files. Adds chapter markers, metadata, and cover art.
ffmpeg and ffprobe must be installeddirectory — path to the directory with audio files. If omitted, use the current working directory.List all audio files in the directory. Supported formats: .m4a, .mp3, .aac, .ogg, .opus, .flac, .wav.
Also look for a cover image: .jpg, .jpeg, .png files with names suggesting cover art (e.g., cover, folder, front, or any single image file present).
Analyze filenames to determine the correct playback order. Common patterns:
01 - Title.m4a, 1.1. Title.m4aChapter 1, Part 1, Глава 1, Часть 1Week 1. 1.1. Title, Неделя 1. 1.1. TitleSort rules:
Present the proposed order to the user. Ask for confirmation before proceeding.
Try to extract metadata from:
ffprobe output)Required metadata fields:
Audiobookrus, eng)Present proposed metadata to user. Ask for confirmation or corrections.
Run ffprobe on each file to determine:
If all files share the same codec and parameters: use -c:a copy (no re-encoding — fast and lossless).
If formats differ: re-encode to AAC-LC. Choose parameters:
64k for mono, 128k for stereo (or match source if higher)Create clean chapter titles from filenames:
01 - , 1.1. )Неделя 1. prefix for week-based books)Задани → Задания if context is clear)— instead of hyphen - in Russian text where appropriateCreate filelist.txt for ffmpeg concat demuxer:
file '/path/to/first file.m4a'
file '/path/to/second file.m4a'
Escape single quotes in filenames: replace ' with '\''.
Get exact duration of each file in milliseconds:
ffprobe -v quiet -show_entries format=duration -of csv=p=0 "file.m4a"
Generate chapters.txt in FFMETADATA1 format:
;FFMETADATA1
title=Book Title
artist=Author Name
album=Book Title
album_artist=Author Name
genre=Audiobook
date=2024
language=eng
[CHAPTER]
TIMEBASE=1/1000
START=0
END=473590
title=Chapter Title
[CHAPTER]
TIMEBASE=1/1000
START=473590
END=960000
title=Next Chapter
Each chapter START equals the previous chapter END. Calculate from cumulative durations.
Run ffmpeg:
ffmpeg -y \
-f concat -safe 0 -i filelist.txt \
-i chapters.txt \
-i cover.jpg \
-map 0:a -map 2:v \
-c:a copy \
-c:v copy \
-disposition:v:0 attached_pic \
-map_metadata 1 \
-map_chapters 1 \
-movflags +faststart \
"Author - Title.m4b"
Adjust flags:
-c:a copy with -c:a aac -b:a 128k (or appropriate bitrate)-i cover.jpg, -map 2:v, -c:v copy, -disposition:v:0 attached_picAuthor - Title.m4b (from metadata)After assembly, verify the output:
ffprobe -v quiet -show_format -show_chapters output.m4b
Confirm:
Report results to user: filename, size, duration, chapter count.
Remove temporary files (filelist.txt, chapters.txt).
ffmpeg is not installed: suggest brew install ffmpegSearches MemPalace before answering questions about past work, people, projects, or prior decisions. Returns verbatim stored content instead of guessing from model memory.
Guides Payload CMS config (payload.config.ts), collections, fields, hooks, access control, APIs. Debugs validation errors, security, relationships, queries, transactions, hook behavior.
Implements vector databases with Pinecone, Weaviate, Qdrant, Milvus, pgvector for semantic search, RAG, recommendations, and similarity systems. Optimizes embeddings, indexing, and hybrid search.
npx claudepluginhub lexfrei/ccc --plugin m4b-audiobook