当前位置:网站首页>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 .
边栏推荐
- Unity2d -- camera follow
- MySQL advanced II. Logical architecture analysis
- What if win11 wallpaper turns black? The solution of win11 wallpaper blackening
- How to deploy open source Siyuan privately
- Spark job uses log4j appender to append logs to local files or mysql
- How to return to the parent directory with commands
- 正则表达式:邮箱匹配
- Summary of basic knowledge of C language
- Ten thousand words detailed Google play online application standard package format AAB
- log4j2 jdbc appender
猜你喜欢

线程知识总结

Named entity recognition of Chinese electronic medical records based on Roberta WwM dynamic fusion model

Interprocess communication

【科普】精度和分辨率的区别与联系

Simple encapsulation steps of request data request of uniapp

10 practical uses of NFT

Toward Fast, Flexible, and Robust Low-Light Image Enhancement(实现快速、灵活和稳健的弱光图像增强)CVPR2022

Arduino+ze08-ch2o formaldehyde module, output formaldehyde content
How to solve cache avalanche, breakdown and penetration problems

Docker practical experience: deploy mysql8 master-slave replication on docker
随机推荐
Chapter 3 business function development (add clues and remarks, and automatically refresh the added content)
DVWA全级别通关教程
网上券商APP开户安全有保障吗?
Failed to connect to ResourceManager
HDU4565 So Easy!【矩阵连乘】【推导】
Positive mask, negative mask, wildcard
uniapp的request数据请求简单封装步骤
Schematic diagram of C measuring tool
Windows10 installing SQL Server 2019
【STM32】EXTI
Construction and empirical research of post talent demand analysis framework based on recruitment advertisement
@What happens when bean and @component are used on the same class?
Detailed explanation of Telnet remote login AAA mode [Huawei ENSP]
2022牛客多校二_ E I
< C> C language hash table usage
HDU1422 重温世界杯【DP】
poj3461 Oulipo【KMP】
The difference between [x for X in list_a if not np.isnan (x)] and [x if not np.isnan (x) else none for X in list_a]
终于有人把面试必考的动态规划、链表、二叉树、字符串全部撸完了
One of yolox improvements: add CBAM, Se, ECA attention mechanism