深入理解pts,dts,time_base
http://blog.chinaunix.net/uid-20554957-id-5836134.html
视音频pts计算
https://blog.csdn.net/dancing_night/article/details/45972361
关于FFmpeg的pts转时基时的计算步骤(包括无输入流地址和有输入流地址)
https://blog.csdn.net/weixin_44517656/article/details/110559611
这里对第一步说明:
cal_duration是1000000/25,ffmpeg中的时间基是1.010-6 其实就是微妙,这里cal_duration就是1s占多少微妙,这样做好处就是没有s的小数了。
pts的计算可以转化一下 (ncal_duration)/ 10000,这就是有转换成秒了,然后再乘以输入时间基,就成了按照输入基准计算出来的pts,这样就有了第三步转时基的操作。
关于时间基一般来说flv mp4等都是1000就是毫秒,摄像头采集90kHZ,ffmpeg1000000.
FFmpeg中的时间基(time_base), AV_TIME_BASE
https://www.cnblogs.com/yongdaimi/p/10684953.html
ffmpeg中tbr tbc tbn的含义解释
https://blog.csdn.net/xujaiwei/article/details/77773438
ffmpeg time_base
http://www.cnitblog.com/luofuchong/archive/2014/11/28/89869.html
拓展:时间基为什么是90KhZ?
the following sections describe the video encodings that are defined
in this memo and give their abbreviated names used for
identification. These video encodings and their payload types are
listed in Table 5.
All of these video encodings use an RTP timestamp frequency of 90,000
Hz, the same as the MPEG presentation time stamp frequency. This
frequency yields exact integer timestamp increments for the typical
24 (HDTV), 25 (PAL), and 29.97 (NTSC) and 30 Hz (HDTV) frame rates
and 50, 59.94 and 60 Hz field rates. While 90 kHz is the RECOMMENDED
rate for future video encodings used within this profile, other rates
MAY be used. However, it is not sufficient to use the video frame
rate (typically between 15 and 30 Hz) because that does not provide
adequate resolution for typical synchronization requirements when
calculating the RTP timestamp corresponding to the NTP timestamp in
an RTCP SR packet. The timestamp resolution MUST also be sufficient
for the jitter estimate contained in the receiver reports.
For most of these video encodings, the RTP timestamp encodes the
sampling instant of the video image contained in the RTP data packet.
If a video image occupies more than one packet, the timestamp is the
same on all of those packets. Packets from different video images
are distinguished by their different timestamps.
Most of these video encodings also specify that the marker bit of the
RTP header SHOULD be set to one in the last packet of a video frame
and otherwise set to zero. Thus, it is not necessary to wait for a
following packet with a different timestamp to detect that a new
frame should be displayed
比如:fps为25和30
1/25=x/90K
1/30=x/90k
这样都能整除,90k就是