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

This forum is about all development around libVLC.
andersbranderud
Blank Cone
Blank Cone
Posts: 10
Joined: 26 Mar 2012 20:54

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

Postby andersbranderud » 20 Jul 2012 21:53

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?
Anders Branderud
Master's student, Computer science
www.abitsolutions.org
www.proofexistencegod.com

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

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

Postby Rémi Denis-Courmont » 21 Jul 2012 11:01

The long term average bandwidth should be nominal. Otherwise VLC will have to upsample or downsample to adjust the inconsistent speed.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 28 guests