【问题标题】:Problems creating an RTP stream with JMF使用 JMF 创建 RTP 流时出现问题
【发布时间】:2010-05-12 19:23:22
【问题描述】:

我正处于一个项目的早期阶段,该项目需要使用 RTP 广播从 MediaLocation 创建的 DataStream。我正在关注一些示例代码,这些代码目前在 rptManager.initalize(localAddress) 上失败,并出现错误“无法打开本地数据端口:xxxx”,具体来说:

Exception in thread "main" javax.media.rtp.InvalidSessionAddressException: Can't open local data port: 34586
at com.sun.media.rtp.RTPSessionMgr.initialize(RTPSessionMgr.java:2688)
at com.sun.media.rtp.RTPSessionMgr.initialize(RTPSessionMgr.java:2515)
at RTPBroadcast.main(RTPBroadcast.java:20)

我正在 Lucid 上开发,我的防火墙已完全禁用。老实说,我有点难过。我的代码如下:

// http://jcs.mobile-utopia.com/jcs/26201_RTPManager.java
public class RTPBroadcast { 
    public static void main (String[] args) throws InvalidSessionAddressException, IOException, UnsupportedFormatException {

        RTPManager rtpManager = RTPManager.newInstance();
        SessionAddress localAddress = new SessionAddress();

        rtpManager.initialize(localAddress);

        InetAddress ipAddress = InetAddress.getByName("192.168.1.5");

        SessionAddress remoteAddress = new SessionAddress(ipAddress, 3000);

        rtpManager.addTarget(remoteAddress);

        DataSource dataOutput = new ScreenSource();

        SendStream sendStream = rtpManager.createSendStream( dataOutput, 1);
        sendStream.start();
    }
}

关于什么可能导致问题的任何想法?

【问题讨论】:

    标签: java jmf fmj


    【解决方案1】:

    如果您的问题目前没有解决,请尝试查看 jlibrtp 而不是 jmf。

    【讨论】:

      猜你喜欢
      • 2021-09-27
      • 2011-12-04
      • 2011-02-10
      • 2017-06-04
      • 1970-01-01
      • 2017-04-11
      • 2013-04-13
      • 2020-11-13
      • 2016-05-08
      相关资源
      最近更新 更多