zoukankan      html  css  js  c++  java
  • ffmpeg 时间戳

    http://blog.csdn.net/yfh1985sdq/article/details/5721953

    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 时间戳不对,只有第一帧能显示,其他的都不能显示

  • 相关阅读:
    Application和Page详解
    Session解析
    CSS设置技巧
    CSS布局模型
    CSS盒模型
    JAVA -Xms -Xmx -XX:PermSize -XX:MaxPermSize 区别
    设计模式——单例模式
    设计模式——工厂模式
    Go语言学习
    每周一个设计模式
  • 原文地址:https://www.cnblogs.com/littlejohnny/p/3487215.html
Copyright © 2011-2022 走看看