当前位置:网站首页>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 来递长的。
边栏推荐
- 第十一届中国云计算标准和应用大会 | 云计算国家标准及白皮书系列发布 华云数据全面参与编制
- Sophon Base 3.1 推出MLOps功能,为企业AI能力运营插上翅膀
- Leetcode notes: Weekly contest 300
- Easynmon Usage Summary
- Access the database and use redis as the cache of MySQL (a combination of redis and MySQL)
- Sophon autocv: help AI industrial production and realize visual intelligent perception
- Whether to take a duplicate subset with duplicate elements [how to take a subset? How to remove duplicates?]
- 苹果手机炒股安全吗?打新债是骗局吗?
- About Estimation with Cross-Validation
- Vulnhub's darkhole_ two
猜你喜欢

Sophon Base 3.1 推出MLOps功能,为企业AI能力运营插上翅膀

寻找第k小元素 前k小元素 select_k

Sophon autocv: help AI industrial production and realize visual intelligent perception

Image classification, just look at me!

ISPRS2022/雲檢測:Cloud detection with boundary nets基於邊界網的雲檢測

Failed to virtualize table with JMeter

IDC report: Tencent cloud database ranks top 2 in the relational database market!

Fix vulnerability - mysql, ES

Find the first k small element select_ k

@Extension、@SPI注解原理
随机推荐
小林coding的内存管理章节
Generate XML schema from class
修复漏洞 - mysql 、es
ConvMAE(2022-05)
开户复杂吗?网上开户安全么?
The easycvr platform reports an error "ID cannot be empty" through the interface editing channel. What is the reason?
星环科技数据安全管理平台 Defensor重磅发布
金太阳开户安全吗?万一免5开户能办理吗?
[TestLink] testlink1.9.18 solutions to common problems
Isprs2022 / Cloud Detection: Cloud Detection with Boundary nets Boundary Networks Based Cloud Detection
Memory management chapter of Kobayashi coding
[BeanShell] there are many ways to write data locally
nano的CAN通信
Introduction to Resampling
第十一届中国云计算标准和应用大会 | 华云数据成为全国信标委云计算标准工作组云迁移专题组副组长单位副组长单位
从类生成XML架构
matlab内建函数怎么不同颜色,matlab分段函数不同颜色绘图
星环科技重磅推出数据要素流通平台Transwarp Navier,助力企业实现隐私保护下的数据安全流通与协作
【在优麒麟上使用Electron开发桌面应】
瀚升优品app翰林优商系统开发功能介绍