视频、音频打时间戳的方法

http://blog.csdn.net/wfqxx/article/details/5497138

1. 视频时间戳
    pts = inc++ *(1000/fps);  其中inc是一个静态的,初始值为0,每次打完时间戳inc加1.
    在ffmpeg,中的代码为
    pkt.pts= m_nVideoTimeStamp++ * (m_VCtx->time_base.num * 1000 / m_VCtx->time_base.den);

2. 音频时间戳
   pts = inc++ * (frame_size * 1000 / sample_rate)
   在ffmpeg中的代码为
   pkt.pts= m_nAudioTimeStamp++ * (m_ACtx->frame_size * 1000 / m_ACtx->sample_rate);
原文地址:https://www.cnblogs.com/eustoma/p/2415753.html