Audio Processing
16 articles
M4A to MP3 with FFmpeg — Bitrate, VBR, and Quality
Convert M4A (usually AAC, sometimes ALAC) audio to MP3 with FFmpeg using libmp3lame. Covers constant bitrate (-b:a 192k), variable bitrate (-q:a 2), choosing the right quality, and why M4A to MP3 always re-encodes. Practical, runnable commands.
MP4 to MP3 with FFmpeg — Extract Audio to MP3 the Right Way
Extract and convert MP4 audio to MP3 with FFmpeg. Use libmp3lame with VBR (-q:a) or CBR (-b:a), strip the video with -vn, pick the right bitrate, trim sections, and fix common errors. Full troubleshooting and FAQ included.
Replace Audio in a Video with FFmpeg — Swap the Soundtrack
Replace a video's audio with a new audio file using FFmpeg. Map video from one input and audio from another, keep the video lossless, use -shortest to match lengths, and handle the remove-then-add workflow. Practical guide with troubleshooting and FAQ.
Convert WAV to MP3 with FFmpeg — Bitrate and Quality Guide
Convert WAV to MP3 with FFmpeg using libmp3lame. Compare VBR (-q:a) and CBR (-b:a), choose a bitrate for quality vs. size, control mono/stereo and sample rate, and fix common conversion errors. Full troubleshooting and FAQ.
Detect Silence — Find Silent Sections with the silencedetect Filter
Learn how to use FFmpeg's silencedetect filter to get the start time, end time, and duration of silent sections in audio files and videos. Covers setting the threshold (noise) and minimum duration, plus how to read the output, with primary sources.
Add Background Music with FFmpeg — amix BGM Guide
How to add BGM to a video with FFmpeg. Covers amix mixing, volume balance, length adjustment (apad/aloop), fade in/out, and auto-ducking with copy-paste commands and primary sources.
Audio Fade-In and Fade-Out with the afade Filter
Create smooth audio fades in FFmpeg with the afade filter. Covers start time, duration, curve types, applying fades to video audio tracks, and combining fade-in with fade-out in one command.
Automatically Duck BGM Under Narration with sidechaincompress
Implement audio ducking in FFmpeg with the sidechaincompress filter. Automatically lower background music whenever narration plays, with tunable threshold, ratio, attack, and release.
Fix Audio Delay Manually with adelay and -itsoffset
Fix audio/video sync by applying a manual offset in FFmpeg. Add audio delay with the adelay filter, shift video or audio timestamps with -itsoffset, and measure the delay with ffprobe.
FFmpeg Noise Gate — Remove Background Noise with agate
Use FFmpeg's agate filter to apply a noise gate that removes background hum and tape hiss during silence. Covers threshold, attack, release, and range parameters, plus practical podcast and voice-over settings.
FFmpeg astats — Measure RMS, Peak, and DC Offset
Learn how to measure audio statistics with FFmpeg's astats filter — RMS and peak levels, DC offset, dynamic range, per-channel measurements, log output, and how it compares to volumedetect.
Add, Select, and Remove Multiple Audio Tracks — Managing Multilingual Audio with FFmpeg
How to create and edit video files with multiple audio tracks using FFmpeg. Learn to add, select, and remove audio tracks, set language metadata, mark a default track, and understand the differences between MKV and MP4.
Audio Format Conversion — WAV, MP3, AAC, and FLAC
Convert audio formats with FFmpeg: WAV, MP3, AAC, FLAC. Covers -c:a encoder, -b:a vs -q:a quality control, and -ar sample rate conversion.
FFmpeg Fix Audio Sync — -itsoffset, adelay, and -async Explained
Fix audio-video sync drift (lip sync issues) with FFmpeg: -itsoffset for lossless timestamp shift, adelay filter for millisecond-precise audio delay, -async for auto-correction, measuring drift with ffprobe, five error fixes, and five FAQ answers.
FFmpeg Extract Audio — MP3, AAC, WAV, FLAC
Extract audio from video with FFmpeg: lossless copy (-c:a copy) vs re-encoding and when to use each, MP3/AAC/FLAC/WAV format-specific commands, multi-track selection with -map, time-range extraction, batch processing, and five common error fixes.
Loudness Normalization — EBU R128 with the loudnorm Filter
Normalize audio to EBU R128 standard with FFmpeg loudnorm filter. Single-pass and two-pass measurement modes. Key parameters: I (integrated LUFS), TP, and LRA.