当前位置:网站首页>sample_rate(采样率),sample(采样),duration(时长)是什么关系
sample_rate(采样率),sample(采样),duration(时长)是什么关系
2022-07-05 18:12:00 【hjjdebug】
sample_rate(采样率),sample(采样),duration(时长)是什么关系
发现一个音频包解开成一个frame 后,有如下数据
nb_samples = 1024
sample_rate = 48000
pkt_duration = 1920
pkt_size = 427
这些数值到底是什么关系?
pkt_size = 427 表示音频压缩包的大小为427 bytes
nb_samples = 1024 表示解码后得到了1024个采样数据
sample_rate = 48000 表示每秒钟需要播出48K 数据
pkt_duration = 1920
sample_rate:采样率, 每秒采样次数 48000HZ,每个sample的时间是1/48000秒
nb_samples: 采样次数
音频播放时间, nb_samples 采样点所能播放的时间
duration_s=nb_samples*(1/48000)秒,
duration 的单位即不是秒,也不是毫秒,而是AVStream 时基的个数.
duration=duration_s / av_q2d(st->time_base)
st->time_base 是 (1,90k), 则av_q2d=1/90k
所以duration 实际是秒数乘以90K
则:
duration = 1024 * 1/48K *90K = 1920
特例: 如果令st->time_base == sample_rate,
则duration=nb_samples.
另外, pts 是按 duration 来递长的。
边栏推荐
- Crontab 日志:如何记录我的 Cron 脚本的输出
- Multithreading (I) processes and threads
- 在一台服务器上部署多个EasyCVR出现报错“Press any to exit”,如何解决?
- Sophon Base 3.1 推出MLOps功能,为企业AI能力运营插上翅膀
- 开户注册股票炒股安全吗?有没有风险的?靠谱吗?
- Eliminate the writing of 'if () else{}'
- 瀚升优品app翰林优商系统开发功能介绍
- 让更多港澳青年了解南沙特色文创产品!“南沙麒麟”正式亮相
- ISPRS2022/雲檢測:Cloud detection with boundary nets基於邊界網的雲檢測
- 使用QT遍历Json文档及搜索子对象
猜你喜欢

Record eval() and no in pytoch_ grad()

LeetCode 6111. 螺旋矩阵 IV

ConvMAE(2022-05)

Binder开辟线程数过多导致主线程ANR异常

第十一届中国云计算标准和应用大会 | 云计算国家标准及白皮书系列发布 华云数据全面参与编制

vulnhub之darkhole_2

Use JMeter to record scripts and debug

第十一届中国云计算标准和应用大会 | 华云数据成为全国信标委云计算标准工作组云迁移专题组副组长单位副组长单位

About statistical power

星环科技数据安全管理平台 Defensor重磅发布
随机推荐
Wu Enda team 2022 machine learning course, coming
How to obtain the coordinates of the aircraft passing through both ends of the radar
Leetcode notes: Weekly contest 300
@Extension、@SPI注解原理
Introduction to Resampling
Sophon CE Community Edition is online, and free get is a lightweight, easy-to-use, efficient and intelligent data analysis tool
集群部署如何解决海量视频接入与大并发需求?
Introduction to Resampling
Check namespaces and classes
Star Ring Technology launched transwarp Navier, a data element circulation platform, to help enterprises achieve secure data circulation and collaboration under privacy protection
New words new words new words new words [2]
nano的CAN通信
Leetcode exercise - 206 Reverse linked list
使用Jmeter虚拟化table失败
Use of print function in MATLAB
IDC report: Tencent cloud database ranks top 2 in the relational database market!
Eliminate the writing of 'if () else{}'
金太阳开户安全吗?万一免5开户能办理吗?
Electron安装问题
U-Net: Convolutional Networks for Biomedical Images Segmentation