ffmpeg AVStream time_base

AVStream 中的time_base  为帧率倒数。数据结构是  

typedef struct AVRational{
  int num; ///< numerator
  int den; ///< denominator
} AVRational;

打印看结果是  

num = 1, den = 23. 每秒23帧。

关于 av_q2d

源码中

/**
* Convert rational to double.
* @param a rational to convert
* @return (double) a
*/
static inline double av_q2d(AVRational a){
return a.num / (double) a.den;
}

ps:

  http://www.chinavideo.org/viewthread.php?tid=2888

原文地址:https://www.cnblogs.com/soniclq/p/2683840.html