如何获得一个帧的DTS [英] How to get DTS of a frame

查看:201
本文介绍了如何获得一个帧的DTS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用H.264 MFT将自己的编码和多路复用编码帧转换为MP4文件。


我可以使用  IMFSample-> GetSampleTime(& iSampleTime),


来获取时间戳(演示时间)但是为了正确地复用帧我需要知道帧的DTS(它可以与PTS不同。


有人能告诉我如何从IMFSample中获取DTS? 


谢谢

解决方案

IMFSample :: GetSampleTime返回QPC / DTS,除非你在传递给接收器后得到它。然后它包含基于第一个样本的GetSampleTime计算的呈现时间:


[source] - >具有QPC / DTS的IMFSample - > <&的MTF GT; - >具有QPC / DTS的IMFSample - > [Sink] - >带有PTS的IMFSample。


编辑:


您也可以尝试使用
MFSampleExtension_DeviceTimestamp
属性。




Hi,

I'm using H.264 MFT to do encoding and mux encoded frames myself into a MP4 file.

I could get the timestamp (presentation time) using IMFSample->GetSampleTime(&iSampleTime),

But to mux frames correctly I need to know DTS of the frames (it could be different from PTS).

Could anyone tell me how can I get DTS from a IMFSample? 

Thanks

解决方案

IMFSample::GetSampleTime returns QPC/DTS, unless you are getting it after it's been passed to the sink. Then it contains the presentation time that is calculated based on the first sample's GetSampleTime:

[source] -> IMFSample with QPC/DTS -> <MTFs> -> IMFSample with QPC/DTS -> [Sink] -> IMFSample with PTS.

Edited:

You can also try and use MFSampleExtension_DeviceTimestamp attribute.



这篇关于如何获得一个帧的DTS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆