为 RTP 流提供 SDP 格式的描述

Provide description in SDP format for RTP stream

我正在使用 LibVLC 库 2.1.12 将 RTP 流呈现到我的 Android 设备。

我正在使用以下 SDP 描述请求 RTP/AV 数据包传送到给定的 IP 地址和端口(192.168.0.33,端口:65446)

v=0
o=- 1537446049254 1537446050285 IN IP4 192.168.0.33
s=-
c=IN IP4 192.168.0.33
t=0 0
a=recvonly
m=video 65446 RTP/AVP 97
a=rtpmap:97 H264/90000
a=fmtp:97 profile-level-id=42e01e;packetization-mode=1

在我的服务器 (android) 上,我可以看到传入的 RTP 数据包。

代码如下:

private void preparePlayer(ParcelFileDescriptor pfd, VideoStream stream) {
    Media media = new Media(videoView.getVlc(), Uri.parse("rtp://@:" + stream.getLocalPort()));
    media.addOption(":network-caching=5000");
    media.addOption(":clock-jitter=0");
    media.addOption(":clock-synchro=0");
    media.addOption(":codec=all");
    media.addOption(":sout-rtp-description=" + stream.getReceiver().getSessionDescription());
}

当我尝试使用流提供 LibVLC 时,我在日志中收到以下信息:

core input: `rtp://@:65446' successfully opened
rtp demux: unspecified payload format (type 97)
rtp demux: A valid SDP is needed to parse this RTP stream.
core demux: SDP required
core demux: A description in SDP format is required to receive the RTP 
stream. Note that rtp:// URIs cannot work with dynamic RTP payload 
format (97).
rtp demux: added RTP source (58a1ef57)
rtp demux: unknown payload (97)
  1. 如何向 LibVLC(Android)提供 SDP 格式的描述?
  2. 有没有其他方法可以将原始流数据包提供给 LibVLC VideoView?

--sout-rtp-sdp=<string>

更多信息请访问 https://wiki.videolan.org/VLC_command-line_help/

I'm using LibVLC library 2.1.12

您使用的是哪个包装器?我强烈建议你升级到 libvlc 3+