Extract Audio from MPG to M4B — Free Online Tool

Extract audio from MPG video files and save it as M4B, the MPEG-4 audiobook format with AAC encoding, chapter support, and bookmarking. Ideal for converting recorded lectures, sermons, or long-form video content into a portable audiobook file you can resume anywhere.

FFmpeg Command

Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg

Free — no uploads, no signups. Your files never leave your browser.

Estimated output:

Conversion Complete!

Download

How It Works

MPG files typically carry audio encoded in MP2 (MPEG-1 Audio Layer II), the legacy broadcast standard used in VCD and DVD production. Since M4B requires AAC audio, this conversion cannot be a simple stream copy — the MP2 audio must be fully decoded and re-encoded into AAC using FFmpeg's native AAC encoder. The video stream is discarded entirely using the -vn flag, so only the audio track is processed. The resulting AAC audio is wrapped in an MPEG-4 container (.m4b) with the +faststart flag applied, which repositions the container's metadata atom to the beginning of the file for efficient streaming and immediate playback on Apple devices and podcast apps. Quality is set to 128k bitrate by default, which is appropriate for voice-heavy content typical of audiobooks.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg tool. This is the open-source multimedia framework being used to handle the decoding of the MPG container, transcoding of the MP2 audio stream to AAC, and writing of the M4B output file.
-i input.mpg Specifies the input MPG file. FFmpeg will parse the MPEG-1/2 container and identify the video and audio streams inside — typically an mpeg2video stream and an MP2 audio stream — before applying the processing flags that follow.
-vn Disables video output entirely, telling FFmpeg to discard the mpeg1video or mpeg2video stream from the MPG file. Since M4B is a pure audio format for audiobooks, no video data is written to the output.
-c:a aac Sets the audio codec to AAC using FFmpeg's built-in AAC encoder. This is required because the MP2 audio in the source MPG is not supported by the M4B container — the audio must be fully decoded from MP2 and re-encoded into AAC for the output file to be valid.
-b:a 128k Sets the AAC audio output bitrate to 128 kilobits per second. For voice-centric content like audiobooks and lectures — the primary use case for M4B — 128k AAC provides clean, intelligible audio while keeping file sizes small enough for easy syncing and download.
-movflags +faststart Moves the MOOV atom (the MPEG-4 container's metadata and index block) to the beginning of the output M4B file. This is essential for M4B files intended for podcast distribution or streaming, as it allows Apple devices and podcast apps to begin playback before the full file is downloaded.
output.m4b Specifies the output filename with the .m4b extension, which tells FFmpeg to write an MPEG-4 audio container. The .m4b extension (versus .m4a or .mp4) signals to Apple Books, iTunes, and compatible players that this file is an audiobook with bookmarking and chapter support.

Common Use Cases

  • Convert a recorded university lecture distributed as an MPG file into an M4B audiobook so you can listen on iPhone with bookmarking and resume where you left off
  • Turn digitized VHS recordings of conference presentations or speeches into M4B files for podcast-style consumption on long commutes
  • Extract audio from broadcast-standard MPG recordings of sermons or religious services and package them as M4B files for distribution to congregation members via Apple Podcasts
  • Convert MPG recordings of training videos or instructional content into M4B format so learners can bookmark specific sections and resume playback across sessions
  • Strip audio from an MPG DVD-rip of a stand-up comedy special or live performance and save it as an M4B for audio-only listening on an iPod or Apple device

Frequently Asked Questions

Yes, there is a generation of quality loss because this conversion involves transcoding — the MP2 audio in the MPG file is fully decoded and re-encoded into AAC. MP2 and AAC are both lossy codecs, so decoding MP2 to raw PCM and then re-encoding to AAC introduces some additional degradation. However, at 128k AAC, the output is generally clean and transparent for voice content like lectures or audiobooks. If your source MPG has high-bitrate MP2 audio (192k or above), bumping the output to 192k AAC will better preserve fidelity.
M4B does natively support chapters, which is one of its defining features over formats like MP3. However, MPG files do not carry chapter metadata, so the converted M4B will not automatically have chapters — it will simply be one continuous audio track. To add chapters, you would need to use a dedicated tool like mp4chaps or edit the M4B with an audiobook authoring tool after conversion. The FFmpeg command here handles the audio extraction and container formatting, but chapter injection requires a separate step.
The -movflags +faststart flag moves the MOOV atom (the container's index and metadata) from the end of the file to the beginning. For local playback this makes minimal practical difference, but it is critical for streaming and web-based delivery — without it, a player or podcast app must download the entire file before it can begin playing. Since M4B is commonly used for podcast distribution and synced audiobook libraries, applying +faststart is considered best practice and is included by default.
Yes — replace the '128k' value in '-b:a 128k' with any supported bitrate. For voice content, 128k AAC is generally sufficient and keeps file sizes manageable. For music or content where audio fidelity matters more, use 192k or 256k. The full command with 192k would be: ffmpeg -i input.mpg -vn -c:a aac -b:a 192k -movflags +faststart output.m4b. Note that M4B supports up to 320k, though AAC at 256k is typically indistinguishable from lossless for most listeners.
Yes — M4B with AAC audio is Apple's native audiobook format, and files produced by this conversion are fully compatible with Apple Books, the Files app, and iPhone podcast players. The AAC codec and MPEG-4 container used here match exactly what Apple expects. The +faststart flag also ensures the file streams correctly if accessed over a network or synced via iCloud. For best results in Apple Books, you may want to add metadata tags like title, artist, and cover art using a tool like AtomicParsley after conversion.
The command as shown processes a single file, but you can batch process using a shell loop. On Linux or macOS: 'for f in *.mpg; do ffmpeg -i "$f" -vn -c:a aac -b:a 128k -movflags +faststart "${f%.mpg}.m4b"; done'. On Windows Command Prompt: 'for %f in (*.mpg) do ffmpeg -i "%f" -vn -c:a aac -b:a 128k -movflags +faststart "%~nf.m4b"'. This is especially useful for converting a series of lecture recordings or podcast episodes in one pass. The browser-based tool processes one file at a time, so the FFmpeg command is the recommended approach for batch workflows.

Technical Notes

MPG files using MPEG-1 or MPEG-2 video standards almost universally carry MP2 audio (MPEG-1 Audio Layer II) at bitrates of 128k to 384k, a codec standardized for broadcast and VCD/DVD use. M4B does not support MP2, so transcoding to AAC is mandatory — there is no stream-copy path available for this conversion. FFmpeg's native AAC encoder (aac) is used here rather than the third-party libfdk_aac encoder, as libfdk_aac is not included in most standard FFmpeg builds due to licensing restrictions; the native encoder produces good quality results for speech content at 128k. One known limitation is that MPG containers do not support embedded chapters, multiple audio tracks, or rich metadata, so any chapter structure or extended tagging must be added to the M4B in a post-processing step. File size will typically be significantly smaller than the source MPG since the video stream is discarded and only the audio track is retained. A 60-minute MPG at typical broadcast quality might be 500MB or more, while the resulting M4B audio-only file at 128k AAC would be around 55–60MB.

Related Tools