ffmpeg 时间戳

AVpacket里的时间戳pts和dts.单位好像是us. 问 : 时间戳pts和dts,这里两个时间戳各有什么意义? 答 : 显示时间,解码时间. DTS:decoding time stamp PTS:presentation time stamp Generally the PTS and DTS will only differ when the stream we are playing has B frames in it. 问 : 在 VLC 中调用 avcodec_decode_video() 函数进行解码时,AVFrame->pts 时间戳不对,导致我的图像不能够显示? 请问有谁知道它的解码原理,这个 PTS 怎么得出的吗?还是外部传入的? 答 : AVFrame 上的时间戳是用户事件戳 是用户打上去的,就是你的程序。 PTS 是在包AVPacket上 显示时间戳是在 影片被encode的时候打上的。。编码器 会做这部分工作。 在play back 的时候会根据这个时间 调整播放进度。 我贴下 VLC 的代码,(vlc-0.9.8a/modules/codec/avcodec/video.c 文件中) i_used = avcodec_decode_video( p_sys->p_context, p_sys->p_ff_pic, &b_gotpicture, p_sys->i_buffer <= 0 && p_sys->b_flush ? NULL : (uint8_t*)p_sys->p_buffer, p_sys- >i_buffer ); 中间省略 取得 PTS , if( p_sys->p_ff_pic->pts ) { printf(" p_sys->p_ff_pic->pts = %Lx/n", p_sys->p_ff_pic->pts); p_sys->i_pts = p_sys->p_ff_pic->pts; } 从 AVFrame 结构中取得 这个 PTS ,但是这个 AVFrame 结构中取得 这个 PTS 从哪里取得的呢? 你的问题解决没有,我现在也是这个问题,AVFrame->pts 时间戳不对,只有第一帧能显示,其他的都不能显示
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值