How to calculate the RTP time stamp for each packet in the audio stream

I read the RTP specification, and I can't seem to cheat on the RTP packet timestamp. I tried to implement it differently on my server, but I can not get the player to play correctly.

The “wrong” behavior I encountered is that (I am using a VLC player to play the RTSP URL on my server). I find that the player’s logs say that the “buffer path is too late” and “the PTS value is incorrect . This means that the audio frames come in packets whose timestamp is not set correctly. I tried to generate a timestamp differently, but such there was no luck.

I need some detailed resource or link that really puts me on the right track to understand how the RTP timestamp works and is generated.

+4
source share
1 answer

Audio and video timestamps are calculated in the same way.

RTP 8- . , , , 20 t = 0. 20 - 1/50 , 8000/50 = 160 . , . timestamped, RTP.

, RTP , .

RTP , RTP - . , RTP.

: NTP SRCP RTCP, , RTP, , RTP 160 = . , , , RTP . , / , - NTP , , /. wirehark, , / ​​ NTP.

2:

, . RTSP, . , DirectShow, RTP , . , , , , RTP, . . , VLC.

+6

Source: https://habr.com/ru/post/1547787/


All Articles