RTP timestamp, role of RTCP for AV sync with VLC client

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
ekvlc
New Cone
New Cone
Posts: 6
Joined: 18 Sep 2009 02:09
VLC version: 1.0.5
Operating System: Windows

RTP timestamp, role of RTCP for AV sync with VLC client

Postby ekvlc » 18 Sep 2009 19:00

I am writing a small RTSP server application. I have been able to stream audio and video from a single source and VLC clients plays them perfectly fine but NOT synced. I experimented many things to get AV sync working but no luck yet. It will be great help if someone can provide insight to internal working of VLC by answering following questions.

1. In RTP packets sent by server, does RTP timestamp have to be samplilng instance only? can it be presentation time? if yes, what unit milliSecond/microSecond?

2. If two stream are from the same source (and no RTCP from server), does VLC client try to sync these streams using its internal clock? OR does it adjust its internal clock based on the timestamp received in RTP packets? or it just plays the packets as and when it (VLC) receives them?

3. I just implemented RTCP mechanism for AV sync. I see fairly good AV sync. However, VLC client drops many audio and some video packets with errors "PTS out of range" or "late picture". So my question is - how it uses the RTP and NTP timestamps in RTCP packets from each of the audio and video streams to match with corresponding RTP timestamps in RTP packets?

Thank you very much.

Rémi Denis-Courmont
Developer
Developer
Posts: 15335
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: RTP timestamp, role of RTCP for AV sync with VLC client

Postby Rémi Denis-Courmont » 19 Sep 2009 10:54

1. In RTP packets sent by server, does RTP timestamp have to be samplilng instance only? can it be presentation time? if yes, what unit milliSecond/microSecond?
The timestamp frequency is specified in the SDP, and the meaning of the timestamp is specified in the RTP payload format definition of the payload type (typically it is the PTS).
2. If two stream are from the same source (and no RTCP from server), does VLC client try to sync these streams using its internal clock? OR does it adjust its internal clock based on the timestamp received in RTP packets? or it just plays the packets as and when it (VLC) receives them?
This is mathematically impossible. The streams will be synched with an arbitrary unspecified offset, i.e. they won't be synched.
3. I just implemented RTCP mechanism for AV sync. I see fairly good AV sync. However, VLC client drops many audio and some video packets with errors "PTS out of range" or "late picture". So my question is - how it uses the RTP and NTP timestamps in RTCP packets from each of the audio and video streams to match with corresponding RTP timestamps in RTP packets?
This is clearly specified in RFC3550.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 126 guests