当前位置:网站首页>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 来递长的。
边栏推荐
- Tencent music launched its new product "quyimai", which provides music commercial copyright authorization
- Memory management chapter of Kobayashi coding
- How can cluster deployment solve the needs of massive video access and large concurrency?
- 最大人工岛[如何让一个连通分量的所有节点都记录总节点数?+给连通分量编号]
- The easycvr platform reports an error "ID cannot be empty" through the interface editing channel. What is the reason?
- 小白入门NAS—快速搭建私有云教程系列(一)[通俗易懂]
- Record eval() and no in pytoch_ grad()
- 《2022中国信创生态市场研究及选型评估报告》发布 华云数据入选信创IT基础设施主流厂商!
- 在一台服务器上部署多个EasyCVR出现报错“Press any to exit”,如何解决?
- pytorch yolov5 训练自定义数据
猜你喜欢
分享:中兴 远航 30 pro root 解锁BL magisk ZTE 7532N 8040N 9041N 刷机 刷面具原厂刷机包 root方法下载
Record a case of using WinDbg to analyze memory "leakage"
Find the first k small element select_ k
nano的CAN通信
Isprs2022 / Cloud Detection: Cloud Detection with Boundary nets Boundary Networks Based Cloud Detection
第十届全球云计算大会 | 华云数据荣获“2013-2022十周年特别贡献奖”
图片数据不够?我做了一个免费的图像增强软件
修复漏洞 - mysql 、es
瀚升优品app翰林优商系统开发功能介绍
Copy the linked list with random pointer in the "Li Kou brush question plan"
随机推荐
【在優麒麟上使用Electron開發桌面應】
[performance test] full link voltage test
Can communication of nano
瀚升优品app翰林优商系统开发功能介绍
U-Net: Convolutional Networks for Biomedical Images Segmentation
Xiaobai getting started with NAS - quick building private cloud tutorial series (I) [easy to understand]
Sophon KG升级3.1:打破数据间壁垒,解放企业生产力
金太阳开户安全吗?万一免5开户能办理吗?
Generate XML schema from class
Nanjing University: Discussion on the training program of digital talents in the new era
《力扣刷题计划》复制带随机指针的链表
jdbc读大量数据导致内存溢出
开户注册挖财安全吗?有没有风险的?靠谱吗?
MATLAB中print函数使用
How to solve the error "press any to exit" when deploying multiple easycvr on one server?
mybash
Matlab built-in function how different colors, matlab subsection function different colors drawing
About Estimation with Cross-Validation
使用QT遍历Json文档及搜索子对象
Record eval() and no in pytoch_ grad()