Problems creating an RTP stream with JMF

I am in the very early stages of a project that requires broadcasting using RTP DataStream

created with MediaLocation

. I am following a code example that does not currently work on rptManager.initalize(localAddress)

with the error " Cannot 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 am working on Lucid and my firewall is completely disabled. I'm a little dumb, to be honest. My code looks like this:

// 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 might be causing the problem?

+2


a source to share


1 answer


If your problem is not currently resolved, try looking at jlibrtp instead of jmf.



0


a source







All Articles