当前位置:网站首页>Timestamp of AAC, h264, etc
Timestamp of AAC, h264, etc
2022-07-27 14:43:00 【qianbo_ insist】
aac Time stamp
aac: Advanced audio coding , The sampling rate is generally 44100, How to calculate the timestamp ? Generally speaking , Everyone will calculate like this :1024*1000/44100 = 23 millisecond , So this one 1024 To come from ?
1024 It means nb_sample, Is to choose from 1024 Bytes for encoding , And according to the sampling rate , One second produces 44100 byte , that 1024 How much , Namely 1024/44100, multiply 1000, Into milliseconds . Got to know this , That is, the correct timestamp can be generated .
about RTP Agreement for , Direct transmission 1024 Interval as timestamp .
h264 h265 Time stamp
RTP The agreement is different from other agreements , If using RTP agreement , Both the audio timestamp and the video timestamp need to be adjusted . For video , We give a calculation formula code
static uint32_t convertToRTPTimestamp(/*struct timeval tv*/)
{
timeval tv;
gettimeofday(&tv, NULL);
UINT32 timestampIncrement = (90000 * tv.tv_sec);
timestampIncrement += (UINT32)((2.0 * 90000 * tv.tv_usec + 1000000.0) / 2000000);
//UINT32 const rtpTimestamp = timestampIncrement;
return timestampIncrement;
}
This is a h264 h265 Function of calculating timestamp by encoding , It is obvious that you have multiplied by one 90000, Why? , because 90000 When multiplied, it can become an integer , that 0, 4500,9000,13500 How to calculate the frame rate of this integer ,x * 90000 = 4500 , that x = 4500/90000 = 1/20, Obviously , Apart, One twentieth of a second , At this moment, you can see that it is one second 20 frame .
RTMP Protocol timestamp
For things like RTMP Wait for the protocol timestamp , It uses relative and absolute timestamps , The first is the absolute timestamp , Then use the relative timestamp , That is, the relative timestamp relative to the first absolute time . Timestamps for protocols like this , It uses the normal timestamp .
ffmpeg
ffmpeg Whether the current relative timestamp can be used directly ? It is also related to the agreement . about RTMP Push flow and RTSP To push the flow , Follow the agreement ,RTSP The agreement is obviously to be observed RTP Protocol timestamp ,RTMP Use the normal timestamp , have access to 0, Then follow the passing time , That is, absolute timestamp use 0, Relative timestamp uses the time difference relative to zero .
边栏推荐
- Recursive method to realize the greatest common divisor
- 股票买卖4
- 初学者入门:使用WordPress搭建一个专属自己的博客
- uniapp的request数据请求简单封装步骤
- HDU4565 So Easy! [matrix multiplication] [derivation]
- Simple encapsulation steps of request data request of uniapp
- Chapter 3 business function development (view clue details)
- Kubernetes 节点磁盘故障排查
- FPGA时序约束分享04_output delay 约束
- Airport cloud business sign analysis
猜你喜欢

CPU、GPU、NPU的区别

PROFINET 模拟器使用教程

Navicate报错access violation at address 00000000

Advanced MySQL III. storage engine

一篇文章看懂JS执行上下文

Annual comprehensive analysis of China's online video market in 2022

Group division and characteristic analysis of depression patients based on online consultation records

Shell programming specifications and variables

Leetcode · daily question · 592. fraction addition and subtraction · simulation

codeforces 1708E - DFS Trees
随机推荐
aac 和 h264等的时间戳
watch VS watchEffect
在Oracle VirtualBox中导入Kali Linux官方制作的虚拟机
RTL8762DK 环境搭建(一)
Unity3D学习笔记10——纹理数组
poj3461 Oulipo【KMP】
Unity2d -- camera follow
Ten thousand words detailed Google play online application standard package format AAB
巨形象的图解 SQL
一篇文章看懂JS执行上下文
c语言分层理解(c语言数组)
Database storage series (1) column storage
Schematic diagram of C measuring tool
Annual comprehensive analysis of China's online video market in 2022
JS epidemic at home, learning can't stop, 7000 word long text to help you thoroughly understand the prototype and prototype chain
JS 疫情宅在家,学习不能停,七千字长文助你彻底弄懂原型与原型链
C language layered understanding (C language array)
开源版思源怎么私有部署
获取Unity打开摄像头第一帧有画面的数据
Import the virtual machine officially made by Kali Linux into Oracle VirtualBox