RTP Cannot open local data port

Hello,
I'm about to learn JMF. So I tried the example code from the sun JMF documentation(example10-1; code is appended).
The code compiles without errors but when I run it, I alway get the following error:
streams is [Lcom.sun.media.multiplexer.RawBufferMux$RawBufferSourceStream;@b9b538 : 1
sink: setOutputLocator rtp://192.168.0.6:49150/audio/1
java.io.IOException: Can't open local data port: 4800
        at com.sun.media.datasink.rtp.Handler.open(Handler.java:139)
        at Send.<init>(Send.java:60)
        at Send.main(Send.java:71)
What does that mean and what causes that kind of exception?
Thanks in advance.
MfG
Michael
****Code starts here****
class Send {
   public Send() {
      AudioFormat format = new AudioFormat(AudioFormat.LINEAR, 8000, 16, 1);
      Vector devices = CaptureDeviceManager.getDeviceList(null);
      System.out.println("DEBUG: CaptureDeviceManager returned "  + devices.size() + " devices");
      CaptureDeviceInfo di = null;
      Processor p = null;
      if(devices.size() > 0)
      di = (CaptureDeviceInfo) devices.elementAt(0);
      else
      System.exit(-1);
      System.out.println("Found: " + di.toString());
      try {
      p = Manager.createProcessor(di.getLocator());
      } catch(Exception e) {
     e.printStackTrace();
     System.exit(-1);
p.configure();
TrackControl tracks[] = p.getTrackControls();
p.setContentDescriptor(new ContentDescriptor(ContentDescriptor.RAW));
boolean encodingOk=false;
for(int i=0; i < tracks.length; i++) {
     if(!encodingOk && tracks[i] instanceof FormatControl) {
     if( ( (FormatControl)tracks[i] ).setFormat(new AudioFormat(AudioFormat.GSM_RTP, 8000, 16, 1))==null )
     tracks.setEnabled(false);
     encodingOk = true;
     else
     tracks[i].setEnabled(false);
} //for
if(encodingOk) {
     p.realize();
     DataSource source = null;
     try { Thread.sleep(1000); } catch(InterruptedException e){}
     try {
     source = p.getDataOutput();
     } catch(NotRealizedError e) {
     System.out.println("*** ERROR: Cannot realize");
     //System.exit(-1);
     try {
     String url = "rtp://192.168.0.6:49150/audio/1";
     System.out.println(url);
     MediaLocator m = new MediaLocator(url);
     DataSink sink = Manager.createDataSink(source, m);
     sink.open();
     sink.start();
     } catch(Exception e) {
     System.out.println("*** ERROR: ");
     e.printStackTrace();
     System.exit(-1);
} // if
public static void main(String[] args) {
new Send();

Hello,
I tried to change the port number to 22222, 66666 and 49150. With the same effekt. I found out that when I run the program for the first time after a reboot I get these errors:
javax.media.NotConfiguredError: getTrackControls cannot be called before configured
at com.sun.media.ProcessEngine.getTrackControls(ProcessEngine.java:285)
at com.sun.media.MediaProcessor.getTrackControls(MediaProcessor.java:107)
at Send.<init>(Send.java:29)
at Send.main(Send.java:71)
Exception in thread "main" javax.media.NotConfiguredError: getTrackControls cannot be called before configured
at com.sun.media.ProcessEngine.getTrackControls(ProcessEngine.java:285)
at com.sun.media.MediaProcessor.getTrackControls(MediaProcessor.java:107)
at Send.<init>(Send.java:29)
at Send.main(Send.java:71)
I have to quit the program with Ctrl-c. The next time I run it I get the IOException as described above :( .
MfG
Michael

Similar Messages

  • Cannot create the RTP Session: Can't open local data port

    Hi,
    I'm trying to connect to two webcams simultaneously in the order:
    MediaLocator inputLocator1 = new MediaLocator("rtp://hostname1:8000/video");
    MediaLocator inputLocator2 = new MediaLocator("rtp://hostname2:8000/video");
    But I get this during the second connection:
    Cannot create the RTP Session: Can't open local data port: 8000
    And I can't see the video from hostname2.
    I did a check via netstat, and it seems that both mycomputer is receiving the video from both hostname1 & hostname2:
    TCP mycomputer:3236 hostname1:8000 ESTABLISHED
    TCP mycomputer:3264 hostname2:8000 ESTABLISHED
    TCP connections to both host were established!! But why can't I see the video of hostname2???? I've thought of 2 possible reasons why I cannot see the video of hostname2:
    1. Is this set of local data port maintained by Java? i.e It's not the same as the TCP port 8000 that I see in mycomputer's netstat. If yes, Java has assigned its local data port 8000 to hostname1, so it fails to reassign that port 8000 to hostname2 while hostname1 is still connected. Any other way to fix this apart from changing the portnumber of hostname2?
    2. It has to do with the custom.jar? I've read in an article somewhere in the forum that the custom.jar has to be customized (using JFMCustomizer) to receive video from two hosts with the same portnumber. Can someone elaborate the necessary boxes to check in the JFMCustomizer?
    Thanks much,
    Rach

    After all this while, I finally figured out the problem. In my code, I use MediaLocator to code the receiver and the transmitter. E.g.:
    MediaLocator inputLocator1 = new MediaLocator("rtp://hostname1:8000/video");
    player1 = Manager.createPlayer(inputLocator1)
    MediaLocator inputLocator2 = new MediaLocator("rtp://hostname2:8000/video");
    player2 = Manager.createPlayer(inputLocator2)
    Manager would complain "Cannot create the RTP Session: Can't open local data port: 8000" because port 8000 is already used up by player1, i.e.:
    mycomputer:8000 maps to hostname1:8000
    mycomputer:8000 cannot re-map to hostname2:8000
    To work around this, I'll need to use SessionAddress. SessionAddress provides the flexibility to do an independent local port mapping, e.g.:
    mycomputer:5000 maps to hostname1:8000
    mycomputer:5002 maps to hostname2:8000
    Rach

  • Error : Can't open local data port

    Hello:
    I�d like present this problem to yours:
    I am executing two files Client/Server into my own PC, using two DOS console different, this one to Client an another to Server.
    I got this error:
    Output of the CLient (DOS Console of the client)
    C:\RUN\EX14>java AVReceive2 1.1.9.147/45300
    - Open RTP session for: addr: 1.1.9.147 port: 45300 ttl: 1
    - Waiting for RTP data to arrive...
    - Waiting for RTP data to arrive...
    - A new participant had just joined: mpalacios@mpv
    - Waiting for RTP data to arrive...
    - Waiting for RTP data to arrive...
    Output of the Server (DOS Console of the Server)
    C:\RUN\EX14>java AVTransmit2 file:/c:/run/format/au/drip.au 1.1.9.147 45300
    Track 0 is set to transmit as:
    ULAW/rtp, 8000.0 Hz, 8-bit, Mono, FrameSize=8 bits
    Error : Can't open local data port: 45300
    Well, 1.1.9.147 is the IP address of my PC.
    So, What�s the problem?
    If you need of the rest of code, please say me.
    Thanks.
    Angel.

    Well, I am agree with you, but I have this code in the Transmit File (Server):
    * Use the RTPManager API to create sessions for each media track of the processor.
    private String createTransmitter() {
         // Cheated. Should have checked the type.
         PushBufferDataSource pbds = (PushBufferDataSource)dataOutput;
         PushBufferStream pbss[] = pbds.getStreams();
         rtpMgrs = new RTPManager[pbss.length];
         SessionAddress localAddr, destAddr;
         InetAddress ipAddr;
         SendStream sendStream;
         int port;
         SourceDescription srcDesList[];
         for (int i = 0; i < pbss.length; i++) {
         try {
              rtpMgrs[i] = RTPManager.newInstance();     
    //The local session address will be created on the
    // same port as the the target port. This is necessary
    // if you use AVTransmit2 in conjunction with JMStudio.
    // JMStudio assumes - in a unicast session - that the
    // transmitter transmits from the same port it is receiving
    // on and sends RTCP Receiver Reports back to this port of
    // the transmitting host.
              port = portBase + 2*i;
              ipAddr = InetAddress.getByName(ipAddress);
              localAddr = new SessionAddress( InetAddress.getLocalHost(),
                                       port);
              destAddr = new SessionAddress( ipAddr,
                                  port);
              rtpMgrs.initialize( localAddr);
              rtpMgrs[i].addTarget( destAddr);
              System.err.println( "Created RTP session: " + ipAddress + " " + port);
              sendStream = rtpMgrs[i].createSendStream(dataOutput, i);          
              sendStream.start();
         } catch (Exception e) {
              return e.getMessage();
         return null;
    When I use this Files (Client/Server), between diffrent PCs into LAN, eg, Client (One PC) and Server (Another PC), but I used:
    This One PC: (IP Address PC = 1.1.9.150)
    C:\run\ex14\java AVTransmit2 file:/c:/run/format/audrip.au 1.1.9.147 45300
    Another PC:(IP Address PC = 1.1.9.147)
    C:\run\ex14\java AVReceive2 1.1.9.147/45300
    That�s work right!
    So, what�s happen?

  • Help me ! "can not open local data port"

    I have successfully ended the previous transmit,but wen I began a new transmit,it failed. It printed "can't open local data port ",why?
    Is it telling that the port is still in use???
    And how can I solve this problem?
    Anyone help me?
    Thanks very much,
    yyc

    Hi,
    this problem occurs when You try to open the same port twice time, You can solve it by opening other port.

  • Cannot open local port whatever

    Hi,
    I've just downloaded AVTransmit2.java and AVReceive2.java from this website's JMF tutorial and am having a little trouble getting both classes to communicate.
    I have two Command Prompt windows open and I'm trying something like
    java AVTransmit2 file:C:\Whatever.au ipaddress(my machine's IP) 4000
    java AVReceive2 ipaddress(my machine's IP)/4000
    Whatever process I run first, the second process then tells me that it cannot open local port 4000, even though this is the port that both processes are meant to communicate on. Should I be using two different machines to communicate?
    Sorry to bug everybody with this problem, it's probably been posted before but some advice would be appreciated.
    Thanks

    Err, well, if they are both acting as servers, that's right. If you are running them on the same machine, then the first one takes port 4000 and the second one can't use it. I would think they would take 2 sets of IP and port, one for it's server port, one for it to connect to the other side...
    however, I wouldn't think that the transmitter app would be using a server port. You should be starting the receiver first.
    Or something else is using that port. Another receiver you started but didn't start, maybe? Some other app? It shouldn't matter what port you use. Try something else (4001, 4002, etc).

  • Customer cannot open all the ports - MAP 9.5

    Hi,
    Taking an inventory using MAP 9.5.
    Customer cannot open all the ports.
    135-139 and 445 are open.
    We are still not getting any success [just 3% inventory success]. Further only those machines are listed in WMI Success which are in the same subnet as the machine on which MAP is running.
    We are using Inventory Scenario>Windows computers and Discovery Methods >AD + Scan IP range.
    Is there any alternate method?
    Thanks.

    Try This...
    Close All Open Apps...  Perform a Reset... Try again...
    Reset  ( No Data will be Lost )
    Press and hold the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears. Release the Buttons.
    http://support.apple.com/kb/ht1430
    More Info Here...
    Troubleshooting applications purchased from the App Store

  • I cannot open a .dat file with adobe X1. Anyone have a solution, simple one please?

    I have adobe x1 but I cannot open an email .dat file. Any easy solutions out there please?

    As Test Screen Name states - Adobe Reader opens PDF files only.
    So - fire up Bing or some other web search engine and look for applications that open / process / work email DAT files.
    Be well...

  • Cannot open local shtml file

    I am trying to open a local shtml file (any file) but I get prompted: You have chosen to open (filename) which is a Hyper Text Markup Language from: Local file location. What should Firefox do with this file? Open with (browse), Save File, Do this automatically for files like this from now on. Before I upgraded my FF browser, I did not have this issue. What steps should I take to resolve it?

    Possibly related (unsolved) thread: [https://support.mozilla.org/en-US/questions/929923 How to prevent version 13.0 from following symlinks].

  • Cannot open local file

    I am making a flash project that will be sent out on a cd.  On this project I have menus we one can open up .pdf files and .mp4 files.  The .pdf files I have on a server and have linked to the file via catalyst.  The .mp4 files are larger so I want to have them on the cd along with the flash program.  I am aware that you cannot link to a file with Catalyst alone; I have read were you have to import into flash builder and then find this script...
    function button_clickHandler_12():void
    navigateToURL(
    new URLRequest( encodeURI(http://example.com)), "_self");}
    and replace it with...  
    function button_clickHandler_12():void
    navigateToURL(
    new URLRequest( encodeURI("/example.mp4")), "_self");}
    but I this is not working.  It will not open up the file and now I am not sure what to do.  Thanks for any and all help.

    use the flash security panel to put the folder that contains your swf's embedding html in the trusted zone:
    http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.htm l

  • Cannot open time & date prefs

    I noticed that along the top bar, my date was not reading the way it should. Instead of 5/4/2010, it reads 3 5 4 (with the spaces there). So, I right click on the time/date and select time & date preferences, and instead of opening, it takes me to a 'system preferences quit unexpectedly' where I have 3 choices, 'show details' which opens a long data screen, with a space for me to type in what I supposed happened, an 'ok' button, that just closes the error screen, and a 'reopen' button which takes me to the system prefs page, and if I click on the date/time icon there, it just takes me back to the **** quit unexpectedly screen. So? HELP!
    and thx

    Can you try going into Terminal: Applications > Utilities > Terminal and typing:
    date
    followed by the enter key (aka 'return' key) and letting us know what is returned? If you've installed any new software lately (including a system update), also try repairing disk permissions: Applications > Utilities > Disk Utility. Select your hard drive from the left and click on 'Repair disk permissions'.
    Good luck.

  • Open same UDP port from multiple applications

    I need to write to a local UDP port from one application, and read from that same UDP port from another application. (We're doing two-way communication, but use one port to send from A to B, and another port to send from B to A.) One of the applications is written in C++, and the C++ UDP open includes ReuseAddress in the socket options; there seems to be no way to specify this functionality from LV. Note that these applications are deployed to a Vista (64-bit) system with the LV Runtime (not the LV development environment).
    This used to work when we were using LV 8.5 (as long as we ran the LV application before running the C++ application), but when we updated to LV
    8.6.1 it no longer works -- the second application to be run cannot open the UDP port.
    Sometimes the applications are run on different machines, and then everything works fine. But sometimes we need to run both applications on the same machine, and then we encounter this problem. So whatever solution we come up with, we need to be able to make it work in both configurations (same machine, or different machines).

    I discovered that I can open any port (e.g., 0, and let it allocate a port for me), and then write to the port I want to write to with no problems, bypassing the problem.

  • How do I open the same ports on an Airport Extreme Base Station for multiple computers at the same time?

    As the title suggests...
    I have a mix of five Mac and PC's at home using an Airport Extreme Base Station as the router.   I need many ports opened on the AEBS for all of the computers- not just one computer.  (for example: three people want to play TF2 on Steam at the same time; each machine needs the correct ports open on the router).   Port forwarding  only allows me to forward a given port to a single IP, yet I need that port open for five differnt IP's, all at the same time. 
    How do I do that on an AEBS?
    In the same way, I have a small office of four iMacs using an old airport with the same exact issue.   I would like to be able to connect to all of them remotely with Apple Remote Desktop, but the port forwarding on the airport only allows a port to forward to a single IP.   I want to be able to tunnel into the office network and log onto any machine behind the Airport extreme... not just a single IP.    I currently have it set up where I can tunnel into the office from my house, I can find the one machine that the port forwarding has been assigned to, I can log on and everything is just fine... with one machine.    How do I open the firewall for the other machines? 
    TL,DR version:  How do you open ports on an Airport Extreme Base Station instead of forwarding ports?   Forwarding ports doesn't work for multiple IP's.  

    You can open a single or multiple ports to a single device or different ports to different devices, but you cannot open the same port to multiple devices via the AirPort Utility for the Apple routers.

  • HT5858 How do I open cellular data in ios7?

    Cannot open cellular data on I pad. I have ios7. Could open on ios6 before I changed to ios7

    This is the iPod touch forum. No cellular radio on an iPod. I requested you posted by moved to the iPad forum

  • Problem opening local files

    Hi!
    Our servlet has problems opening links to local files. The syntax of the link is correct (file:///program_install_folder/subFolder1/some_file.txt). When user copy-pastes the url to IE's address bar, the file opens without problems, but clicking the link does nothing.
    This has probably something to do with IE's security issues, but:
    1) is there any way to solve this problem with java?
    2) adding the site to trusted sites doesn't help, but is there any other settings which could enable user to open the link to local file?
    Requirement is that program works with Windows XP and IE6.

    servlets run on the server and
    cannot open local client files

  • FTPEx: 425 Possible PASV port theft, cannot open data connection..

    Hi All,
    I am getting the below the error while comminicating to FTP server.
    Delivery of the message to the application using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Possible PASV port theft, cannot open data connection.: com.sap.aii.adapter.file.ftp.FTPEx: 425 Possible PASV port theft, cannot open data connection..
    This error is random. Some times service is working is fine and some times its failed to process.
    Can any one suggest me the peramnent solution for this.
    Thanks & regards,
    Kartikeya

    Hi
      The reason for the error is
    The ip address (+port) is not same for both these operations
        - Control connection
        - Data Connection
    Changing active/passive mode settings might help (as a common solution).
    Problem can occur due to below settings,
       - FTP server/ Firewall on its side (affects Passive Mode)
       - FTP client/ Firewall on its side (affects Active Mode)
    After Initial Control connection is made, the below happens for Data connection
    When Active, the CLIENT opens a dynamic port for DC on which it would be listening, for the server to bind its source port
    When Passive, the SERVER opens a dynamic port for DC on which it would be listening for the client to bind its source port
    when the firewall on Server side does not have these ports open, you get the above error.
    The error could be because of other reasons also, but I suspect that the dynamic port is out range of the ports opened at your FTP server firewall.
    So now I think you are one step forward to fix the issue
    Regards
    Vishnu

Maybe you are looking for

  • Transformation with forula - activation error RSTRAN510

    Hi All, I created a transformation in which I have created a transformation and one of the rules is to Multiply a Currency and by a quantity and store in in a currency unit. i am getting getting these errors on activating it: 1. Error while activatin

  • Connecting a blu-ray to a wireless rcvr

    I have tried repeatedly to connect a blu-ray player that has netflix and other apps to the wireless receiver.  I have been able to get it to work briefly in the past, but now I can't get a connection.  This receiver shows full signal strength and pla

  • SQL Developer 3.1 EA3:   ORA-01446: cannot select ROWID . . .

    I'm running into a problem in 3.1 EA3 that I did not see in 3.0 (Oracle IDE     3.0.04.34). Both Installations are 64 bit using 64 bit Java under Windows 7 x64 SP1. When from either the "Connections" or "Schema" window I open some views and select th

  • Retina MBP- owned for 12 days

    Retina MBP 13 inch - have owned it for 12 days. Closed it at 6pm w over 50% battery life, at 11pm it won't turn on, charger doesn't even light up. Not the outlet. That happened today. Only other issue, was on day 10 it froze bcs "VLC failed to quit,"

  • How can I get this thru SQL ?

    Hi, I am having following sample data NUMRUB FORMAT 1 X(02) 2 9(02) 3 9(08) 4 X(20) 5 9(01) 6 X(03) 7 9(1) 8 X(02) 9 9(02) I want output in following way NUMRUB FORMAT NewFormat Start Position 1 X(02) 2 1 2 9(02) 2 3 3 9(08) 8 5 4 X(20) 20 13 5 9(09)