音频简析
1.音频属性
Audio: aac (HE-AAC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 37 kb/s (default)
- 第一层:采样频率、位深、声道数(Mono单声道,Stereo双声道)、帧长、采样格式(fltp)、码率(码率=采样频率*位深*声道数)
- 第二层:codec(mp3、opus)
- 第三层:formats(mp3、opus、wav)
音频裸数据就是pcm(Pulse Code Modulation)脉冲编码调制
# 以下命令可以显示详细的音频信息 ffprobe -i 音频文件 -show_format -show_streams
2.采样格式
如下是音频采样格式的名字和位深,p代表planner,对于双通道的排列方式位LLLL....RRRR....,不带p的表示packed,对于双通道的排列方式为LRLRLRLR
name depth
u8 8 // 8位无符号整数
s16 16 // 16位带符号整数
s32 32 // 32位带符号整数
flt 32 // float
dbl 64 // double
u8p 8
s16p 16
s32p 32
fltp 32
dblp 64
s64 64 // 64位带符号整数
s64p 64
3.pcm封装格式
# ffmpeg -codecs | grep -i "pcm" DE alaw PCM A-law DE f32be PCM 32-bit floating-point big-endian DE f32le PCM 32-bit floating-point little-endian DE f64be PCM 64-bit floating-point big-endian DE f64le PCM 64-bit floating-point little-endian DE mulaw PCM mu-law DE s16be PCM signed 16-bit big-endian DE s16le PCM signed 16-bit little-endian DE s24be PCM signed 24-bit big-endian DE s24le PCM signed 24-bit little-endian DE s32be PCM signed 32-bit big-endian DE s32le PCM signed 32-bit little-endian DE s8 PCM signed 8-bit D sln Asterisk raw pcm DE u16be PCM unsigned 16-bit big-endian DE u16le PCM unsigned 16-bit little-endian DE u24be PCM unsigned 24-bit big-endian DE u24le PCM unsigned 24-bit little-endian DE u32be PCM unsigned 32-bit big-endian DE u32le PCM unsigned 32-bit little-endian DE u8 PCM unsigned 8-bit DE vidc PCM Archimedes VIDC