# Strange RTP packet from DirectTransport Consume

**URL:** <https://mediasoup.discourse.group/t/strange-rtp-packet-from-directtransport-consume/2935>\
**Category:** Integration\
**Created:** [June 16, 2021, 6:37am UTC](https://mediasoup.discourse.group/t/strange-rtp-packet-from-directtransport-consume/2935 "2021-06-16T06:37:55Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Normando](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/normando/32/1046_2.png) [@Normando](https://mediasoup.discourse.group/u/Normando)\
**Post date:** [June 16, 2021, 6:37am UTC](https://mediasoup.discourse.group/t/strange-rtp-packet-from-directtransport-consume/2935/1 "2021-06-16T06:37:55Z")

</div>

Hello to all community, and specially developers for this great product!

I am trying to consume RTP packets from directTransport.consume and I send RTP packets from there to external ffmpeg. When I listen the audio, I note a little “tick” every 4 ~ 5 seconds. I think tha ffmpeg was caused this issue. To confirm I used gstreamer, and the same issue. Also I change DirectTransport to PlainTransport to connect to external UDP port, and also get the same issue (audio ticks).

Well, after that I tried to debug those RTP packets comes from Direct/Plain Transport. After that I found the “tick”. This is caused by three RTP packets comes every 5 seconds, and with the help of another superb software ([rtp.js](https://versatica.github.io/rtp.js)) I can see these.

Sorry for the long, but this can show those strange packets that I don’t know what means. When these “strange” packets comes, there is no payload, and I log the raw packet instead of inexisten payload.

```auto
Extensions: [Map Entries] { [1, <Buffer 30>], [10, <Buffer b8>] }
Padding: 0
Seq: 506
OneExt: true
TwoExt false
isRtp: true
isRtcp: false
Payload: 7833396aa75ea80f716cfba07f00c4b421026d33d3fe4a7354e11f41466abeb50c5605fcca74daaeb8c02659fff7b256e3c60c197f2e9e9049e03fbde991dd5f
---------------------
Extensions: [Map Entries] { [1, <Buffer 30>], [10, <Buffer b8>] }
Padding: 0
Seq: 507
OneExt: true
TwoExt false
isRtp: true
isRtcp: false
Payload: 7832cdd2b8614c653ae5a8b4b80c8383edf962934fce6dceb5fdadddad2e517117456252fe52d31923c9c5492e30db3927aa6335b334d0765b98d51671651b265056ddb6
---------------------
Extensions: [Map Entries] { [1, <Buffer 30>], [10, <Buffer b8>] }
Padding: 0
Seq: 508
OneExt: true
TwoExt false
isRtp: true
isRtcp: false
Payload: 78315b1af77755162e5590003434563d9cffdf2147833965ceae5acf09c7b6ff38c7cb74966db7db72c2abf03dc71c43bf676cda655dd30fa86d959e3611d8b0670e1b92f5ff0164
---------------------
Extensions: [Map Entries] { [1, <Buffer 30>], [10, <Buffer b8>] }
Padding: 0
Seq: 509
OneExt: true
TwoExt false
isRtp: true
isRtcp: false
Payload: 7833396aaf3f1ec17e2d44640db37e504465bf1b8ae5d99cf0c3d9b80290bf35f918e34e42f99f70668178ff9ca0bbcc22a2cf9fcb41d4ab67cecf6c9479b63c64
---------------------
Extensions: [Map Entries] { [1, <Buffer 30>], [10, <Buffer b8>] }
Padding: 0
Seq: 510
OneExt: true
TwoExt false
isRtp: true
isRtcp: false
Payload: 78330172da90829f5921234d8cc0a48992d4e8d45eba44bf100914dbe355b0eee8db52801126ec38e7c63fe1f6fb4ad1b154bce452fe07cf1b2221f67ce62178486d
---------------------
Extensions: [Map Entries] { [1, <Buffer 30>] }
Padding: 50
Seq: 512
OneExt: true
TwoExt false
isRtp: true
isRtcp: false
Raw Packet: b06f02009f24af461333e07fbede00031030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000032
---------------------
Extensions: [Map Entries] { [1, <Buffer 30>], [10, <Buffer b8>] }
Padding: 0
Seq: 511
OneExt: true
TwoExt false
isRtp: true
isRtcp: false
Payload: 78330720a2726461c9449089520e053dc95490ef4f1a6fa5505c05a6c1f801d994ffce4e575c361415deae6dc41636c322fc349e2c9a7cf833c5ca478844a1ee
---------------------
Extensions: [Map Entries] { [1, <Buffer 30>] }
Padding: 50
Seq: 513
OneExt: true
TwoExt false
isRtp: true
isRtcp: false
Raw Packet: b06f02019f24af461333e07fbede00031030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000032
---------------------
Extensions: [Map Entries] { [1, <Buffer 30>] }
Padding: 50
Seq: 514
OneExt: true
TwoExt false
isRtp: true
isRtcp: false
Raw Packet: b06f02029f24af461333e07fbede00031030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000032
---------------------
Extensions: [Map Entries] { [1, <Buffer 30>], [10, <Buffer b8>] }
Padding: 0
Seq: 515
OneExt: true
TwoExt false
isRtp: true
isRtcp: false
Payload: 7832893bf792e208a025ae9534913bc47ebbb8e155b1bbbf25e3a9c5338c8c087fec37288ed9cfc1f695092871bba0fc52ac280b4dd0bc0568cfa7c9b3cbfef57fad
---------------------
Extensions: [Map Entries] { [1, <Buffer 30>], [10, <Buffer b7>] }
Padding: 0
Seq: 516
OneExt: true
TwoExt false
isRtp: true
isRtcp: false
Payload: 783118b3253f4aff93050e18a5643e65afd89a4c3af85cb473680e2a2c529cd7fe1864440fd1279938e8aed28840d34ee11e127830415e7e9b7181027fde3b397810074ab4315674
---------------------
Extensions: [Map Entries] { [1, <Buffer 30>], [10, <Buffer b8>] }
Padding: 0
Seq: 517
OneExt: true
TwoExt false
isRtp: true
isRtcp: false
Payload: 783118b30334fb7d75760b183fdd163b0771b43cb5fd2c145abd2b5b787ff43adb531dbc0c67fe98ef5c019545876aa8c0429d32f5ed0842c3ee3b8fc388023d647ccc3a64d95f
-

```

The packets are marked with sequence numbers 512, 513, and 514

Please note in the mentioned packets, they sequence numbers change the order. Exactly the same pattern repeats every 4 o 5 seconds.

So, the question is, what means these packets?

Using mediasoup V 3.7.15.

Regards

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [June 16, 2021, 7:23am UTC](https://mediasoup.discourse.group/t/strange-rtp-packet-from-directtransport-consume/2935/2 "2021-06-16T07:23:34Z")

</div>

Verify if the ssrc of those packets is 1234.

---

<div class="post-metadata">

**Author:** ![Normando](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/normando/32/1046_2.png) [@Normando](https://mediasoup.discourse.group/u/Normando)\
**Post date:** [June 16, 2021, 3:48pm UTC](https://mediasoup.discourse.group/t/strange-rtp-packet-from-directtransport-consume/2935/3 "2021-06-16T15:48:14Z")

</div>

Hello Iñaki. Thanks for the fast reply.

No, it is no 1234. It is the same as normal packets.

Look at the 50 padding:

```auto
Padding: 0
SSRC: 115947813
---------------------
Padding: 0
SSRC: 115947813
---------------------
Padding: 0
SSRC: 115947813
---------------------
Padding: 50
SSRC: 115947813
---------------------
Padding: 0
SSRC: 115947813
---------------------
Padding: 50
SSRC: 115947813
---------------------
Padding: 50
SSRC: 115947813
---------------------
Padding: 0
SSRC: 115947813
---------------------
Padding: 0
SSRC: 115947813

```

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [June 16, 2021, 5:30pm UTC](https://mediasoup.discourse.group/t/strange-rtp-packet-from-directtransport-consume/2935/4 "2021-06-16T17:30:54Z")

</div>

It would be nice if you used `rtpPacket.dump()` method which prints payload size as well.

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [June 16, 2021, 5:31pm UTC](https://mediasoup.discourse.group/t/strange-rtp-packet-from-directtransport-consume/2935/5 "2021-06-16T17:31:21Z")

</div>

Yes, sorry, it’s private API, but you can use it. It does this:

```auto
	dump(): any
	{
		const extensions: { [key: number]: { length: number } } = {};

		for (const [id, value] of this.extensions)
		{
			extensions[id] = { length: value.length };
		}

		return {
			version : this.getVersion(),
			payloadType : this.getPayloadType(),
			sequenceNumber : this.getSequenceNumber(),
			timestamp : this.getTimestamp(),
			ssrc : this.getSsrc(),
			csrc : this.csrc,
			marker : this.getMarker(),
			headerExtensionId : this.headerExtensionId,
			extensions : extensions,
			payloadLength : this.payload.length,
			padding : this.padding
		};
	}

```

---

<div class="post-metadata">

**Author:** ![Normando](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/normando/32/1046_2.png) [@Normando](https://mediasoup.discourse.group/u/Normando)\
**Post date:** [June 16, 2021, 5:49pm UTC](https://mediasoup.discourse.group/t/strange-rtp-packet-from-directtransport-consume/2935/6 "2021-06-16T17:49:02Z")

</div>

Excellent Iñaki. `rtpPacket.dump()` output:

```auto
{
  version: 2,
  payloadType: 111,
  sequenceNumber: 508,
  timestamp: 900037215,
  ssrc: 578680429,
  csrc: [],
  marker: false,
  headerExtensionId: 48862,
  extensions: { '1': { length: 1 }, '10': { length: 1 } },
  payloadLength: 73,
  padding: 0
}
---------------------
{
  version: 2,
  payloadType: 111,
  sequenceNumber: 510,
  timestamp: 900038175,
  ssrc: 578680429,
  csrc: [],
  marker: false,
  headerExtensionId: 48862,
  extensions: { '1': { length: 1 } },
  payloadLength: 0,
  padding: 50
}
---------------------
{
  version: 2,
  payloadType: 111,
  sequenceNumber: 509,
  timestamp: 900038175,
  ssrc: 578680429,
  csrc: [],
  marker: false,
  headerExtensionId: 48862,
  extensions: { '1': { length: 1 }, '10': { length: 1 } },
  payloadLength: 71,
  padding: 0
}
---------------------
{
  version: 2,
  payloadType: 111,
  sequenceNumber: 511,
  timestamp: 900039135,
  ssrc: 578680429,
  csrc: [],
  marker: false,
  headerExtensionId: 48862,
  extensions: { '1': { length: 1 }, '10': { length: 1 } },
  payloadLength: 67,
  padding: 0
}
---------------------
{
  version: 2,
  payloadType: 111,
  sequenceNumber: 512,
  timestamp: 900039135,
  ssrc: 578680429,
  csrc: [],
  marker: false,
  headerExtensionId: 48862,
  extensions: { '1': { length: 1 } },
  payloadLength: 0,
  padding: 50
}
---------------------
{
  version: 2,
  payloadType: 111,
  sequenceNumber: 513,
  timestamp: 900039135,
  ssrc: 578680429,
  csrc: [],
  marker: false,
  headerExtensionId: 48862,
  extensions: { '1': { length: 1 } },
  payloadLength: 0,
  padding: 50
}
---------------------
{
  version: 2,
  payloadType: 111,
  sequenceNumber: 514,
  timestamp: 900040095,
  ssrc: 578680429,
  csrc: [],
  marker: false,
  headerExtensionId: 48862,
  extensions: { '1': { length: 1 }, '10': { length: 1 } },
  payloadLength: 67,
  padding: 0
}
---------------------
{
  version: 2,
  payloadType: 111,
  sequenceNumber: 515,
  timestamp: 900041055,
  ssrc: 578680429,
  csrc: [],
  marker: false,
  headerExtensionId: 48862,
  extensions: { '1': { length: 1 }, '10': { length: 1 } },
  payloadLength: 63,
  padding: 0
}
---------------------

```

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [June 16, 2021, 8:21pm UTC](https://mediasoup.discourse.group/t/strange-rtp-packet-from-directtransport-consume/2935/7 "2021-06-16T20:21:27Z")

</div>

Which are the suspicious packets there? those with `payloadLength: 0`?

---

<div class="post-metadata">

**Author:** ![Normando](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/normando/32/1046_2.png) [@Normando](https://mediasoup.discourse.group/u/Normando)\
**Post date:** [June 16, 2021, 8:28pm UTC](https://mediasoup.discourse.group/t/strange-rtp-packet-from-directtransport-consume/2935/8 "2021-06-16T20:28:37Z")

</div>

Yes (for me). These causes a tic in audio when I decoded. I asked because I don’t know why happens. Also sequence are not ordered.  
Of course, I fix this checking payload length, and decoded only when it is \> 0.

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [June 16, 2021, 8:36pm UTC](https://mediasoup.discourse.group/t/strange-rtp-packet-from-directtransport-consume/2935/9 "2021-06-16T20:36:08Z")

</div>

> [@Normando](#):
>
> Also sequence are not ordered.

This is how real RTP transmission is in real networks, no real issue here.

> [@Normando](#):
>
> These causes a tic in audio when I decoded

Those are generated by the producer endpoint, let’s say Chrome. mediasoup does not generate those packets at all. They may be generated by Chrome as a way to test the uplink capacity.

The thing here is: those have payload length 0, so a proper receiving endpoint should be able to discard them (in the sense that there is no real codec payload to process). However, from the point of view of RTP protocol, it’s perfectly fine to send those packets.

---

<div class="post-metadata">

**Author:** ![Normando](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/normando/32/1046_2.png) [@Normando](https://mediasoup.discourse.group/u/Normando)\
**Post date:** [June 16, 2021, 8:53pm UTC](https://mediasoup.discourse.group/t/strange-rtp-packet-from-directtransport-consume/2935/10 "2021-06-16T20:53:53Z")

</div>

Thank you so much Iñaky for the clarification!! 👌

---

<div class="post-metadata">

**Author:** ![jbaudanza](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/jbaudanza/32/1996_2.png) [@jbaudanza](https://mediasoup.discourse.group/u/jbaudanza)\
**Post date:** [June 17, 2021, 5:00am UTC](https://mediasoup.discourse.group/t/strange-rtp-packet-from-directtransport-consume/2935/11 "2021-06-17T05:00:37Z")

</div>

I had a similar problem with ffmpeg, as documented in this thread:

> [@Help debugging duplicate RTP timestamps from WebRTC](https://mediasoup.discourse.group/t/help-debugging-duplicate-rtp-timestamps-from-webrtc/2643):
>
> I’m passing an Opus RTP stream from WebRTC M89 on Android through MediaSoup to an instance of ffmpeg. Every 5 seconds, my ffmpeg process is receiving a set of three RTP packets with duplicate RTP timestamps, but sequential sequence numbers. The first packet contains audio data, the last two are empty, except for a header extension (RTCP Source Description Items). I’m able to verify this with Wireshark and debug code in ffmpeg. This streams looks something like this: Sequence timestamp …

I fixed it on the ffmpeg side by just ignoring any packet with a length of 0. I’m using the C interface to ffmpeg, I’m not sure if that’s possible with the command line.

This only started becoming a problem with recent version of libwebrtc (around M89 I think)

---

<div class="post-metadata">

**Author:** ![Normando](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/normando/32/1046_2.png) [@Normando](https://mediasoup.discourse.group/u/Normando)\
**Post date:** [June 17, 2021, 5:03am UTC](https://mediasoup.discourse.group/t/strange-rtp-packet-from-directtransport-consume/2935/12 "2021-06-17T05:03:05Z")

</div>

Yes!!! Five minutes ago I see your post. There is same or similar issue, endpoints issues (Chrome, etc) as Iñaky said. After that I ignored empty payloads and runs like a charm.

Thank you
