使用 JMF 创建 RTP 流时出现问题

发布于 2024-09-01 11:55:17 字数 1360 浏览 5 评论 0原文

我正处于一个项目的早期阶段,需要使用 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();
    }
}

关于可能导致问题的原因有什么想法吗?

I'm at the very early stages of a project requiring the broadcasting, using RTP, of a DataStream created from a MediaLocation. I'm following some example code which currently failingin on the rptManager.initalize(localAddress) with the error "Can't open local data port: xxxx", specifically:

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)

I'm developing on Lucid and my firewall is completely disabled. I'm a little stumped to be honest. My code is as follows:

// 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();
    }
}

Any ideas on what could be causing the problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

等你爱我 2024-09-08 11:55:17

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

If your problem currently isn't solved, try to look at jlibrtp instead of jmf.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文