用 ffmpeg 和 libmp3lame 把音频转成 MP3
在终端里用 ffmpeg 的 LAME 编码器把 M4A、WAV、FLAC 等音频转换为 MP3。
运行 ffmpeg -i song.m4a -c:a libmp3lame -q:a 2 song.mp3,即可把任意音频文件转换成高质量 MP3。
01命令
命令
$ ffmpeg -i song.m4a -c:a libmp3lame -q:a 2 song.mp302作用说明
ffmpeg 会自动识别输入文件的格式,-c:a libmp3lame 指定使用 LAME 编码器输出 MP3。-q:a 2 采用可变码率的质量刻度(0 最高音质,9 文件最小),级别 2 约为 190 kbps,对大多数听众来说已经和原音无异。要批量转换整个文件夹,可以用:for f in *.m4a; do ffmpeg -i "$f" "${f%.m4a}.mp3"; done。
03风险
!注意: 转成 MP3 属于有损压缩——从一种有损格式(如 M4A/AAC)再转 MP3 会进一步损失音质,以后可能用到原文件的话请保留备份。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- ffmpeg Documentation依据: The documentation describes -i as the input file option and -c:a as the audio codec selection option used with encoders such as libmp3lame.
- FFmpeg FAQ依据: The FAQ references the libmp3lame encoder for producing MP3 output files with ffmpeg.
最后验证: 2026-09-19 · 分类: 媒体