FFmpeg : Convertir Stéréo en Mono (Moyenne, Gauche seulement, Droite seulement)
La commande la plus simple et robuste pour downmix stéréo → mono dans FFmpeg :
ffmpeg -i input.wav -ac 1 output.wav
Ce que fait `-ac 1`
- Définit **canaux audio sortie = 1**.
- Comportement par défaut : **Moyenne (somme/2)** de Gauche + Droite → Mono. Préserve image centrale, évite accumulation 6 dB.
- Marche sur tout format entrée (WAV, MP3, FLAC, AAC, M4A, MOV, MP4).
- Conteneur sortie correspond extension (.wav, .mp3, .flac, .m4a).
Variantes & Options
Garder seulement canal Gauche (Jeter Droite)
ffmpeg -i input.wav -map_channel 0.0.0 -ac 1 output_left.wav
Garder seulement canal Droit (Jeter Gauche)
ffmpeg -i input.wav -map_channel 0.0.1 -ac 1 output_right.wav
Syntaxe Map Channel
-map_channel
- `0.0.0` = Fichier 0, Flux 0 (généralement audio), Canal 0 (Gauche).
- `0.0.1` = Fichier 0, Flux 0, Canal 1 (Droite).
- Utilisez `ffmpeg -i input.wav` pour voir indices flux/canaux.
Mix custom (ex: Gauche + 0,5×Droite)
ffmpeg -i input.wav -af "pan=mono|c0=1.0*c0+0.5*c1" output_custom.wav
- `pan=mono` → 1 canal sortie.
- `c0` = entrée ch 0 (G), `c1` = entrée ch 1 (D). Coefficients = gain.
Rééchantillonnage Haute Qualité + Mono (Pour Production)
ffmpeg -i input.wav -af "aresample=48000:resampler=soxr:precision=28,pan=mono|c0=0.5*c0+0.5*c1" -c:a pcm_s24le output_mono_48k_24bit.wav
- `aresample=48000` → force 48 kHz (standard vidéo).
- `soxr` (SoX Resampler) = plus haute qualité.
- `pcm_s24le` = 24-bit PCM WAV (grade mastering).
Conversion lot dossier (Bash / PowerShell)
# Bash (Linux/macOS/WSL) for f in *.wav; do ffmpeg -i "$f" -ac 1 "mono_${f}"; done # PowerShell (Windows) Get-ChildItem *.wav | ForEach-Object { ffmpeg -i $_.Name -ac 1 "mono_$($_.Name)" }
Test rapide & Vérification
# Vérifier canaux ffprobe -v error -select_streams a -show_entries stream=channels -of csv=p=0 output.wav # Doit retourner: 1 # Écouter ffplay -nodisp -autoexit output.wav
Règle empirique : Utilisez `-ac 1` pour 99% des cas (dialogue, stems musique, podcasts). Utilisez `-map_channel` seulement pour isolation forensic (ex: lav sur Gauche, perche sur Droite). Vérifiez toujours au casque.
