【问题标题】:Provide description in SDP format for RTP stream为 RTP 流提供 SDP 格式的描述
【发布时间】:2018-09-20 12:35:14
【问题描述】:

我正在使用 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. 如何将 SDP 格式的描述提供给 LibVLC(在 Android 上)?
  2. 还有其他方法可以向 LibVLC VideoView 提供原始流数据包吗?

【问题讨论】:

    标签: android vlc libvlc


    【解决方案1】:

    --sout-rtp-sdp=<string>

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

    我正在使用 LibVLC 库 2.1.12

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

    【讨论】:

      猜你喜欢
      • 2017-09-22
      • 2017-08-11
      • 2013-12-30
      • 1970-01-01
      • 2017-08-21
      • 2022-01-18
      • 1970-01-01
      • 2014-02-03
      相关资源
      最近更新 更多