I used live555 library to create RTSP client which get video and audio stream. It get data without any problem. But in most cases after few seconds of receiving audio (AAC) data I get timestamp that is smaller than previous. It is not concern to hasBeenSynchronizedUsingRTCP() method because I use timestamps only when it returns true. And server send timestamps in constantly increase order (I used different servers and got the same behaviour).
I decide to change my server code and insert into AAC encoded data timestamp that is sent by server. And here what I got:
server: 1690994388:947870, client: 1690994390:205081
server: 1690994388:971090, client: 1690994390:228300
server: 1690994388:994310, client: 1690994388:994317 <- What is that?
So, I have two questions:
- Why client timestamps differ from server timestamp?
- What to do with such non monotonic timestamps? Is it right behaviour from the RTSP point of view? And how to work around it if I want to save audio data to file (it requires monotonic timestamps)? Of cource, I can, for example, ignore it or calculate my own timestamp in such cases but such solutions look like dirty workarounds.