FFmpeg - Audio Channel Layout
From PiRho Knowledgebase
References:
- https://superuser.com/questions/852400/properly-downmix-5-1-to-stereo-using-ffmpeg
- https://trac.ffmpeg.org/wiki/AudioChannelManipulation
Summary
This article explains how FFmpeg understands, manipulates, converts, and remaps audio channels.
Why Channel Layout Matters
Modern multimedia workflows often involve mixed devices and formats.
Understanding FFmpeg’s Channel Layouts
Common layouts include mono, stereo, 5.1, 7.1.
Downmixing Surround to Stereo
Examples of downmix commands.
Upmixing Stereo to Surround
Example: stereo to 5.1.
Reordering Channels (channelmap)
Example: correcting wrong order.
Extracting Individual Channels
Examples using -map_channel.
Creating Silent Placeholder Channels
Example using anullsrc.
Common Pitfalls
Includes layout mismatches and LFE issues.
Design & Architecture Considerations
Always explicitly declare layouts.
Troubleshooting Checklist
Use ffprobe to inspect layouts.
Related Topics
- FFmpeg – Resampling & Formats
- FFmpeg – Filter Graph Basics
- Audio Fundamentals – Channel Concepts