Extract Audio to MPC Musepack Using FFmpeg

This article provides a straightforward guide on how to extract audio from any video or audio file and encode it into the Musepack (MPC) format using FFmpeg. Since FFmpeg supports decoding Musepack but does not contain a native MPC encoder, you will learn how to extract the audio using FFmpeg and pipe it directly into the official Musepack encoder (mpcenc) in a single command.

Prerequisites

To use this method, you must have both FFmpeg and the Musepack command-line encoder (mpcenc) installed on your system and accessible via your command line.

The Extraction and Encoding Command

Open your terminal or command prompt and run the following command:

ffmpeg -i input.mp4 -f wav - | mpcenc --quality 6 - output.mpc

How the Command Works

Selecting Specific Audio Tracks

If your input file has multiple audio tracks and you want to extract a specific one, use the -map option in FFmpeg. For example, to extract the second audio track:

ffmpeg -i input.mkv -map 0:a:1 -f wav - | mpcenc --quality 6 - output.mpc