使用 JMF 创建 RTP 流时出现问题
我正处于一个项目的早期阶段,需要使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的问题目前尚未解决,请尝试查看 jlibrtp 而不是jmf。
If your problem currently isn't solved, try to look at jlibrtp instead of jmf.