bash 使用 ffmpeg 获取有关 mp3 的信息的命令?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7465153/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 00:48:39 来源:igfitidea点击:
Command to get information about a mp3 using ffmpeg?
提问by user784637
Is there a command with ffmpeg that returns information about an mp3 like the bitrate or sampling frequency?
是否有带有 ffmpeg 的命令可以返回有关 mp3 的信息,例如比特率或采样频率?
回答by Davide Piras
you can try:
你可以试试:
ffmpeg -i filename
回答by Micha? ?rajer
There is a ffprobe.
有一个ffprobe.
Simple usage:
简单用法:
ffprobe foo.mp3 2>&1 | grep -A1 Duration:
will give you output (without displaying any extra window) like:
会给你输出(不显示任何额外的窗口),如:
Duration: 00:03:10.48, start: 0.000000, bitrate: 128 kb/s
Stream #0.0: Audio: mp3, 22050 Hz, 2 channels, s16, 128 kb/s
回答by not2qubit
You can also use:
您还可以使用:
$ mpg123 -t example.mp3 2>&1 | grep -A1 -E "^MPEG"
MPEG 2.5 L III cbr32 11025 mono
- Notice
cbr32stand for (stream)codec bit rate, here at 32 kbps. - And
11025is the Sample Rate.
- 注意
cbr32代表(流)codec bit rate,此处为 32 kbps。 - 而且
11025是采样率。

