if (packet->dts == AV_NOPTS_VALUE && mFrame->opaque
            && *(uint64_t*) mFrame->opaque != AV_NOPTS_VALUE) {      //  表示从这个包没有获得dts,  但我们获得了第一包的pts,     那我们就使用这个PTS 作为帧的pts
            
        pts = *(uint64_t *) mFrame->opaque;
        
    } else if (packet->dts != AV_NOPTS_VALUE) {           // 被avcodec_decode_video()  处理过的包的DTS 和它返回的帧的PTS总是相同的,因而可以用DTS作为PTS
        pts = packet->dts;
    } else {
        pts = 0;        //如果我们得不到PTS就把它设置为0。
    }
    }

相关文章:

  • 2022-12-23
  • 2021-09-02
  • 2021-09-29
  • 2021-10-26
  • 2021-12-05
  • 2022-12-23
  • 2021-06-07
  • 2021-09-22
猜你喜欢
  • 2021-07-16
  • 2021-07-10
  • 2021-06-28
  • 2021-10-02
  • 2021-07-15
  • 2021-07-03
  • 2021-06-21
相关资源
相似解决方案