About timestamp issues in RTP
Timestamp unit: The unit in which the timestamp is calculated is not a unit of seconds, but a unit that is replaced by the sampling frequency, so that the purpose is to be more precise in the timestamp unit. For example, if an audio sample frequency is 8000HZ, we can set the timestamp unit to 1/8000.
Timestamp increment: The time difference (in timestamp units) between adjacent two RTP packets.
How do I set the increment between timestamps?
According to the time stamp unit, 1 seconds according to the timestamp unit is 8000, then a second if you can play 20 frames, that is, send 30 frames (frame rate), then you can find the time difference between two adjacent frames, that is, timestamp increment, then it is obvious that 8000/ 20, then this timestamp increment is 400.
An example of most of the online examples are: MPEG, 20ms per frame, sample frequency 8000Hz, set timestamp unit 1/8000, and 160 increments between each package
How do you understand it here? It is easy to see that the increment is directly 8000 multiplied with 20ms results, we can know that the time between two frames is 20ms, that is, 0.02s, this unit is measured in seconds, then we have to use time-stamp units to indicate that is 8000*0.02=160. So the timestamp increment is 160.
Why do you usually use 90000 as the video sampling frequency?
90k is the time scale for video synchronization (timescale), which is 90k clock ticks per second. Why use 90k? At present, the frame rate of video is mainly 25fps, 29.97fps, 30fps and so on, and 90k is just a multiple of them, so it adopts 90k. (Note: This is not quite right, 27KMHZ, 300 divide)
About timestamp issues in RTP