Not able to transmit Video

Hi,
I m new to JMF.We are using MjSIP and i want to transmit video through JMF to other machine.The problem is the implementation which is given in MjSIP isnt working .
I mean whenever i execute the implementation given in mjSIP like JVisualReceiver etc.Both machines hangs coz they are not being able to realize the processor.I have successfully run the Player but i m getting problem in realizing the processor.
Although we are using the same processor.realize() method given in JMF Api.
Even i m not being able to run this sample given by SUN.
package local.ua;
* @(#)VideoTransmit.java     1.7 01/03/13
* Copyright (c) 1999-2001 Sun Microsystems, Inc. All Rights Reserved.
* Sun grants you ("Licensee") a non-exclusive, royalty free, license to use,
* modify and redistribute this software in source and binary code form,
* provided that i) this copyright notice and license appear on all copies of
* the software; and ii) Licensee does not utilize the software in a manner
* which is disparaging to Sun.
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
* IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE
* LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS
* LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
* INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
* CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF
* OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
* This software is not designed or intended for use in on-line control of
* aircraft, air traffic, aircraft navigation or aircraft communications; or in
* the design, construction, operation or maintenance of any nuclear
* facility. Licensee represents and warrants that it will not use or
* redistribute the Software for such purposes.
import java.awt.*;
import javax.media.*;
import javax.media.protocol.*;
import javax.media.protocol.DataSource;
import javax.media.format.*;
import javax.media.control.TrackControl;
import javax.media.control.QualityControl;
import java.io.*;
public class VideoTransmit {
    // Input MediaLocator
    // Can be a file or http or capture source
    private MediaLocator locator;
    private String ipAddress;
    private String port;
    private Processor processor = null;
    private DataSink  rtptransmitter = null;
    private DataSource dataOutput = null;
    public VideoTransmit(MediaLocator locator,
                String ipAddress,
                String port) {
     this.locator = locator;
     this.ipAddress = ipAddress;
     this.port = port;
     * Starts the transmission. Returns null if transmission started ok.
     * Otherwise it returns a string with the reason why the setup failed.
    public synchronized String start() {
     String result;
     // Create a processor for the specified media locator
     // and program it to output JPEG/RTP
     result = createProcessor();
     if (result != null)
         return result;
     // Create an RTP session to transmit the output of the
     // processor to the specified IP address and port no.
     result = createTransmitter();
     if (result != null) {
         processor.close();
         processor = null;
         return result;
     // Start the transmission
     processor.start();
     return null;
     * Stops the transmission if already started
    public void stop() {
     synchronized (this) {
         if (processor != null) {
          processor.stop();
          processor.close();
          processor = null;
          rtptransmitter.close();
          rtptransmitter = null;
    private String createProcessor() {
     if (locator == null)
         return "Locator is null";
     DataSource ds;
     DataSource clone;
     try {
         ds = Manager.createDataSource(locator);
     } catch (Exception e) {
         return "Couldn't create DataSource";
     // Try to create a processor to handle the input media locator
     try {
         processor = Manager.createProcessor(ds);
     } catch (NoProcessorException npe) {
         return "Couldn't create processor";
     } catch (IOException ioe) {
         return "IOException creating processor";
     // Wait for it to configure
     boolean result = waitForState(processor, Processor.Configured);
     if (result == false)
         return "Couldn't configure processor";
     // Get the tracks from the processor
     TrackControl [] tracks = processor.getTrackControls();
     // Do we have atleast one track?
     if (tracks == null || tracks.length < 1)
         return "Couldn't find tracks in processor";
     boolean programmed = false;
     // Search through the tracks for a video track
     for (int i = 0; i < tracks.length; i++) {
         Format format = tracks.getFormat();
     if ( tracks[i].isEnabled() &&
          format instanceof VideoFormat &&
          !programmed) {
          // Found a video track. Try to program it to output JPEG/RTP
          // Make sure the sizes are multiple of 8's.
          Dimension size = ((VideoFormat)format).getSize();
          float frameRate = ((VideoFormat)format).getFrameRate();
          int w = (size.width % 8 == 0 ? size.width :
                    (int)(size.width / 8) * 8);
          int h = (size.height % 8 == 0 ? size.height :
                    (int)(size.height / 8) * 8);
          VideoFormat jpegFormat = new VideoFormat(VideoFormat.JPEG_RTP,
                                   new Dimension(w, h),
                                   Format.NOT_SPECIFIED,
                                   Format.byteArray,
                                   frameRate);
          tracks[i].setFormat(jpegFormat);
          System.err.println("Video transmitted as:");
          System.err.println(" " + jpegFormat);
          // Assume succesful
          programmed = true;
     } else
          tracks[i].setEnabled(false);
     if (programmed)
     return "Couldn't find video track";
     // Set the output content descriptor to RAW_RTP
     ContentDescriptor cd = new ContentDescriptor(ContentDescriptor.RAW_RTP);
     processor.setContentDescriptor(cd);
     // Realize the processor. This will internally create a flow
     // graph and attempt to create an output datasource for JPEG/RTP
     // video frames.
     result = waitForState(processor, Controller.Realized);
     if (result == false)
     return "Couldn't realize processor";
     // Set the JPEG quality to .5.
     setJPEGQuality(processor, 0.5f);
     // Get the output data source of the processor
     dataOutput = processor.getDataOutput();
     return null;
// Creates an RTP transmit data sink. This is the easiest way to create
// an RTP transmitter. The other way is to use the RTPSessionManager API.
// Using an RTP session manager gives you more control if you wish to
// fine tune your transmission and set other parameters.
private String createTransmitter() {
     // Create a media locator for the RTP data sink.
     // For example:
     // rtp://129.130.131.132:42050/video
     String rtpURL = "rtp://" + ipAddress + ":" + port + "/video";
     MediaLocator outputLocator = new MediaLocator(rtpURL);
     // Create a data sink, open it and start transmission. It will wait
     // for the processor to start sending data. So we need to start the
     // output data source of the processor. We also need to start the
     // processor itself, which is done after this method returns.
     try {
     rtptransmitter = Manager.createDataSink(dataOutput, outputLocator);
     rtptransmitter.open();
     rtptransmitter.start();
     dataOutput.start();
     } catch (MediaException me) {
     return "Couldn't create RTP data sink";
     } catch (IOException ioe) {
     return "Couldn't create RTP data sink";
     return null;
* Setting the encoding quality to the specified value on the JPEG encoder.
* 0.5 is a good default.
void setJPEGQuality(Player p, float val) {
     Control cs[] = p.getControls();
     QualityControl qc = null;
     VideoFormat jpegFmt = new VideoFormat(VideoFormat.JPEG);
     // Loop through the controls to find the Quality control for
     // the JPEG encoder.
     for (int i = 0; i < cs.length; i++) {
     if (cs[i] instanceof QualityControl &&
          cs[i] instanceof Owned) {
          Object owner = ((Owned)cs[i]).getOwner();
          // Check to see if the owner is a Codec.
          // Then check for the output format.
          if (owner instanceof Codec) {
          Format fmts[] = ((Codec)owner).getSupportedOutputFormats(null);
          for (int j = 0; j < fmts.length; j++) {
               if (fmts[j].matches(jpegFmt)) {
               qc = (QualityControl)cs[i];
               qc.setQuality(val);
               System.err.println("- Setting quality to " +
                         val + " on " + qc);
               break;
          if (qc != null)
          break;
* Convenience methods to handle processor's state changes.
private Integer stateLock = new Integer(0);
private boolean failed = false;
Integer getStateLock() {
     return stateLock;
void setFailed() {
     failed = true;
private synchronized boolean waitForState(Processor p, int state) {
     p.addControllerListener(new StateListener());
     failed = false;
     // Call the required method on the processor
     if (state == Processor.Configured) {
     p.configure();
     } else if (state == Processor.Realized) {
     p.realize();
     // Wait until we get an event that confirms the
     // success of the method, or a failure event.
     // See StateListener inner class
     while (p.getState() < state && !failed) {
     synchronized (getStateLock()) {
          try {
          getStateLock().wait();
          } catch (InterruptedException ie) {
          return false;
     if (failed)
     return false;
     else
     return true;
* Inner Classes
class StateListener implements ControllerListener {
     public void controllerUpdate(ControllerEvent ce) {
     // If there was an error during configure or
     // realize, the processor will be closed
     if (ce instanceof ControllerClosedEvent)
          setFailed();
     // All controller events, send a notification
     // to the waiting thread in waitForState method.
     if (ce instanceof ControllerEvent) {
          synchronized (getStateLock()) {
          getStateLock().notifyAll();
* Sample Usage for VideoTransmit class
public static void main(String [] args) {
     // We need three parameters to do the transmission
     // For example,
     // java VideoTransmit file:/C:/media/test.mov 129.130.131.132 42050
     if (args.length < 3) {
     System.err.println("Usage: VideoTransmit <sourceURL> <destIP> <destPort>");
     System.exit(-1);
     // Create a video transmit object with the specified params.
     VideoTransmit vt = new VideoTransmit(new MediaLocator(args[0]),
                         args[1],
                         args[2]);
     // Start the transmission
     String result = vt.start();
     // result will be non-null if there was an error. The return
     // value is a String describing the possible error. Print it.
     if (result != null) {
     System.err.println("Error : " + result);
     System.exit(0);
     System.err.println("Start transmission for 60 seconds...");
     // Transmit for 60 seconds and then close the processor
     // This is a safeguard when using a capture data source
     // so that the capture device will be properly released
     // before quitting.
     // The right thing to do would be to have a GUI with a
     // "Stop" button that would call stop on VideoTransmit
     try {
     Thread.currentThread().sleep(60000);
     } catch (InterruptedException ie) {
     // Stop the transmission
     vt.stop();
     System.err.println("...transmission ended.");
     System.exit(0);
I m getting this exception
Failed to realize: com.sun.media.ProcessEngine@bd0108
Error: Unable to realize com.sun.media.ProcessEngine@bd0108
Error : Couldn't realize processor

Finaly i was able to solve the problem.The other machine was having some firewall blocking the receiver.

Similar Messages

  • Adobe is not working properly not able to view videos or games

    adobe flash player not working properly and not able to view videos or games

    Welcome to the Adobe Forums.
    The more information you supply about your situation, the better equipped other community members will be to answer. Please supply the following Information that you haven’t already (where applicable):
        •    Adobe product and version number
        •    Operating system and version number
        •    Browser and version number (where applicable)
        •    The full text of any error message(s)
        •    What you were doing when the problem occurred
        •    Screenshots of the problem (if possible)
        •    Computer hardware, such as CPU; GPU; amount of RAM; etc.

  • I am not able to add videos to itunes. So I am not able to sync them with my IPhone4s. I ve tried: dragging to itunes, minimize file name of mp4, adding by file/folder still not adding. WHY? Please help.

    I am not able to add videos to itunes. So I am not able to sync them with my IPhone4s.
    I ve tried:
    dragging to itunes,
    minimize file name of mp4,
    adding by file/folder, but still not adding.
    WHY? Please help.

    This is very serious. Your computer got infected with ransom malware, Cryptowall.
    Go here for further info.
    CryptoWall 2.0 Anything Good about Buying you Keys? - General Security
    CryptoWall and DECRYPT_INSTRUCTION Ransomware Information Guide and FAQ

  • Not able to play video directly from websites like metacafe in safari browser

    Hi
    I recently purchased an iPhone 4S however I am not able to play videos directly from websites like metacafe.com and all others. Whereas few of my friends who bought iPhone 4S / 5 (factory unlocked) versions can very well play videos from all websites. Whenever they browse videos, it start streaming on their phones and stArt playing in QuickTime player. What is the reason of this behavior, is there something missing in my iPhone?
    Thanks for your help in this

    Any inputs on this will be highly appreciated...
    Someone please help on this...
    Regards,
    Sankalp Singhal

  • Not able to start video capture

    Hello, I have a  Motorola Droid Ultra and ever since the android kit-kat update my phone is unable to record videos. Which effects my apps (ex. SnapChat , Instagram , Facebook) from recording.Whenever I try to record it say's "Not able to start video capture". I am able to take pictures by the way. 
    P.S. Any help is greatly appreciated.

    That sounds like the camera bug,  I think these phones were hit with in one of the updates,  my Droid Maxx has been immune of it,  because I've kept it on Jelly Bean I don't have the camera features that many have with K.Kat but until I see allot of improvement and no issues..  I'll keep her on Jelly Bean..  Sorry your having this issues..  it's the berries when you have to deal with issues as we've seen..

  • Not able to add video podcast to ipod

    i am having a couple of issues with my 5th gen ipod......first one is my computer is not recognizing my ipod and two i'm now not able to add videos from another computer that does recognize my ipod. can anyone give me some help.

    No, the version has effect on syncing music
    Have you succesfuly synced from this iTunes libary/computer before?
    Do the songs play in iTunes?
    Do you have the right boxes checked to sync?
    iTunes: Syncing media content to iOS devices and iPod

  • Not able to add Video

    Last week i bought 30GB iPOD.
    I am not able to add videos in it.
    In iPOD setting, in Video tab all the options are in disabled mode with the default selection as no need to add videos. i think if i am able to enable "Manually maintain my own video" option, then i can upload video in my iPOD. Please let me know how to enable it.
    Thanks & Regards
    Subbu

    You probably have your iPod set to manually update your music.
    For some reason, iTunes will grey out the video options if you have it set to Manual.

  • I am not able to add video files to my itunes after installing itunes 10.7

    I am not able to add video files to my itunes after installing itunes 10.7.0.21

    I Have been using, Ipad for only around a month or so (Ipad 2), and it was only yesterday that i tried to use the Itunes. I first downloaded the latest itunes (10.7.0.21), and took backup of all my Ipad data.
    After this, I wanted to add some video to my ipad, as it was essential to add the same to My itunes first, I roceeded to do just that. I went through this command {File - Add File to Library}, and then went on to select the Video file. There's just a flicker, and then nothing happens at all - the itune screen remains, and there is no error message too. Whereas, I can easily add Audio Files.
    After this, I even downaload the latest Quick time (7.7.2), as I had read somewhere that the same is necessary. When I tried to open the Video file in Quick time, it did not open. After that I downloaded the codec DivX and DivX player. Though the Video plays in DivX, it refuses to open in Itune and does not play properly in Quicktime (slider moves, but sound and video is not there).
    Frankly, I am utterly confused.
    Regards, Shekhar

  • I am not able to play videos from YoyTube, or videow posted on my blog. That does not happens with explorer, where videos are playing normal

    I am not able to play videos from YouTube, or videow posted on my blog, when I use Fire Fox. That did not happened before the 3.6.14 and allthouhg you informed us that with the 3.6.15 the problem will dissapear, it does not happen. Take into consideration that, with explorer, everything is running fine. I am a long time user o firefox and I donnot want to change. Please give me advise how to solve thiw problem. Tanhks in advance

    Hi, My computer shuts down when I try to do any thing with graphics, ie, watching streamed video or looking at my photo's. this is a recent problem, anyone got any idea's

  • After the latest release of iOS 8.1.2, I am not able to view videos

    Hi All,
    After the latest release of iOS 8.1.2, I am not able to view videos from the below website:
    www.startv.in/episodes/santosh-discovers-the-truth/76711
    Until the previous iOS version 8.1.1, there wasn't any problem. But now none of the video is playing.
    Error message displayed is: This video isn't encoded for your device.
    How can this happen as some time back it was all fine until I updated the iOS.
    Please help. This is my favourite channel websites for lots of serials online.
    <Subject Edited by Host>

    The video won't play where I am but this might work for you. Go to the website. Tap the URL field. Pull your Favorites down. Tap request desktop site.

  • I have a Nikon Coolpix P510 and with Picasa I am not able to view videos or continous photos. Before I purchase Adobe Lightroom I want to know if I am able to view those features?

    I have a Nikon Coolpix P510 and with Picasa I am not able to view videos or continous photos. Before I purchase Adobe Lightroom I want to know if I am able to view those features?

    The best thing to do is download the trial of Lightroom and see if it works for you. The trial is the complete program. The only thing different about the trial is that it expires after thirty days. Your images stay in the folders you already have so there's little risk. Good luck!

  • TS3899 Not able to send emails. Also not able to downlow  videos send from another iPhone to my.

    Not able to send out emails. Also not able to downlow videos send from another iPhone to my.

    depending on what email account you are using, you may need to enter a password for you outgoing mail server, go back into mail settings and check, same p/w as your incoming mail server.

  • Am not able to import videos to imovies, as am able to view the videos in iphone but not able to import in imovies .Pls help

    Am not able to import videos to imovies, as am able to view the videos in iphone but not able to import in imovies .Pls help

    Hello Ephremekka
    Start your troubleshooting with the article below to get your iPod Classic to show up in iTunes to be restored.
    iPod: Appears in Windows but not in iTunes
    http://support.apple.com/kb/TS1363
    Regards,
    -Norm G.

  • Please help! Not able to set Video input Port(S-Video or Composite)on Linux

    Hi
    I am using JMF2.1.1e(Linux performance pack) for video capturing on Linux OS. I want to set video input port(S-Video or composite) through my application. I am using the following code:
         if ( dataSource != null )
              arrControls = dataSource.getControls ();
         if ( arrControls != null )
              nCount = arrControls.length;
         System.out.println("No. of Controls: " + nCount);     
         for ( i = 0; i < nCount; i++ )
              if ( arrControls[i] == null )
                   continue;
              if ( !(arrControls[i] instanceof Control) )
                   continue;
              componentControl = ((Control)arrControls).getControlComponent ();
              System.out.println("ComponentControl : " + componentControl);
              if ( componentControl == null )
                   continue;
    But, i am getting No. of Controls: 0 (Zero). So i am not able to get any control component also. Rest of the application is working fine. Please help me solving this problem.
    Thanks in advance.

    To go a stage further.
    Google run a Jabber server for their service.
    Jabber apps (those that can) use a Protocol called Jingle to make the A/V connections.
    Google's version is not even that compatible with other Jabber apps. (See Here)
    The Plug-in in the Google Install (Or the Standalone Web Browser Plug-in allow Browsers to access the GoogleTalk A/V side as does the Standalone PC app called GoogleTalk as well.
    iChat uses a process called SIP (Session Initiation Protocol) to connect to other iChat Users or to the AIM for PC app.
    However this also works in any iChat to iChat Connection no matter if the Buddy List is an AIM Login based one, Jabber (including GoogleTalk) or A LAN based Bonjour Chat.
    In you care this is not going to work.
    Getting the Standalone (Intel only) Browser Plug-in and using the Chat option in the Google Mail Web page is probably the easiest option.
    7:31 PM Friday; January 7, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"

  • Not able to Transmit and receive RTP in Linux

    Friends,
    I am not able to receive the RTP stream transmitted from another Linux machine though I was trying doing it with JMStudio. The transmit shows as if it is working properly and JMStudio in the receiver machine keeps waiting. Tranmission and receiving between the two same machines when in windows is fine.
    Can anyone tell me what the problem is, do I have to add any feature to make this work in Linux.
    Sreekant

    I too am unable to transmit OR recieve RTP from Linux (RedHat 8.0). I am using JMF-2.1.1e and J2SDK 1.4.2.
    I can play files on Linux and I can transmit and recieve between Win boxes (98 and 2K) but my RedHat (8.0 and/or 7.3) can not send or recieve to anyone or anything. I have tried JMStudio and RTPPlayerApplet.
    TCPDUMP says udp port 22224 unreachable [tos 0xc0]
    JMStudio says that no data has arrived.
    I have all firewalling turned off and have tested on two different networks without success. All other networking functions are operational.
    My problem is identicle to the problem decribed in the following linked post.
    http://forum.java.sun.com/thread.jsp?thread=154947&forum=28&message=966551
    I also found another discussion that referenced big/little endian problems in the JMF implementation. (scary stuff)
    http://www.vovida.org/pipermail/rtp/2001-April/000112.html
    Any help or tips on resolving this issue are welcome. I will be happy to supply more info if needed. Also, if anyone has managed to get RTP working on Linux then what versions Linux/JDK/JMF, what program?
    Thanks in advance.

Maybe you are looking for

  • Simple drop down menu (not navigational)

    Hello all. I must admit that I'm more versed in Flash than I am in Dreamweaver unfortunately. I'm building a website as of right now, and I have a drop down menu. I need for this drop down menu to link to other pages when a menu item is selected and

  • More than 40 rows in Data Type

    Hi all, i must put more than 40 rows in a Data Base and Data Type olny suports 40 rows!! How can i do this? Thankz

  • Drilling down - duplicate sub category

    I am new to oracle OBIEE, help will be great. When I drilldown in the pivot table let say I have a hierarchy dimension: Total>Category>SubCategory. Category contain 2type Good and Bad. SubCategory contain A and B. When I drilldown to A on Good Catego

  • Accessing IRM Web Services with Coldfsuion

    We are looking to use the IRM web services with Coldfusion. Coldfusion abstracts Web Services calls through Java calls to the point of just setting up structures and calling the functions. My question is about the process for building the correct par

  • Por que me dice que la memoria esta llena si aun tiene espacio?

    Hola, quisiera saber porque mi ipod touch 4g me dice que la memoria esta llena (0 bytes) si casi no tiene aplicaciones, musica, videos y esas cosas me gustaria saber porque me dice eso o como lo arreglo, gracias a esto no me deja sincronizarlo con mi