Can't get libvlc to play sdp file

745 Views Asked by At

I have the following sdp file which my program generates:

v=0
c=IN IP4 192.168.0.20
t=0 0
m=audio 1235 RTP/AVP 101
a=recvonly
a=rtpmap:101 speex/16000/1
a=fmtp:101 media=(string)audio, clock-rate=(int)16000, encoding-name=(string)SPEEX, encoding-params=(string)1, payload=(int)101, ssrc=(uint)3395200432, clock-base=(uint)1773032113, seqnum-base=(uint)12387
a=maxptime:20
m=video 1234 RTP/AVP 97
a=recvonly
a=rtpmap:97 H264/90000

I am certain that my server is streaming to those ports with those payload types and caps. However, vlc does not pick up either the video or the audio.

Yet if you reverse the video and audio, like so:

v=0
c=IN IP4 192.168.0.20
t=0 0
m=video 1234 RTP/AVP 97
a=recvonly
a=rtpmap:97 H264/90000
m=audio 1235 RTP/AVP 101
a=recvonly
a=rtpmap:101 speex/16000/1
a=fmtp:101 media=(string)audio, clock-rate=(int)16000, encoding-name=(string)SPEEX, encoding-params=(string)1, payload=(int)101, ssrc=(uint)3395200432, clock-base=(uint)1773032113, seqnum-base=(uint)12387
a=maxptime:20

, I pick up the video but still no audio.

Any ideas?

2

There are 2 best solutions below

0
On

Ok, so for those of you googling this. For some reason, you can only receive media on even port numbers in vlc.

1
On

So, randomly stumbling on this... a heads up.

This is because the even ports are typically used for RTP and odd for RTCP. VLC uses Live555 for its backend RTP/RTCP parsing and I'm pretty sure the even/odd thing is a hardcoded situation.