VoIP with JMF

hello,
i'm trying to create a J2SE VoIP app with JMF. is it feasible?
i've read that to overcome the NAT problem, we need to use Symmetry RTP. does it supported in JMF?
i've done the SIP session managing with JSIP. now i need to send and receive RTP data.
i've done this for the receiver
url= "rtp://" + IP + ":" + port + "/audio/16";
mrl= new MediaLocator(url);
player = Manager.createPlayer(mrl);
player.realize();
// wait for realizing
while (player.getState() != Player.Realized){
     try
Thread.sleep(10);
} catch (InterruptedException e)
e.printStackTrace();
player.start();
with IP is the other party IP specified in the SDP, and the Port is the port specified in the SDP too.
with wireshark, i've seen that RTCP is seen (Receiver Report, Source Description), and RTCP replies are received (Sender Report, Source Description), but RTP data is not received.
i realize that JMF open the same local port as the port specified in the MediaLocator. while actually in my INVITE SDP, i tell the other party a different port. might this be the problem that i don't receive any RTP data?
Thank you.

Hey,
No, the loss of packets isn't something you can control... you lose a packet, you lose a packet. The different encodings could have an affect on the impact of the packet loss, however, but the actual loss of the packet is out of everyone's hands. Even God loses packets as they travel on the wire...Well, I went again to Wiki to look for that page and you are right, I am wrong, it didn't say anything about packet loss, but it was referring to the call distortion and wrongly concluded something about the packets.
Ummmm, maybe. The issue isn't as simple as knowing the public IP address of a client behind a NAT, it's also a matter of traversing the NAT itself. But if the SIP UAS handles all of that, then yes, you should be fine.after putting it to the test, I'm really confused...
I'll try to lay it out so it would make sense and if that wont work I'll post my code here. there is just a lot of it in a few classes.
This is tested with one way streaming!
*1.* I've been trying to transmit audio and video within my home LAN, I've managed to send from one computer to the other, from beginning to end.
This is what I receive on the callee computer in my home LAN:
Participant added to list: ACER-LAPTOP/10.0.0.2
  - A new participant had just joined: TacB0sS@Acer-LapTop
New Stream Event received: StreamMappedEvent
  Stream: com.sun.media.rtp.RecvSSRCInfo@13e6346
  Participant: com.sun.media.rtp.RTPRemoteSourceInfo@1cb374f
  Source: RTPManager
     SSRCCache  com.sun.media.rtp.SSRCCache@cc9d70
     Dataport  33444
     Controlport  33445
     Address  10.0.0.1
     RTPForwarder  com.sun.media.rtp.util.PacketForwarder@17456bc
     RTPDemux  com.sun.media.rtp.RTPDemultiplexer@ea85b4
New Stream Event received: NewReceiveStreamEvent
  Stream: com.sun.media.rtp.RecvSSRCInfo@13e6346
  Participant: com.sun.media.rtp.RTPRemoteSourceInfo@1cb374f
  Source: RTPManager
     SSRCCache  com.sun.media.rtp.SSRCCache@cc9d70
     Dataport  33444
     Controlport  33445
     Address  10.0.0.1
     RTPForwarder  com.sun.media.rtp.util.PacketForwarder@17456bc
     RTPDemux  com.sun.media.rtp.RTPDemultiplexer@ea85b4
new stream arrived fromcom.sun.media.rtp.RTPRemoteSourceInfo@1cb374f
  - Recevied new RTP stream: JPEG/RTP*2.* But when I try to transmit to my friends computer, which is far far away... I do receive NewParticipantEvent, and I do get StreamMappedEvent, but no NewReceivedStreamEvent. sometimes I received an InactiveReceivedStreamEvent but to the caller computer, not to the callee. I thought perhaps the log would help:
This is what I get when I try to call my friends remote computer, on his computer:
Participant added to list: xx.xx.xx.xx.bb.netvision.net.il/xx.xx.xx.xx
  - A new participant had just joined: TacB0sS@dell-laptop
New Stream Event received: StreamMappedEvent
  Stream: com.sun.media.rtp.RecvSSRCInfo@198a455
  Participant: com.sun.media.rtp.RTPRemoteSourceInfo@aa37a6
  Source: RTPManager
SSRCCache  com.sun.media.rtp.SSRCCache@12b7eea
Dataport  33444
Controlport  33445
Address  192.168.2.101
RTPForwarder  com.sun.media.rtp.util.PacketForwarder@99353f
RTPDemux  com.sun.media.rtp.RTPDemultiplexer@76e369
And this is what I get on my computer when I call my friends:
New Stream Event received: InactiveReceiveStreamEvent
  Stream: null
  Participant: com.sun.media.rtp.RTPRemoteSourceInfo@7b7b11
  Source: RTPManager
     SSRCCache  com.sun.media.rtp.SSRCCache@cc9d70
     Dataport  33444
     Controlport  33445
     Address  10.0.0.1
     RTPForwarder  com.sun.media.rtp.util.PacketForwarder@17456bc
     RTPDemux  com.sun.media.rtp.RTPDemultiplexer@ea85b4This is really bigger then me, we've tried to play a bit with configuration, but I just don't see the point, some events are received some are not...
What am I missing?
Thanks,
Adam.
Edited by: Adam-Z. on Jun 14, 2010 7:34 PM

Similar Messages

  • Rtp to wav(or au, etc) with JMF?

    these days i'm working on a program with JMF, it's sth like an ip phone sniffer, it sends arp spoof packets to ensure all the audio/video streams to pass through the sniffer in a switched lan, and the sniffer captures these streams and plays these streams, my question is:how can i save these rtp streams to a wav(or au, etc) file while playing them, or just save the rtp packets into a file like ethereal capture file, and use JMF API to play the captured file?
    sorry for my english, thanks a lot.

    Hi
    I also have project to convert the rtp packet captured by jpcap (payload: G.711 pcmu,from voip) in to wav file
    Did you find the solution? And if so , could you tell me how to do this or send me the source code please?
    My e-mail:[email protected]
    I really need it
    Thank you,
    Best regards

  • How to use ffmpeg with jmf

    I am trying to use ffmpeg with jmf. Do any one have any idea how to do it.

    Get binary distro and follow Manual Installation section of http://fobs.sourceforge.net/f4jmf_first.html

  • FSM with JMF 2.1.1(a) and one more problem. !! URGENT

    Good AfterNoon All...
    I am working on JMF 2.1.1 and I want to show a .avi file in fullScreenMode.
    How can i do so with jdk 1.4.
    I have gotten viewComponent and control comp.
    My application is running sucessfully. NO PROBLEM.
    But i want to show the movie in FSM . In order to do so, what i am doing is , I remove view
    Comp from my JFrame (in which whole of the process is going on.) .
    Add that viewComp in fullScreenWindow (which is initilized Window with parent frame.).
    But here some problem is there. According to me, it is painting problem.
    viewComp is removed successfully from frame but not added in window.
    Layout of window is border and i am adding viewComp in center of window.
    Running movie is not visible in Window. WHY ? what could be the possible reason.
    Is it possible or It can't happen. ?
    One thing more.... HUH...
    I have a menubar in frame with file and tool menus.
    when player initilized and movie starts running . You know what happens.
    Clicking on menu(s) doesnot cause menuitem(s) to visible or pull down. ?? Oh ! GOD.
    viewComp is at center and controlComp is at South.
    When i click on say fileMenu. file Menu pressed as always happens with swing's color but menuitems donot visible.
    WHY ?
    It seems that menuitems are visible ....hamam.ma...mmm I mean they are hided by viewComp.
    how to get ride of this problem. ?
    Any idea is highly appreciated.
    And it is nice working with JMF.

    Nobody .... ??
    I have found the answer of my 2nd question but still first is creating problem.
    Does anyone know it.. how to do it..
    Full Screen Mode in JFM.
    Thanks
    Sanjeev Dhiman

  • How to hint movie with JMF

    Hello,
    I would like to know how to make hinted movies with JMf, but no One seem to talk about this in forums...
    Any idea ?

    Get binary distro and follow Manual Installation section of http://fobs.sourceforge.net/f4jmf_first.html

  • Marque vlans voip with DSCP end-to-end

    Hello,
    I want to mark all vlan voip with  DSCP (value 46) end to end,could you plz tell me how i can do it?,
    SW:2960 or 3560
    SW_BB0:3570
    Router3800
    Phone type:Avaya
    Phone <-------->SW<-------->SW_BB0 <--------> RouterX <--------> RouterY <------> RouterZ <--------> Router-customer<-------->Phone
    Best regard

    Hi Paolo,
    So should I configure DSCP just on first Switch or router?
    And if you could please tell me the best place where I apply the config?
    James

  • Play movie with JMF

    Hey,
    I just started out with JMF (I wanted to play a movie with java).
    I got this code:
    import java.applet.*;
    import java.awt.*;
    import javax.swing.*;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import javax.media.*;
    * Demonstrate simple code to play a movie with Java Media Framework.
    * @author Ian F. Darwin, http://www.darwinsys.com/
    * @version $Id: JMFPlayer.java,v 1.9 2004/02/09 03:21:20 ian Exp $
    public class NewJApplet extends JPanel implements ControllerListener {
        /** The player object */
        Player thePlayer = null;
        /** The parent Frame we are in. */
        JFrame parentFrame = null;
        /** Our contentpane */
        Container cp;
        /** The visual component (if any) */
        Component visualComponent = null;
        /** The default control component (if any) */
        Component controlComponent = null;
        /** The name of this instance's media file. */
        String mediaName;
        /** The URL representing this media file. */
        URL theURL;
        /** Construct the player object and the GUI. */
        public NewJApplet(JFrame pf, String media) {
            parentFrame = pf;
            mediaName = media;
            // cp = getContentPane();
            cp = this;
            cp.setLayout(new BorderLayout());
            try {
                theURL = new URL(getClass().getResource("."), mediaName);
                thePlayer = Manager.createPlayer(theURL);
                thePlayer.addControllerListener(this);
            } catch (MalformedURLException e) {
                System.err.println("JMF URL creation error: " + e);
            } catch (Exception e) {
                System.err.println("JMF Player creation error: " + e);
                return;
            System.out.println("theURL = " + theURL);
            // Start the player: this will notify our ControllerListener.
            thePlayer.start(); // start playing
        /** Called to stop the audio, as from a Stop button or menuitem */
        public void stop() {
            if (thePlayer == null) {
                return;
            thePlayer.stop(); // stop playing!
            thePlayer.deallocate(); // free system resources
        /** Called when we are really finished (as from an Exit button). */
        public void destroy() {
            if (thePlayer == null) {
                return;
            thePlayer.close();
        /** Called by JMF when the Player has something to tell us about. */
        public synchronized void controllerUpdate(ControllerEvent event) {
            // System.out.println("controllerUpdate(" + event + ")");
            if (event instanceof RealizeCompleteEvent) {
                if ((visualComponent = thePlayer.getVisualComponent()) != null) {
                    cp.add(BorderLayout.CENTER, visualComponent);
                if ((controlComponent = thePlayer.getControlPanelComponent()) != null) {
                    cp.add(BorderLayout.SOUTH, controlComponent);
                // re-size the main window
                if (parentFrame != null) {
                    parentFrame.pack();
                    parentFrame.setTitle(mediaName);
        public static void main(String[] argv) {
            JFrame f = new JFrame("JMF Player Demo");
            Container frameCP = f.getContentPane();
            NewJApplet p = new NewJApplet(f,
                    argv.length == 0 ? "file:/C:/Users/Patrick Kos/Pictures/BAA.avi"
                    : argv[0]);
            frameCP.add(BorderLayout.CENTER, p);
            f.setSize(200, 200);
            f.setVisible(true);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }but I always get a unable to handle format exception, expect with mp3 files.
    But i"ve looked up the supported formats and its says its supported so??

    i get this error
    Unable to handle format: XVID, 320x240, FrameRate=29.9, Length=230400 0 extra bytes
      Unable to handle format: unknown, 22050.0 Hz, 0-bit, Stereo, Unsigned, 8000.0 frame rate, FrameSize=9216 bits
    Failed to realize: com.sun.media.PlaybackEngine@7259da
    Error: Unable to realize com.sun.media.PlaybackEngine@7259da
    Exception in thread "main" javax.media.CannotRealizeException
            at javax.media.Manager.blockingCall(Manager.java:2005)
            at javax.media.Manager.createRealizedPlayer(Manager.java:580)
            at projectnemo.NewJApplet.main(NewJApplet.java:102)

  • RTP (UDP) multicast stream with JMF...?!

    Hi.
    I am quiet new in the material of jmf and its plugins. I have a network which offers me an UDP stream (mpeg2 or mpeg4 both could be available). I can watch this stream with an freewareplayer called VLC.
    When using the JMF Studio tool, I can't watch the stream ... The Player is waiting for signals and breaks after 60 seconds. So, okay ... Maybe the JMF doesn't bring the right codec with it.
    Now I've installed jffmpeg, but that doesn't help a lot. I write done the JAR File in Classpath and installed the Plugin, MimeType and Demultiplexer (as described) in the JMF Registry. The behaviour of JMF Studio is the same. Does anybody have an idea wether jffmpeg supports this kind of streaming
    and/or what I can do to get the stream?! Maybe there is an better Plugin for my solution.
    I can't suppose that nobody here ever tried to get an Mpeg2 or Mpeg4 multicast stream with JMF. There must be an solution.
    Many thanks for your help and reply!
    Jan Stanetzki

    Hi funnyjanni,
    May be I am writing this after 4 years.
    I am also in the stage when you faced the same problem. You might have found the solution to this.
    Please help me on this. I am trying to use jffmpeg to play UDP mutlicast stream.
    Thanks
    jklanka

  • How to create a Macromedia's Flash Java Player with JMF?

    How to create a Macromedia's Flash Java Player with JMF? Can you give me an example? My email:[email protected] [email protected]

    Yes, there is a way. Look up JTree in the API.-can you post some code.... i cant figure out on how to use JTree...
    i'm still confused on where will i get the entire directories of my drives...
    thanks

  • Play sdp file with JMF

    Hi,
    I have a Darwin Streaming Server(DSS) running on a machine, that reflects several broadcasts from other machines (I'm broadcasting to the DSS with JMF).
    I can see all the videos and audio without any problem with Quick Time, but I can't find a way to play the sdp files with jmf. I've searched the web for jmf and sdp, and there isn't much information, i've also tried to play with JMStudio..no luck. In the JMF solution there aren't any samples for SDP files....
    If I can't find a way to do it, I'll use Quick Qime 4 Java, the only problem is that there isn't a linux implementation :(
    Thanks in advance.
    Best regards,
    ANeto

    Hi,
    I have read all the mails on the JMF interest group regarding the Broadcaster and DSS.
    Well i too am trying to do a similar application. This is an Application
    Casting program basically to share my desktop with the other person sitting
    across the network using my client. And in order to multicast this, i am
    looking at using Darwin Streamng Server.
    The whole idea here is that i break the desktop image up into frames and
    then compress them and then send it over, protocol used here is TCP/RTP/UDP.
    I am trying to hit this stream of packets to DSS so that it can be accessed
    else where over the internet. I'm trying to under stand the basic
    authentication mechanism DSS uses, so that i can create the .sdp file and
    transfer it over to the DSS, which can further be accessed by any client
    that can understands sdp.
    As i read in the mail some of you were able to create the .sdp file with your custom built boradcaster and send it to DSS if i am not wrong.
    I have tried this with Mpegable Broad caster as you said.
    Now the problem i had was to create .sdp file with my application and push it to the DSS.
    So have you made some kind of a documentation or can you give me an idea as
    to how i can go about this. Or it will be even better if you can share the code with me.

  • Can I do this with JMF?

    hi,I am new to JMF
    I am doing a door bell system project.
    At the front of the entrance we have a micphone and webcam,when the vistor come to the door and "knock at" a staff's bell,
    1: I wanna show the staff who sits in his office who is the vistor. (He might use any kind of operating system,not just windows)
    2. if the staff is away I wanna to give the visitor an oppotunity to record down a voice message and when the staff come back he can retrieve the voice message.
    can I achieve all these functions with JMF?
    thanks!

    hi,I am new to JMF
    I am doing a door bell system project.
    At the front of the entrance we have a micphone and webcam,when the vistor come to the door and "knock at" a staff's bell,
    1: I wanna show the staff who sits in his office who is the vistor. (He might use any kind of operating system,not just windows)
    2. if the staff is away I wanna to give the visitor an oppotunity to record down a voice message and when the staff come back he can retrieve the voice message.
    can I achieve all these functions with JMF?
    thanks!

  • Image with jmf

    Hi,
    I am inexperienced in programming and i want some ideas...
    I want to process a picture with jmf (change format and dimensions) what i exactly need?I looked a few examples but iwas really confused!!!I cannot even load the image on a window(a player). Any advices....????
    Thanx

    Have you cleared this problem. I am having the same problem right now. Till now amn't able to clear it.
    One thing in my mind is that first of all I need to convert the JPeg images to a movie and after that transmit it...
    If you have cleared thsi problem, I'll be grateful if u can help me...
    Thanks
    Sco

  • Video Capturing with JMF

    Dear friends
    I want to develop a program which can capture video from my web cam.
    (resolution 640x480 frame rate 20 frames/second) with JMF.
    If you have any suggestions and references please help me with this.
    Thank you in advance.

    ac09 wrote:
    ..If you have any suggestions..Read the posts to the [JMF forum|http://forums.sun.com/forum.jspa?forumID=28] where this topic has been discussed many (many) times. Make future posts re. JMF to the JMF forum.
    .. and references .. JMF [Code Samples and Apps|http://java.sun.com/javase/technologies/desktop/media/jmf/reference/codesamples/index.html] .
    Thank you in advance.No worries.

  • Detection problem on HP webcam with JMF

    Hi,
    I'm trying NyARtoolkit and I need to use the video stream of my HP's webcam encrusted above the screen of my laptop (a HP Pavillon tx 2670ef)
    After the installation of JMF, I lunch JMStudio and I manage tu detect my webcam in : File->Preferences->Capture Devices->detect capture devices.
    Then i close the windows and i do File->Capture...->I enable "use video device" and unable "use audio device" then i click on "OK" but aftewards i have an error message saying that JMF couldn't initialize the capture device...
    2 students with me have the same pb...
    I made some researches about this issue and i found this post
    http://72.5.124.102/thread.jspa?messageID=10177842
    Afterwards I've installed ManyCam and i managed to get a video capture from the virtual webcam simulated with ManyCam.
    In fact, when i click on detect capture devices in JMStudio, a windows appears and i can choose "ManyCam Virtual Webcam" instead of "HP webcam".
    Moreover, in the options before capturing video, the encoding is in RVB instead of YUV before with the "HP webcam".
    But when i run my program i have this error :
    java.lang.ArrayIndexOutOfBoundsException: 0 >= 0
         at java.util.Vector.elementAt(Unknown Source)
         at jp.nyatla.nyartoolkit.jmf.utils.JmfCaptureDeviceList.getDevice(JmfCaptureDeviceList.java:80)
         at jp.nyatla.nyartoolkit.java3d.utils.NyARSingleMarkerBehaviorHolder.<init>(NyARSingleMarkerBehaviorHolder.java:68)
         at J3DJME.NyARJava3D.<init>(NyARJava3D.java:174)
         at J3DJME.NyARJava3D.main(NyARJava3D.java:76)
    I tried many other things (Quicktime with QTcap... but i didn't managed to solve this pb yet)
    Coud you help to use my webcam with jmf ?
    josy

    You probably want to remove the crust from your web cam if you expect it to work. Most things that are encrusted aren't in the best of shape...
    JMF connects to web cameras by wrapping around native interfaces. If the JMStudio isn't able to use your web cam, it could mean a number of things...your web cam isn't compliant with the version of the interfaces (VFW and DirectShow, I believe) that JMF is wrapping around, the web cam doesn't output any formats JMF can use, etc.
    But if JMStudio can't use your web cam sucessfully, 99% of the time that means your web cam isn't going to work with JMF... unless you want to code support for it yourself.

  • Capture cards to use with JMF....

    Hello, I need to buy a video capture card to use with JMF in order to get a video signal and send it using a stream channel.
    Somebody can help me and post a list of compatible capture cards with JMF?.
    I think on buy a PINNACLE 500 PCI but i have read that it is incompatible with JMF.
    Thanks.

    Creative webcam live should work, most webcams will work... at least under Windows. I've 2 older creative webcams that work under Windows.
    Not sure about Linux support though...
    Ps. there's a Java Media Framework section of this forum, where all the JMF related questions should be posted.
    regards,
    Owen

Maybe you are looking for