FLV rtmp 里存在B帧的情况下,time stamp 时间戳应该怎么玩
2016-12-18 15:13
441 查看
先来引用stackoverflow的一篇文章:
CompositionTime Composition time offset
See ISO 14496-12, 8.15.3 for an explanation of composition times. The offset in an FLV file is always in milliseconds
provides the offset between decoding time and composition time. Since decoding time must be less than the composition time, the offsets are expressed as unsigned numbers such that CT(n) = DT(n) + CTTS(n) where CTTS(n) is the (uncompressed)
table entry for sample n.
For MPEG-4 H.246 transcoders that deliver I-frame, P-frame, and B-frame NALUs inside an MPEG-2 transport, the resulting packetized elementary streams (PES) are timestamped with presentation time stamps (PTS) and decoder timestamps (DTS) in time units of 1/90000
of a second.
The NALUs come in DTS timestamp order in a repeating pattern like
I P B B B P B B B …
where the intended playback rendering is
I B B B P B B B P …
(This transport strategy ensures that both frames that the B-frame bridges are in the decoder before the B-frame is processed.)
For FLV, the Timestamp (FLV spec p.69) tells when the frame should be fed to the decoder in milliseconds, which is
timestamp = DTS / 90.0
The CompositionTime (FLV spec p.72) tells the renderer when to perform (“compose”) the video frame on the display device in milliseconds after it enters the decoder; thus it is
compositionTime = (PTS – DTS) / 90.0
(Because the PTS >= DTS, this delta is never negative.)
大概知道什么意思了没?再来帖 一张图,从flv的标准文档里扣的:
就是给它赋值 compostionTime即可。
CompositionTime Composition time offset
See ISO 14496-12, 8.15.3 for an explanation of composition times. The offset in an FLV file is always in milliseconds
provides the offset between decoding time and composition time. Since decoding time must be less than the composition time, the offsets are expressed as unsigned numbers such that CT(n) = DT(n) + CTTS(n) where CTTS(n) is the (uncompressed)
table entry for sample n.
For MPEG-4 H.246 transcoders that deliver I-frame, P-frame, and B-frame NALUs inside an MPEG-2 transport, the resulting packetized elementary streams (PES) are timestamped with presentation time stamps (PTS) and decoder timestamps (DTS) in time units of 1/90000
of a second.
The NALUs come in DTS timestamp order in a repeating pattern like
I P B B B P B B B …
where the intended playback rendering is
I B B B P B B B P …
(This transport strategy ensures that both frames that the B-frame bridges are in the decoder before the B-frame is processed.)
For FLV, the Timestamp (FLV spec p.69) tells when the frame should be fed to the decoder in milliseconds, which is
timestamp = DTS / 90.0
The CompositionTime (FLV spec p.72) tells the renderer when to perform (“compose”) the video frame on the display device in milliseconds after it enters the decoder; thus it is
compositionTime = (PTS – DTS) / 90.0
(Because the PTS >= DTS, this delta is never negative.)
大概知道什么意思了没?再来帖 一张图,从flv的标准文档里扣的:
就是给它赋值 compostionTime即可。
相关文章推荐
- FLV rtmp 里存在B帧的情况下,time stamp 应该怎么玩 ?
- FLV rtmp 里存在B帧的情况下 time stamp 时间戳 2
- FLV rtmp 里存在B帧的情况下 time stamp 时间戳
- mysql出现多线程操作同一个表的情况,应该怎么办?
- 在jsp中出现异常后应该停止往下执行的情况,怎么处理?
- 构造相同hash的字符串进行攻击,这种情况应该怎么处理?JDK7如何处理?
- 小王是一个测试团队的新成员,遇上这个情况应该怎么办?
- 大家应该都用过SVN,多个小组开发时,分小组提交代码,可是有特殊情况的,小组要穿插提交增量文件,该怎么做呢?SVN补丁是一种能导出变更增量的方法。
- easyui 像狗屎一样的框架 怎么设置datetimebox的值为当前时间, 怎么情况datetimebox的值
- 紧急情况下压缩了测试周期应该怎么办?
- 【转】紧急情况下压缩了测试周期应该怎么办?
- 在 WPA2 安全协议存在漏洞的情况下,我们应该如何保护自己?
- 4程序员小飞原计划三天完成某个任务,现在是第三天的下午,他马上就可以做完。但是在实现功能的过程中,他越来越意识到自己原来设计中的弱点,他应该采取另一个办法,才能避免后面集成阶段的额外工作。但是他如果现在就改弦更张,那势必要影响自己原来估计的准确性,并且会花费额外的时间,这样他的老板、同事也许会因此看不起他。如果他按部就班地按既定设计完成,还要花更多时间在后续集成上,但那就不是他个人的问题了,怎么办
- 关于Visual stduio安装后出现了“出现了运行时间错误。是否要进行调试?”对话框,应该怎么办
- 【转】紧急情况下压缩了测试周期应该怎么办?
- 紧急情况下压缩了测试周期应该怎么办
- easyui 像狗屎一样的框架 怎么设置datetimebox的值为当前时间, 怎么情况datetimebox的值
- 遇到这样的情况你应该怎么办
- easyui 像狗屎一样的框架 怎么设置datetimebox的值为当前时间, 怎么情况datetimebox的值
- 一个数组中,存在两个只出现一次的数字,其余的数字均出现两次。要求在时间复杂度o(n),空间复杂度为o(1)的情况下找出这两个数字