Page 1 of 1

How to send RTP-stream-packets in correct intervals?

Posted: 20 Jul 2012 21:53
by andersbranderud
I am developing an application, in which a RTP-stream streamed by VLC (the data is a mp4 played at regular speed) and recorded with Wireshark is sent from a sender to a receiver. The sender FEC-encodes (using the library OpenFEC) the data and the receiver FEC-decodes the data and sents the RTP-packets to port 5004. In each FEC-unit there is e.g. 250 RTP-packets.

At the receiver-side, when an whole FEC-unit is received, it is FEC-decoded; and all of the RTP-packets in the FEC-unit are put on a playback-queue.
The playback-queue runs in a separate thread and is sending packets in intervals calculated as:

Code: Select all

( timestamp of next packet - timestamp of current packet) * factor
The packets are sent in their correct order to VLC listening at port 5004 (rtp://127.0.0.1:5004).

However, the stream is not playing as smooth as it does when it is sent by VLC to VLC listening at port 5004 (rtp://127.0.0.1:5004).
My guess is that the determinitive factor is in which interval the packets are sent.

Based on the timestamp and other relevant parameters, how do I calculate the interval I should wait between the transmission the packets?

Re: How to send RTP-stream-packets in correct intervals?

Posted: 21 Jul 2012 11:01
by RĂ©mi Denis-Courmont
The long term average bandwidth should be nominal. Otherwise VLC will have to upsample or downsample to adjust the inconsistent speed.