convert
Convert audio files between different formats with quality control and codec options.
Overview
The convert command is your primary tool for audio format conversion, supporting all major lossy and lossless formats. Whether you're preparing audio for streaming, archival, or distribution, this command provides precise control over bitrate, sample rate, and channel configuration.
Key Features:
- Supports MP3, AAC, WAV, FLAC, OGG Vorbis, Opus, and M4A formats
- Quality presets for common use cases
- Custom bitrate and sample rate control
- Mono/stereo channel conversion
- Batch processing for entire directories
Common Use Cases:
- Converting lossless masters to compressed formats for distribution
- Preparing audio for streaming platforms
- Converting between lossy formats for compatibility
- Reducing file sizes while maintaining acceptable quality
- Creating archive copies in lossless format
Lossy vs Lossless: Converting from lossy to lossless (e.g., MP3 to FLAC) does not improve quality - it only increases file size. Always start with the highest quality source when creating distribution files.
Usage
Options
Basic Options
| Option | Alias | Type | Default | Description |
|---|---|---|---|---|
--output | -o | string | Auto | Output file or directory path |
--format | -f | string | mp3 | Output format (see format table below) |
--verbose | -v | boolean | false | Show detailed FFmpeg output |
--dry-run | boolean | false | Preview command without executing |
Quality & Encoding
| Option | Alias | Type | Default | Description |
|---|---|---|---|---|
--quality | -q | string | medium | Quality preset: low, medium, high, lossless |
--bitrate | -b | string | 192k | Audio bitrate (e.g., 128k, 192k, 320k) |
--sample-rate | -s | number | Sample rate in Hz (e.g., 44100, 48000, 96000) | |
--channels | -c | number | Number of channels: 1 (mono), 2 (stereo) | |
--codec | string | Override audio codec (advanced use) |
Flag Details
--format - Output Format
Choose the output audio format based on quality, compatibility, and file size requirements.
Lossy Formats:
MP3 (mp3) - Universal Compatibility
- Compatibility: All devices, players, browsers
- Quality Range: 96k (low) to 320k (maximum)
- File Size: Baseline reference
- Use When: Maximum compatibility needed, podcasts, general music distribution
AAC (aac, m4a) - Modern Compression
- Compatibility: Modern devices, iOS, iTunes
- Quality Range: 96k to 320k
- File Size: 20-30% smaller than MP3 at same bitrate
- Use When: iOS apps, iTunes distribution, better quality/size ratio needed
Opus (opus) - Best Modern Codec
- Compatibility: Web browsers, modern apps
- Quality Range: 32k to 256k (optimal at 96-128k)
- File Size: Best compression (30-50% smaller than MP3)
- Use When: Streaming, VoIP, web applications, podcasts
OGG Vorbis (ogg) - Open Source
- Compatibility: Open source players, games, web
- Quality Range: 96k to 320k
- File Size: Similar to AAC
- Use When: Open source projects, gaming, web streaming
Lossless Formats:
FLAC (flac) - Free Lossless Audio Codec
- Compatibility: Most modern players (not iOS native)
- Compression: 40-50% of original WAV size
- Quality: Bit-perfect lossless
- Use When: Archival, hi-fi playback, mastering backups
WAV (wav) - Uncompressed PCM
- Compatibility: Universal
- File Size: Largest (no compression)
- Quality: Uncompressed lossless
- Use When: Professional audio editing, DAW work, broadcasting
Learn More:
--quality - Quality Presets
Convenient presets that set appropriate bitrate for common use cases.
Available Presets:
low (96k bitrate)
- Voice recordings
- Podcasts (speech-focused)
- Low bandwidth streaming
- Draft/preview files
medium (192k bitrate) - Default
- Music streaming
- General music files
- Balanced quality/size
- Web distribution
high (320k bitrate)
- High-quality music
- Critical listening
- Distribution masters
- Near-transparent to source
lossless (FLAC/WAV)
- Archival storage
- Professional mastering
- Source files for conversion
- Hi-fi playback
Quality Equivalence: Opus 128k ≈ AAC 192k ≈ MP3 256k in perceived quality. Modern codecs (Opus, AAC) achieve better quality at lower bitrates.
--bitrate - Audio Bitrate
Set the target bitrate for lossy formats. Higher bitrate = better quality and larger files.
Bitrate Guidelines:
| Bitrate | Use Case | Quality | File Size (per min) |
|---|---|---|---|
| 96k | Voice, podcasts | Acceptable | 0.7 MB |
| 128k | Music streaming (mobile) | Good | 0.9 MB |
| 192k | Music streaming (standard) | Very good | 1.4 MB |
| 256k | High quality music | Excellent | 1.9 MB |
| 320k | Maximum MP3 quality | Near-transparent | 2.4 MB |
Recommendations by Format:
- MP3: 192k (standard), 256k (high quality), 320k (maximum)
- AAC: 128k (standard), 192k (high quality), 256k (maximum)
- Opus: 96k (standard), 128k (high quality), 192k (maximum)
- OGG: 128k (standard), 192k (high quality), 256k (maximum)
--sample-rate - Sample Rate
Set the output sample rate in Hertz. Higher sample rates capture more frequency detail.
Common Sample Rates:
44100 Hz (44.1 kHz) - CD Quality
- Standard for music distribution
- Nyquist frequency: 22.05 kHz (above human hearing)
- Use for: Music, podcasts, general audio
48000 Hz (48 kHz) - Professional Audio
- Standard for video production
- Film and TV industry standard
- Use for: Video soundtracks, professional recording
96000 Hz (96 kHz) - Hi-Res Audio
- Professional mastering
- Captures ultrasonic frequencies
- Use for: Hi-res music, professional archival
22050 Hz (22.05 kHz) - Low Quality
- Voice-only content
- Very low bandwidth
- Use for: Voice recordings, low-quality streaming
Upsampling: Converting 44.1kHz to 96kHz does not add real information - it only increases file size. Always record/capture at the desired sample rate.
--channels - Audio Channels
Control the number of audio channels in the output.
Channel Options:
2 (Stereo) - Default
- Left and right channels
- Spatial imaging and depth
- Standard for music and movies
- File size: Baseline
1 (Mono)
- Single channel
- No spatial information
- File size: ~50% smaller
- Use for: Voice recordings, podcasts, phone audio
Downmixing Stereo to Mono: Both channels are mixed together with proper level adjustment to prevent clipping.
Upmixing Mono to Stereo: The mono channel is duplicated to both left and right channels.
Examples
Convert WAV to MP3 (High Quality)
Convert FLAC to AAC for iTunes
Batch Convert Folder to Opus
Convert to Mono for Voice
Create Lossless Archive
Common Workflows
Music Distribution
# High-quality MP3 for general distribution
mediaproc audio convert master.wav -f mp3 -b 320k
# AAC for iTunes/Apple Music
mediaproc audio convert master.wav -f m4a -b 256k -s 48000
# Opus for streaming (best compression)
mediaproc audio convert master.wav -f opus -b 128k
Podcast Production
# Speech-optimized mono MP3
mediaproc audio convert episode.wav -f mp3 -b 96k -c 1
# High-quality stereo for music-heavy podcasts
mediaproc audio convert episode.wav -f mp3 -b 192k
Archival
# Lossless FLAC for long-term storage
mediaproc audio convert original.wav -f flac -q lossless
# Preserve original sample rate
mediaproc audio convert hires.wav -f flac -s 96000
Performance Tips
Batch Processing: Process multiple files at once by specifying a directory or glob pattern:
mediaproc audio convert *.wav -f mp3 -b 192k -o converted/
Preview Before Converting:
Use --dry-run to see the FFmpeg command without executing:
mediaproc audio convert file.wav -f mp3 --dry-run
Verbose Output:
Add -v to see detailed FFmpeg output for troubleshooting:
mediaproc audio convert file.wav -f mp3 -v
Related Commands
extract- Extract audio from video filesnormalize- Normalize audio levelstrim- Cut audio segments