av_samples_alloc_array_and_samples 参数疑问
来源:8-2 实战音频重采样1

慕先生7104926
2020-12-29
为什么要4096 / 4 没明白
4096 = 每秒采样的大小[bytes]
你说 32b【位深】= 4字节
为什么要4096 / 4呢?
写回答
3回答
-
慕先生7104926
提问者
2020-12-29
上面我也理解错了 read出来的 4096是 一帧的数据量 我win 是8w多 让我以为是1秒的
10 -
慕先生7104926
提问者
2020-12-29
一帧音频的数据量=channel数 * nb_samples样本数 * 每个样本占用的字节数
如果该音频帧是FLTP格式的PCM数据,包含1024个样本,双声道,那么该音频帧包含的音频数据量是2*1024*4=8192字节。
百度解决了
10 -
慕九州0980159
2021-06-15
I have two PCs. Both of which are ubuntu 20.04. Exactly the same env.
HP 840 G3 - 2^14 bytes per av_read_frame() operation. So it's 2^14 / 2 channels / 2 byte per sample = 2^12 samples
HP 15v G3 - 2048 bytes per av_read_frame() operation. So it's 2^11 / 2 /2 = 2^9 samples
So my conclusion is - it depends on the HW.
00
相似问题