Captured and stored video from webcam

hi,
We are doing video conferencing.For this we have to capture video and save this video in file.But we are facing problem to saving this video in file.
we face the problem when we create DataSink but it gives null value for getDataOutput() function.
so please anyone can help us ,
reply.

Hi captfoss,
The "deviceInfo.getFormats()" is returning [Ljavax.media.Format;@191d8c1
we tried using the following line of code
ProcessorModel processorModel = new ProcessorModel(deviceInfo.getLocator(),deviceInfo.getFormats(), outputType);
Processor processor = Manager.createRealizedProcessor(processorModel);
processor.start();
Thread.currentThread().sleep(50000);
But still i am getting the same Exception. Please suggest other alternative options ??
Thanks,
vijay.

Similar Messages

  • Capture and import video from DVD

    Just switched from PC to MAC. I have my travel videos on DVD's. In iMovie 08 how do I capture and import the video that's on the DVD into iMovie. I couldn't find any help on this topic.
    Any help is appreciated.

    Take a look at Cinematize 2, I've used it with iMovie 06 and iDVD 08. It has several modes of converting the data. One mode is called "lossless".
    For the job you're doing you may prefer to use iMovie 06 instead of iMovie 08 (I would).
    iMovie 06 and iDVD 08 is a terrific combination.
    iMovie 06 is a free download to iLife 08 owners. (THEY WANT YOU TO HAVE IT!)
    http://www.apple.com/support/downloads/imovieHD6.html
    Your workflow would go something like this.
    Use Cinematize 2 to create a Quicktime file from the DVD.
    Important that file into iMovie 06.
    From iMovie 06, share to iDVD 08 (assuming you want a DVD).

  • Unable to capture video from webcam in JMF in xlet

    hi
    I am unable to capture video from webcam in an Xlet. I am using Xletview to run Xlet. The method CaptureDeviceManager.getDeviceList(vidformat) returns empty array. Which videoformat should I use and why do I get empty array?
    Thanks
    Rajesh

    MHP and OCAP only use JMF 1.0, which does not include support for capturing video. You will not be able to do this in any current MHP/OCAP imlementation that I know of.
    Steve.

  • Unable to capture video from webcam in JMF

    hi
    I am unable to capture video from webcam in an Xlet. I am using Xletview to run Xlet. The method CaptureDeviceManager.getDeviceList(vidformat) returns empty array. Which videoformat should I use and why do I get empty array?

    MHP and OCAP only use JMF 1.0, which does not include support for capturing video. You will not be able to do this in any current MHP/OCAP imlementation that I know of.
    Steve.

  • Can QT Pro capture streaming video from webcams?

    I'm trying to capture segments of video from the National Geographic's Wildcam Africa, in which they have a live feed of video from a waterhole in Africa 24/7. Can QT Pro do this? (All I can find is info on creating streaming video with QT.)

    SnapZ Pro can create any format of QuickTime when you "finalize" the file. You only get one choice at this step so you must plan ahead.
    If you capture at 640X480 and export to DV Stream you can edit that file with iMovie. Adjust your Display dimensions so your capture gets the biggest version of the on screen area. If the play window is small (most are 320X240) set your Display to 800X600 prior to capture and see if it helps.

  • I Want To Transmit Audio from Mic and Video from WebCam.....???????????????

    I Want To Transmit Audio from Mic and Video from WebCam on Another Computer. I have used AVTransmit2.java file and AVReceive2.java file for Transmission and Receiving but They Transmit Only Video On Another Computer on a network without any error. Any One Help me How Can i Transmit both Audio & Video at the Same time ????????
    i m using This Command for Transmittion
    java AVTransmit2 vfw://0 192.168.0.1 192.168.0.2 10000
    and this Command For Receiving
    java AVReceive2 192.168.0.1/10000 192.168.0.2/ 10002

    Excuse me foro my bad English but I speak English like Tarzan.
    To trasmit both video and audio I created a MergingDataSource wich incorporates video and audio data sources. Then I created a Processor with this DataSource and a RTPManager for each track of the processor. It works.
    Stupendoman

  • View video from webcam while transmitting

    Hi everyone, when I try to use AVTransmit3.java and Clone.java (example from sun) to see video from webcam while transmitting, an error occur:
    {color:#ff0000}+java.lang.NullPointerException+
    at com.sun.media.codec.video.colorspace.RGBConverter.process(RGBConverter.java:352)
    at com.sun.media.BasicFilterModule.process(BasicFilterModule.java:322)
    at com.sun.media.BasicModule.connectorPushed(BasicModule.java:69)
    at com.sun.media.BasicOutputConnector.writeReport(BasicOutputConnector.java:120)
    at com.sun.media.SourceThread.process(BasicSourceModule.java:655)
    at com.sun.media.util.LoopThread.run(LoopThread.java:135){color}
    So I'm only able to see in local my captured video, but cannot transmit.
    I try to debug JMStudio to find how to do this(monitoring transmitted video), but I'm not able to debug it.
    In method private String createProcessor() of AVTransmit3.java I added
    //----------------------------------------------------Start
                clone = Manager.createCloneableDataSource(ds);
                if (clone == null) {
                    System.err.println("Cannot clone the given DataSource");
                    System.exit(0);
                Clone cloneV = new Clone();
                if (!cloneV.open(clone))
                    System.exit(0);             
    //----------------------------------------------------End       
         return null;
        }This is the clone.java from sun
    /* Clone.java
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    *import java.awt.*;
    import javax.media.*;
    import javax.media.protocol.DataSource;
    public class Clone extends Frame implements ControllerListener {
        Player p;
        Object waitSync = new Object();
        boolean stateTransitionOK = true;
         * Given a DataSource, create a player and use that player
         * as a player to playback the media.
        public boolean open(DataSource ds) {
         System.err.println("create player for: " + ds.getContentType());
         try {
             p = Manager.createPlayer(ds);
         } catch (Exception e) {
             System.err.println("Failed to create a player from the given DataSource: " + e);
             return false;
         p.addControllerListener(this);
         // Realize the player.
         p.prefetch();
         if (!waitForState(p.Prefetched)) {
             System.err.println("Failed to realize the player.");
             return false;
         // Display the visual & control component if there's one.
         setLayout(new BorderLayout());
    //     Component cc;
         Component vc;
         if ((vc = p.getVisualComponent()) != null) {
                vc.setSize(176, 144);
             add("Center", vc);
    //     if ((cc = p.getControlPanelComponent()) != null) {
    //         add("South", cc);
         // Start the player.
         p.start();
            this.setSize(176, 144);
         setVisible(true);
         return true;
        public void addNotify() {
         super.addNotify();
         pack();
         * Block until the player has transitioned to the given state.
         * Return false if the transition failed.
        boolean waitForState(int state) {
         synchronized (waitSync) {
             try {
              while (p.getState() < state && stateTransitionOK)
                  waitSync.wait();
             } catch (Exception e) {}
         return stateTransitionOK;
         * Controller Listener.
        public void controllerUpdate(ControllerEvent evt) {
         if (evt instanceof ConfigureCompleteEvent ||
             evt instanceof RealizeCompleteEvent ||
             evt instanceof PrefetchCompleteEvent) {
             synchronized (waitSync) {
              stateTransitionOK = true;
              waitSync.notifyAll();
         } else if (evt instanceof ResourceUnavailableEvent) {
             synchronized (waitSync) {
              stateTransitionOK = false;
              waitSync.notifyAll();
         } else if (evt instanceof EndOfMediaEvent) {
             p.close();
             //System.exit(0);
         } else if (evt instanceof SizeChangeEvent) {
    }Please can you tell me what is wrong?
    thank you in advance

    I post all the class I use in this project.
    Copy and create your own project (SERVER side)
    Then on other pc (CLIENT side) run JMStudio and open RTP transmission: you will receive data but on server you will have a black window.
    I've modified only AVtransmit3.java -> look at Main() and modify dest-ip and port.
    JFrameMain is a class with a button to close the application.
    * @(#)AVTransmit3.java     1.2 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 java.io.*;
    import java.net.InetAddress;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    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 javax.media.rtp.*;
    import javax.media.rtp.rtcp.*;
    import com.sun.media.rtp.*;
    import java.util.Vector;
    public class AVTransmit3 {
        // Input MediaLocator
        // Can be a file or http or capture source
        private MediaLocator locator;
        private String ipAddress;
        private int portBase;
        private Processor processor = null;
        private RTPManager rtpMgrs[];
        private DataSource dataOutput = null;
        private static boolean v = false;  
         private static DataSource ds = null;
            private static DataSource clone;
         private static DataSource cloned;       
        private String VFORMAT = "h263/rtp";   
        private String AFORMAT = "mpegaudio/rtp";   
        public AVTransmit3(MediaLocator locator,
                    String ipAddress,
                    String pb,
                    Format format) {
         this.locator = locator;
         this.ipAddress = ipAddress;
         Integer integer = Integer.valueOf(pb);
         if (integer != null)
             this.portBase = integer.intValue();
         * 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;
              for (int i = 0; i < rtpMgrs.length; i++) {
                  rtpMgrs.removeTargets( "Session ended.");
              rtpMgrs[i].dispose();
    private String createProcessor() {
         if (locator == null)
         return "Locator is null";
         try {
         ds = javax.media.Manager.createDataSource(locator);
         } catch (Exception e) {
         return "Couldn't create DataSource";
         // Try to create a processor to handle the input media locator
         try {
         processor = javax.media.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";
         // Set the output content descriptor to RAW_RTP
         // This will limit the supported formats reported from
         // Track.getSupportedFormats to only valid RTP formats.
         ContentDescriptor cd = new ContentDescriptor(ContentDescriptor.RAW_RTP);
         processor.setContentDescriptor(cd);
         Format supported[];
         Format chosen = null;
         boolean atLeastOneTrack = false;
         // Program the tracks.
         for (int i = 0; i < tracks.length; i++)
    AudioFormat aFormat = new AudioFormat(AFORMAT, 22050.00, 16, 1);
         Format format = tracks[i].getFormat();
         if (tracks[i].isEnabled())
              supported = tracks[i].getSupportedFormats();
              // We've set the output content to the RAW_RTP.
              // So all the supported formats should work with RTP.
              // We'll just pick the first one.
              if (supported.length > 0)
    for(int k = 0; k < supported.length; k++)
    if ((supported[k] instanceof VideoFormat) &&
    (supported[k].getEncoding().equalsIgnoreCase(VFORMAT)))
    // For video formats, we should double check the
    // sizes since not all formats work in all sizes.
    // Choose the H263rtp
    chosen = checkForVideoSizes(tracks[i].getFormat(), supported[k]);
    v = true;
    break;
    else if ((supported[k] instanceof AudioFormat) &&
    (supported[k].matches(aFormat)))
    // For audio formats
    // Choose the H263rtp
    // chosen = supported[3];
    chosen = supported[k];
    v = false;
    break;
              tracks[i].setFormat(chosen);
              System.err.println("Track " + i + " is set to transmit as:");
              System.err.println(" " + chosen);
              atLeastOneTrack = true;
              } else
              tracks[i].setEnabled(false);
         } else
              tracks[i].setEnabled(false);
         if (!atLeastOneTrack)
         return "Couldn't set any of the tracks to a valid RTP format";
         // Realize the processor. This will internally create a flow
         // graph and attempt to create an output datasource for JPEG/RTP
         // audio 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;
    * 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];
         SendStream sendStream;
         int port;
         SourceDescription srcDesList[];
         for (int i = 0; i < pbss.length; i++) {
         try {
              rtpMgrs[i] = RTPManager.newInstance();     
              port = portBase + 2*i;
              // Initialize the RTPManager with the RTPSocketAdapter
              rtpMgrs[i].initialize(new RTPSocketAdapter(
                             InetAddress.getByName(ipAddress),
                             port));
              System.err.println( "Created RTP session: " + ipAddress + " " + port);
              sendStream = rtpMgrs[i].createSendStream(dataOutput, i);          
              sendStream.start();
         } catch (Exception e) {
              return e.getMessage();
         return null;
    * For JPEG and H263, we know that they only work for particular
    * sizes. So we'll perform extra checking here to make sure they
    * are of the right sizes.
    Format checkForVideoSizes(Format original, Format supported) {
         int width, height;
         Dimension size = ((VideoFormat)original).getSize();
         Format jpegFmt = new Format(VideoFormat.JPEG_RTP);
         Format h263Fmt = new Format(VideoFormat.H263_RTP);
         if (supported.matches(jpegFmt)) {
         // For JPEG, make sure width and height are divisible by 8.
         width = (size.width % 8 == 0 ? size.width :
                        (int)(size.width / 8) * 8);
         height = (size.height % 8 == 0 ? size.height :
                        (int)(size.height / 8) * 8);
         } else if (supported.matches(h263Fmt)) {
         // For H.263, we only support some specific sizes.
         if (size.width < 128) {
              width = 128;
              height = 96;
         } else if (size.width < 176) {
              width = 176;
              height = 144;
         } else {
    ///mod          width = 352;
    width = 176;
    ///mod          height = 288;
    height = 144;
         } else {
         // We don't know this particular format. We'll just
         // leave it alone then.
         return supported;
         return (new VideoFormat(null,
                        new Dimension(width, height),
                        Format.NOT_SPECIFIED,
                        null,
                        Format.NOT_SPECIFIED)).intersects(supported);
    * 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 AVTransmit3 class
    public static void main(String [] args) {
         Format fmt = null;
         int i = 0;
    String title = "Video";
    AVTransmit3 at = new AVTransmit3(new MediaLocator("vfw://0"),
                             "192.168.0.5", "44350", fmt);
    //View GUI
    JFrameMain jfm = new JFrameMain(at);
    jfm.setVisible(true);
    jfm.setTitle(title);
    if(title.equals("Video"))
    jfm.setLocation(jfm.getX()+180, jfm.getY());
         // Start the transmission
         String result = at.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...");
    try {
    Thread.sleep(2000);
    } catch (InterruptedException ex) {
    Logger.getLogger(AVTransmit3.class.getName()).log(Level.SEVERE, null, ex);
    if(v)
    //----------------------------------------------------Start
    /* Get a clonable version of our datasource */
    clone = Manager.createCloneableDataSource(ds);
    /* Make sure we got a clonable version before we try to clone it */
    if (clone == null) {
    System.err.println("Cannot get a clonable version of the datasource");
    System.exit(0);
    /* Create the clone of our original datasource */
    DataSource dsClone = ((SourceCloneable)clone).createClone();
    /* Make our DS variable a clone too */
    ds = ((SourceCloneable)clone).createClone();
    /* Make sure the clone happened successfully */
    if (dsClone == null) {
    System.err.println("Could not clone our datasource");
    System.exit(0);
    /* Make sure the clone happened successfully */
    if (ds == null) {
    System.err.println("Could not clone our datasource");
    System.exit(0);
    /* Create a new Clone class */
    Clone cloneV = new Clone();
    /* Open our clone class with our datasource clone */
    if (! cloneV.open(dsClone))
    System.exit(0);
    //----------------------------------------------------End
    /* Clone.java
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    import java.awt.*;
    import javax.media.*;
    import javax.media.protocol.DataSource;
    public class Clone extends Frame implements ControllerListener {
    Player p;
    Object waitSync = new Object();
    boolean stateTransitionOK = true;
    * Given a DataSource, create a player and use that player
    * as a player to playback the media.
    public boolean open(DataSource ds) {
         System.err.println("create player for: " + ds.getContentType());
         try {
         p = Manager.createPlayer(ds);
         } catch (Exception e) {
         System.err.println("Failed to create a player from the given DataSource: " + e);
         return false;
         p.addControllerListener(this);
         // Realize the player.
         p.prefetch();
         if (!waitForState(p.Prefetched)) {
         System.err.println("Failed to realize the player.");
         return false;
         // Display the visual & control component if there's one.
         setLayout(new BorderLayout());
    //     Component cc;
         Component vc;
         if ((vc = p.getVisualComponent()) != null) {
    vc.setSize(176, 144);
         add("Center", vc);
    //     if ((cc = p.getControlPanelComponent()) != null) {
    //     add("South", cc);
         // Start the player.
         p.start();
    this.setSize(176, 144);
         setVisible(true);
         return true;
    public void addNotify() {
         super.addNotify();
         pack();
    * Block until the player has transitioned to the given state.
    * Return false if the transition failed.
    boolean waitForState(int state) {
         synchronized (waitSync) {
         try {
              while (p.getState() < state && stateTransitionOK)
              waitSync.wait();
         } catch (Exception e) {}
         return stateTransitionOK;
    * Controller Listener.
    public void controllerUpdate(ControllerEvent evt) {
         if (evt instanceof ConfigureCompleteEvent ||
         evt instanceof RealizeCompleteEvent ||
         evt instanceof PrefetchCompleteEvent) {
         synchronized (waitSync) {
              stateTransitionOK = true;
              waitSync.notifyAll();
         } else if (evt instanceof ResourceUnavailableEvent) {
         synchronized (waitSync) {
              stateTransitionOK = false;
              waitSync.notifyAll();
         } else if (evt instanceof EndOfMediaEvent) {
         p.close();
         //System.exit(0);
         } else if (evt instanceof SizeChangeEvent) {
    * JFrameMain.java
    * Created on 23 maggio 2008, 17.28
    * @author Giovanni
    public class JFrameMain extends javax.swing.JFrame {
    /** Creates new form JFrameMain */
    public JFrameMain(AVTransmit3 avt) {
    avTransmit = avt;
    initComponents();
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {
    jButtonFine = new javax.swing.JButton();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setResizable(false);
    jButtonFine.setText("Fine Trasmissione");
    jButtonFine.addMouseListener(new java.awt.event.MouseAdapter() {
    public void mousePressed(java.awt.event.MouseEvent evt) {
    jButtonFineMousePressed(evt);
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addContainerGap()
    .addComponent(jButtonFine, javax.swing.GroupLayout.DEFAULT_SIZE, 124, Short.MAX_VALUE)
    .addContainerGap())
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addContainerGap()
    .addComponent(jButtonFine, javax.swing.GroupLayout.DEFAULT_SIZE, 32, Short.MAX_VALUE)
    .addContainerGap())
    setBounds(600, 110, 160, 90);
    }// </editor-fold>
    private void jButtonFineMousePressed(java.awt.event.MouseEvent evt) {                                        
    avTransmit.stop();
    System.exit(0);
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    // new JFrameMain().setVisible(true);
    // Variables declaration - do not modify
    private javax.swing.JButton jButtonFine;
    // End of variables declaration
    private AVTransmit3 avTransmit = null;
    * @(#)RTPSocketAdapter.java     1.2 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.io.IOException;
    import java.net.InetAddress;
    import java.net.DatagramSocket;
    import java.net.MulticastSocket;
    import java.net.DatagramPacket;
    import java.net.SocketException;
    import javax.media.protocol.DataSource;
    import javax.media.protocol.PushSourceStream;
    import javax.media.protocol.ContentDescriptor;
    import javax.media.protocol.SourceTransferHandler;
    import javax.media.rtp.RTPConnector;
    import javax.media.rtp.OutputDataStream;
    * An implementation of RTPConnector based on UDP sockets.
    public class RTPSocketAdapter implements RTPConnector {
    DatagramSocket dataSock;
    DatagramSocket ctrlSock;
    InetAddress addr;
    int port;
    SockInputStream dataInStrm = null, ctrlInStrm = null;
    SockOutputStream dataOutStrm = null, ctrlOutStrm = null;
    public RTPSocketAdapter(InetAddress addr, int port) throws IOException {
         this(addr, port, 1);
    public RTPSocketAdapter(InetAddress addr, int port, int ttl) throws IOException {
         try {
         if (addr.isMulticastAddress()) {
              dataSock = new MulticastSocket(port);
              ctrlSock = new MulticastSocket(port+1);
              ((MulticastSocket)dataSock).joinGroup(addr);
              ((MulticastSocket)dataSock).setTimeToLive(ttl);
              ((MulticastSocket)ctrlSock).joinGroup(addr);
              ((MulticastSocket)ctrlSock).setTimeToLive(ttl);
         } else {
              dataSock = new DatagramSocket(port, InetAddress.getLocalHost());
              ctrlSock = new DatagramSocket(port+1, InetAddress.getLocalHost());
         } catch (SocketException e) {
         throw new IOException(e.getMessage());
         this.addr = addr;
         this.port = port;
    * Returns an input stream to receive the RTP data.
    public PushSourceStream getDataInputStream() throws IOException {
         if (dataInStrm == null) {
         dataInStrm = new SockInputStream(dataSock, addr, port);
         dataInStrm.start();
         return dataInStrm;
    * Returns an output stream to send the RTP data.
    public OutputDataStream getDataOutputStream() throws IOException {
         if (dataOutStrm == null)
         dataOutStrm = new SockOutputStream(dataSock, addr, port);
         return dataOutStrm;
    * Returns an input stream to receive the RTCP data.
    public PushSourceStream getControlInputStream() throws IOException {
         if (ctrlInStrm == null) {
         ctrlInStrm = new SockInputStream(ctrlSock, addr, port+1);
         ctrlInStrm.start();
         return ctrlInStrm;
    * Returns an output stream to send the RTCP data.
    public OutputDataStream getControlOutputStream() throws IOException {
         if (ctrlOutStrm == null)
         ctrlOutStrm = new SockOutputStream(ctrlSock, addr, port+1);
         return ctrlOutStrm;
    * Close all the RTP, RTCP streams.
    public void close() {
         if (dataInStrm != null)
         dataInStrm.kill();
         if (ctrlInStrm != null)
         ctrlInStrm.kill();
         dataSock.close();
         ctrlSock.close();
    * Set the receive buffer size of the RTP data channel.
    * This is only a hint to the implementation. The actual implementation
    * may not be able to do anything to this.
    public void setReceiveBufferSize( int size) throws IOException {
         dataSock.setReceiveBufferSize(size);
    * Get the receive buffer size set on the RTP data channel.
    * Return -1 if the receive buffer size is not applicable for
    * the implementation.
    public int getReceiveBufferSize() {
         try {
         return dataSock.getReceiveBufferSize();
         } catch (Exception e) {
         return -1;
    * Set the send buffer size of the RTP data channel.
    * This is only a hint to the implementation. The actual implementation
    * may not be able to do anything to this.
    public void setSendBufferSize( int size) throws IOException {
         dataSock.setSendBufferSize(size);
    * Get the send buffer size set on the RTP data channel.
    * Return -1 if the send buffer size is not applicable for
    * the implementation.
    public int getSendBufferSize() {
         try {
         return dataSock.getSendBufferSize();
         } catch (Exception e) {
         return -1;
    * Return the RTCP bandwidth fraction. This value is used to
    * initialize the RTPManager. Check RTPManager for more detauls.
    * Return -1 to use the default values.
    public double getRTCPBandwidthFraction() {
         return -1;
    * Return the RTCP sender bandwidth fraction. This value is used to
    * initialize the RTPManager. Check RTPManager for more detauls.
    * Return -1 to use the default values.
    public double getRTCPSenderBandwidthFraction() {
         return -1;
    * An inner class to implement an OutputDataStream based on UDP sockets.
    class SockOutputStream implements OutputDataStream {
         DatagramSocket sock;
         InetAddress addr;
         int port;
         public SockOutputStream(DatagramSocket sock, InetAddress addr, int port) {
         this.sock = sock;
         this.addr = addr;
         this.port = port;
         public int write(byte data[], int offset, int len) {
         try {
              sock.send(new DatagramPacket(data, offset, len, addr, port));
         } catch (Exception e) {
              return -1;
         return len;
    * An inner class to implement an PushSourceStream based on UDP sockets.
    class SockInputStream extends Thread implements PushSourceStream {
         DatagramSocket sock;
         InetAddress addr;
         int port;
         boolean done = false;
         boolean dataRead = false;
         SourceTransferHandler sth = null;
         public SockInputStream(DatagramSocket sock, InetAddress addr, int port) {
         this.sock = sock;
         this.addr = addr;
         this.port = port;
         public int read(byte buffer[], int offset, int length) {
         DatagramPacket p = new DatagramPacket(buffer, offset, length, addr, port);
         try {
              sock.receive(p);
         } catch (IOException e) {
              return -1;
         synchronized (this) {
              dataRead = true;
              notify();
         return p.getLength();
         public synchronized void start() {
         super.start();
         if (sth != null) {
              dataRead = true;
              notify();
         public synchronized void kill() {
         done = true;
         notify();
         public int getMinimumTransferSize() {
         return 2 * 1024;     // twice the MTU size, just to be safe.
         public synchronized void setTransferHandler(SourceTransferHandler sth) {
         this.sth = sth;
         dataRead = true;
         notify();
         // Not applicable.
         public ContentDescriptor getContentDescriptor() {
         return null;
         // Not applicable.
         public long getContentLength() {
         return LENGTH_UNKNOWN;
         // Not applicable.
         public boolean endOfStream() {
         return false;
         // Not applicable.
         public Object[] getControls() {
         return new Object[0];
         // Not applicable.
         public Object getControl(String type) {
         return null;
         * Loop and notify the transfer handler of new data.
         public void run() {
         while (!done) {
              synchronized (this) {
              while (!dataRead && !done) {
                   try {
                   wait();
                   } catch (InterruptedException e) { }
              dataRead = false;
              if (sth != null && !done) {
              sth.transferData(this);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          

  • Capture and Record Video - Helppppppp

    my application capture video from a web cam using WDM.
    when i start my record video function, i got a message "capture device in use".
    how can i capture and record video at same time ???
    is there anybody there that can send me an example????
    thanks a lot..

    There was an example that does this: AVTransmit3.java, try some googling.
    If you do not find, go to: http://www.cs.technion.ac.il/Labs/dsl/projects/JazzEnsemble/completed_projects/IpCTalk.htm
    download the exe file, install it with the source (custom) and have a look at
    MonitorStream.java
    MonitorCDS.java
    CaptureUtil.java and InitVIdeo.java

  • Using Adobe Media Encoder to create H.264, MPEG-2, and WMV videos from After Effects - 6/23/14

    Very disappointed with this choice. I will definitely be seeking to uninstall this version and go back a version or two. Two many extra steps to export an mp4 now. And now we also have to wait longer for a mp4 to render and can't take advantage of the machine's hardware? You guys fighting mp4 as a standard, forcing us to an additional product, or what? I'll be sharing my extreme disappoint with this 'upgrade' with the rest of the developers at work and who just had it installed. I'm not seeing this being too popular opn social media either. Seems like you only did what was best for you.Thanks for showing us who's boss.

    Frank VA wrote:
    And now we also have to wait longer for a mp4 to render and can't take advantage of the machine's hardware?
    Not necessarily. You can render an intermediate codec with AE's render queue (thus using all of AE's power to render) and then drop that file into the Adobe Media Encoder.
    This was the workflow I've always used - even when AE could encode with MP4. Why? Well, because AE sucked at MP4 encoding. You couldn't even do multipass endoding with it!
    This is a useful workflow in a few ways:
    1. You have an archive-quality file to come back to in the future.
    2. You can use AE's full power to render.
    3. You can use AME's superior encoding capabilities.
    4. You can tweak your compression settings and try various encoding parameters to improve the quality while decreasing the bitrate of your product WITHOUT having to re-render the AE comp every time you try since you're working off of the intermediate file. I mean, imagine a comp with several 3d layers, depth of field, shadows from multiple lights, and 250,000 particles from Particular. What if you made an MP4 and then the client needed a smaller file size or the MP4 you made was too heavily compressed and you needed higher quality? I don't know about you, but I'd much rather only render that 18-hour monster once.
    This workflow actually saves time for many people.
    And, in any workflow, this produces a better product.
    Again, this is what I did even when AE could encode MP4's.
    Frank VA wrote:
    You guys fighting mp4 as a standard, forcing us to an additional product, or what?
    They aren't fighting MP4 as a standard, in fact, when Adobe folks pop in here and answer questions, that's often their recommendation for delivery codec.
    Frank VA wrote:
    Seems like you only did what was best for you. Thanks for showing us who's boss.
    Listen, I understand your frustration. Knocking out a quick compressed file from AE for client review is handy.
    However, maintaining the h.264 encoding in AE took up development time. There are only so many person-hours per week for the (relatively tiny) AE team to spend on building each version of AE.
    I never liked AE's h.264 encoding - AME has always done a superior job. Since we have AME to do our encoding, I would rather the AE team focus their effort on improving AE as a compositing and motion graphics tool rather than as an encoding tool.
    Again, I get the frustration. I can see where it feels like they are doing what's good for them and not us, but I think, in the long run, this way is better for us. Right now, the majority of the AE team is working on making AE faster to work with and faster to render. The sooner we get a relatively bug-free version of that, the better! (Especially for folks on Mac OSX Yosemite who can't RAM preview smoothly in any version of AE).
    And at least the After Effects team has been very transparent about things - for example, this blog post talks about their reasoning: using Adobe Media Encoder to create H.264, MPEG-2, and WMV videos from After Effects

  • Migrate tables and stored proc from SQLServer 2005 Express to Oracle10G

    How to migrate tables and stored procedures from SQLServer 2005 Express to Oracle10G using SQLDeveloper? thank you very much

    Using Oracle SQL Developer Migration Workbench
    http://www.oracle.com/technology/tech/migration/workbench/index_sqldev_omwb.html

  • I can't import and view videos from a camera.

    I can't import and view videos from a camera.  Even if I open the file and copy the .avi files onto the hard drive.  I have tried iMovie, Quicktime, and Flip player.  Flip player will open it but I only get the audio,  Quicktime freezes, and iPhoto tries to automatically import only to then error saying the files are not compatible.

    Hello Hese,
    try the following:
    1. delete preferences (com.apple.iMovie.plist) and empty the trash
    2. repair disc permissions with Disc Utility and reboot your mac
    3. use Diskwarrior or MacJanitor for disc clean-up
    4. disconnect any other firewire devices
    5. take off any non-system desktop pictures
    If nothing else helps, you might want to consider resetting your Firewire port(s)
    How to reset your Firewire ports:
    http://discussions.apple.com/thread.jspa?messageID=2001817&#2001817
    hope this helps
    mish

  • I recently updated my IOS software on my IPAD with the latest version and now video from some sites does not run. I did not do the update on my other IPAD and the video runs fine. Any idea why.

    I have an IPAD 3 and recently updated the IOS software with the latest version and now video from some sites will not display where it did prior to the update. When I go to those same sites on my other IPAD that I did not do the softward update the video still works. Any idea why and what to do to fix it?

    Try this  - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.) No data/files will be erased. http://support.apple.com/kb/ht1430http://support.apple.com/kb/ht1430
     Cheers, Tom

  • How to capture and save voice from microphone

    I'm beginner to JMF. I want coding for capturing and saving voice from microphone. Plz anybody help me.

    http://javasolution.blogspot.com/2007/04/voice-chat-using-java.html
    http://www.vsj.co.uk/java/display.asp?id=370

  • How do I access my pictures and home videos from my desktop on my apple TV?  only my music and movies in itunes is showing up.

    How do I access my pictures and home videos from my desktop on my apple TV?  only my music and movies in itunes is showing up.  My icloud pics are coming up but nothing on my desktop.

    You would need to have home sharing enabled on Apple TV and iTunes.
    Setting up Home Sharing for Apple TV (2nd generation and 3rd generation) - Apple Support
    They would be accessed by going to the Computers icon on Apple TV. . Your computer would need to be on and running iTunes.

  • Record Video from Webcam to Local Directory

    I found an example using Flex and AIR to record a video file to a local directory (http://www.zeropointnine.com/blog/webcam-digital-video-recorder-for-air-updated/), but this was essentially a hack that took a snapshot from a webcam at a set interval, eventually cramming the shots together to produce a RAW video file.  While this app produces a decent video file, an audio stream is not captured and the final video file is silent.  The app is also over 2 year old.
    I recently learned that AIR now contains functionality that will allow you to record an audio stream to an MP3 file in a local directory.  Has anyone taken these two ideas and combined them to produce an AIR app that will create a file with both audio and video?
    Thanks.

    Yes! You can do it.
    iMovie 06 http://www.apple.com/support/downloads/imovieHD6.html has a time-lapse feature. (Why doesn't iMovie 08 have this simple feature? I don't know)
    Download iMoive 06 plug in your camera or iSight or use the built-in iSight, select the camera icon, choose time-lapse. Then choose "Capture 2 frames for every 15 frames of video."
    That should net you about 2 frames per second of time-lapse video. Make sure you have enough light out there...
    Have fun.

Maybe you are looking for