May I receive resolution 640*480 in image LV from WEB-camera

Hello all
I have
LV7.1.1
I received
the image from WEB-camera.
WEB-camera
has resolution 640*480 but I have resolution in the Image of LV -  320*240.
May I
receive resolution 640*480 in LV
With respect.
Aleksandr

Hello,
I assume you have to change the settings of the camera and not the code in LabVIEW...
Just in case, see the attached code in LV 7.1.1 that allows to change the image resolution.
Hope this helps
When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"
Attachments:
AC_Util_ResampleImage.vi ‏126 KB

Similar Messages

  • Capture an image using the web camera from a web application

    Hi All,
    Could anyone please share the steps what have to be followed for capture an image using the web camera from a web application.
    I have a similar requirement like this,
    1) Detect the Webcam on the users machine from the web application.(To be more clear when the user clicks on 'Add Photo' tool from the web application)
    2) When the user confirms to save, save the Image in users machine at some temporary location with some unique file name.
    3) Upload the Image to the server from the temporary location.
    Please share the details like, what can be used and how it can be used etc...
    Thanks,
    Suman

    1) Detect the Webcam on the users machine from the web application.(To be more clear when the user clicks on 'Add Photo' tool from the web application)There's not really any good way to do this with JMF. You'd have to somehow create a JMF web-start application that will install the native JMF binaries, and then kick off the capture device scanning code from the application, and then scan through the list of devices found to get the MediaLocator of the web cam.
    2) When the user confirms to save, save the Image in users machine at some temporary location with some unique file name.You'd probably be displaying a "preview" window and then you'd just want to capture the image. There are a handful of ways you could capture the image, but it really depends on your situation.
    3) Upload the Image to the server from the temporary location.You can find out how to do this on google.
    All things told, this application is probably more suited to be a FMJ (Freedom for Media in Java) application than a JMF application. JMF relies on native code to capture from the web cams, whereas FMJ does not.
    Alternately, you might want to look into Adobe Flex for this particular application.

  • I would like to create a pop-up window appear from Labview Interface. In this window, I will have a slide control and an image taken from a camera. The main VI have to run while pop-up window is open. How can I do ?

    When I pushed a button, this pop-up window has to appear. There will be a slide control and a picture from a camera in this window. Is it possible to make appear this windows while main VI Interface continue to run ? How can I do this ? Thank you for your answers.
    Cyril.

    Here you go. This is simple example. Maybe not the best way, I am just
    beginner in LV and still not comfortable with data flow that much. I prefer
    events, so I would change this to use Event Structures.
    When you click on OK button on SliderMain, it opens Slider.vi. Now both
    windows are open and you can interact with both. Now if you click on OK
    again with Slider.vi open, you run into problems. Only thing I did was
    change VI properties of slider.vi, mainly window appearance.
    vishi
    "Cy" wrote in message
    news:[email protected]..
    > I would like to create a pop-up window appear from Labview Interface.
    > In this window, I will have a slide control and an image taken from a
    > camera. The main VI hav
    e to run while pop-up window is open. How can I
    > do ?
    >
    > When I pushed a button, this pop-up window has to appear. There will
    > be a slide control and a picture from a camera in this window. Is it
    > possible to make appear this windows while main VI Interface continue
    > to run ? How can I do this ? Thank you for your answers.
    > Cyril.
    [Attachment SliderMain.vi, see below]
    [Attachment Slider.vi, see below]
    Attachments:
    SliderMain.vi ‏16 KB
    Slider.vi ‏11 KB

  • Warranty on the issue of purple spot in images taken from rear camera?

    My iPhone 5 have purple spot in images taken from rear camera. I just noticed the issue in my phone today.
    I researched online and some people also have the same issue and have their phone replaced in Apple shops.
    I don't have any receipt or store warranty card since it was just given to me as a gift in the Philippines last April 2013, I checked the warranty coverage status (https://selfsolve.apple.com/agreementWarrantyDynamic.do) and it still has repair and service coverage.
    Im now here in Dubai, and my question is that will Apple Premium Reseller shops here in Dubai honor the said warranty and have my iPhone repaired or replaced?

    Im now here in Dubai, and my question is that will Apple Premium Reseller shops here in Dubai honor the said warranty and have my iPhone repaired or replaced?
    No.
    The warranty for an iPhone purchased from an official source in the Philippines will be honored in the Philippines only.

  • How can I get my new ipad 4 to read my compact flash cards? If not can I download the images directly from my camera?

    how can I get my new ipad 4 to read my compact flash cards? If not, can I download the images directly from my camera?

    Tom, thanks for your quick reply. I'm a commerical photographer using Canon 5D mk2's mostly and have in the past just downloaded images to a mac book for backup. I really liked the compact size of the Ipad and just got the retina model with the camera connection kit and seem to be hearing that CF readers can't be used with it b/c they draw too much power. Seems like I remember reading I could use a cord that might have come with my cameras to download directly to the Ipad. I haven't tried it yet as I can't find the connection but then you just said it can't be done? 
       I'm COMPLETLY lost as to your "first pluging in a flash drive to my computer, advice. Do you mean Ipad when you say computer?  "then put your movie/photo files into the folder." HOW????????
         Then plug it into the Ipad??????     TOTALLY lost.
    Also your saying just "do a google search for a reader doesn't work b/c NONE are able to work with the newer Ipads b/c they use TOO much power or so everyone says everyone that have tried.
       Hope you can help a little more b/c I'm really getting frustrated with all the conflicting advice!
    Thanks, Dennis  [email protected]

  • Corrupted image in applet from web cam

    Hi there I created a little webcam server application that listens to port 8080 for requests, then displays an image. The image is jpeg encoded frame grabbed from a logitech web cam using the java media framework. I got the code from this forum.
    I have tried it across a 56kb modem on four different computers. On three the applet displays the images without problems. On the fourth the image is corrupted like it didn't receive all the data.
    Anyone have any idea why this occurs in one and not the others
    Here's some of the source
    The applet just uses getImage( http://[host]:8080 )
    and media tracker with a thread sleeping for a second
    public class WebCamServer extends JFrame
         // class variables
         private HttpServer webserver;
         private int port = 80;
         private ServerSocket server;
         private ImageIcon gfr;
         private Color backcolour = new Color( 255, 255, 255 );     
         private Player player = null;
         private MediaLocator ml = null;
         private JPanel campanel = null;
         public boolean active = false;
         public Buffer buf = null;
         public VideoFormat vf = null;
         public BufferToImage btoi = null;
         public Image img = null;
    public WebCamServer()
              // initialise Frame with this heading and font
              super( "eyespyfx - Web Cam Server" );
              setFont( new Font( "Verdana", Font.PLAIN, 12 ) );
              // initialise web server
              startServer();
              // set up ServerSocket to listen for requests on port 8080
              try
                   server = new ServerSocket( 8080 );
              catch( IOException e )
                   System.err.println( "Server Socket Error" );
                   System.err.println( e.getMessage() );
                   shutdown();
              // set frame icon to gfr.gif
              gfr = new ImageIcon( "gfr.gif" );
              this.setIconImage( gfr.getImage() );
              // get content pane set a layout
              java.awt.Container c = getContentPane();
              c.setLayout( new BorderLayout( 0, 0 ) );
              // create panel to hold web cam image
              campanel = new JPanel();
              campanel.setLayout( new BorderLayout( 0, 0 ) );
              campanel.setPreferredSize( new Dimension( 320, 240 ) );
              // locate web cam from JMF Registry
              ml = new MediaLocator( "vfw://0" );
              // set lightweight renderer for improved framerate
              Manager.setHint( Manager.LIGHTWEIGHT_RENDERER, new Boolean(true) );
              try
                   // create realized video player
                   player = Manager.createRealizedPlayer( ml );
                   //start player
                   player.start();
                   Component comp;
                   // display the visual component
                   if ( ( comp = player.getVisualComponent() ) != null )
                        campanel.add( comp, BorderLayout.CENTER );
              catch (Exception e)
                   System.err.println( "Exception in creating or displaying player" );
                   System.err.println( e.getMessage() );
              // add campanle to the frame
              c.add( campanel, BorderLayout.CENTER );
              // size & colour of frame
              c.setBackground( backcolour );
              setBounds( 0, 0, 0, 0 );
              setResizable( false );
              setSize( 350, 250 );
              show();
              // active set to true - means software is listening for image requests
              active = true;
         // Thread listener for image requests
         public void execute()
              // while active is true          
              while ( active )
                   try
                        // client connects
                        ClientApplet newclient = new ClientApplet( server.accept(), this );
                        // Grab a frame
                        FrameGrabbingControl fgc = (FrameGrabbingControl) player.getControl("javax.media.control.FrameGrabbingControl");
                        buf = fgc.grabFrame();
                        // Convert it to an image
                        btoi = new BufferToImage((VideoFormat)buf.getFormat());
                        img = btoi.createImage(buf);
                        // set client thread with image
                        newclient.setImage( img );
                        // start the client thread
                        newclient.start();
                   catch( IOException e )
                        e.printStackTrace();
                        System.exit( 1 );
    // ClientApplet class to manage each Client Applet as a thread
    class ClientApplet extends Thread
         // class variables
         private Socket connection;
         private PrintWriter out;
         private BufferedReader in;
         private WebCamServer control;
         protected boolean threadSuspended = true;
         public Image img;
         // constructor creates a socket on port 8080
         public ClientApplet( Socket s, WebCamServer t )
              connection = s;          
              control = t;
         // grabbed frame set as output image
         public void setImage( Image img )
              this.img = img;
    public void run()
              // image is buffered to create a 2D graphics object               
              BufferedImage bi = new BufferedImage(240, 180, BufferedImage.TYPE_INT_RGB);
              Graphics2D g2 = bi.createGraphics();
              g2.drawImage(img, null, null);
              OutputStream out = null;
              // create an output stream to the socket
              try
                   out = connection.getOutputStream();
              catch ( IOException io)
                   System.out.println("Error getting socket output stream");
                   System.err.println( io.getMessage() );
              // create jpeg encoder on output stream
              // set the image as a parameter
              JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
              JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(bi);
              param.setQuality(0.25f,false);
              encoder.setJPEGEncodeParam(param);
              // encode the image through the output stream
              // close IO connections
              try
                   encoder.encode(bi);
                   out.close();
                   connection.close();
              catch ( IOException ioe )
                   System.out.println("JPGE IO exception");
                   System.err.println( ioe.getMessage() );
              // end of thread image is served to webpage or applet
    }

    Hi,
    I don't know how to solve this problem,
    but I want to ask you how you managed to get
    FrameGrabbingControl which is not null.
    I use Logitech QickCam and everytime when I try to get a FrameGrabbingControl from the Player it returns me null?
    Can you help me?
    have you any ideas why I get null?
    WebCamLocator - is OK. If I can use it to record a video clip. But I can't take a single frame..
    Manager.setHint( Manager.LIGHTWEIGHT_RENDERER, new Boolean(true) );
    Player WebCamPlayer = Manager.createRealizedPlayer(WebCamLocator);
    WebCamPlayer.start();
    FrameGrabbingControl fgc = (FrameGrabbingControl)WebCamPlayer.getControl("javax.media.control.GrabbingControl");
    Buffer buf = fgc.grabFrame();

  • Dynamic Image Pulled From Web?

    Is there any way to get Keynote to pull an image from a website and put it in a looping presentation and update it every so often?
    I use Keynote for an always looping TV "infochannel" and I'm looking to pull a weather radar image off the web and display it in Keynote.
    I've tried everything I can think of, whatever I try just gets cached into Keynote and the only way to update it is to re-load the presentation, which isn't an option for me.
    Thanks in advance.

    Welcome to the forums, tgolebie.
    Keynote doesn't allow live updating of web content. As you've found, any inserted webview is essentially just a screen capture of the page, with an optional hyperlink to the page. The capture image can be automatically updated when the presentation is opened, but that's about it.
    You might display the weather image in a different application that runs full-screen, and use a timed AppleScript to flip between that app and Keynote by hiding each in turn. But that's kinda kludgy.
    It may be that something like Revolution (which I believe can do live updating of web content) would be more appropriate for this kind of project.

  • I can't import image files from my camera to Photoshop Elements

    My iMac recognizes my camera (a Canon Powershot S100 Digital Elph).  I know this because it automatically starts iPhoto and loads the images.  The problem is, I am sick and tired of iPhoto, and I want to use Photoshop Elements instead.   When I connect the camera to the iMac (via a USB port), I do NOT get a camera icon signifying a new volume or drive on my desktop.  So when I open Photoshop 4.0, I can't find the files to import.  I could allow the computer to import automatically into the iPhoto library, then manually drag the image files into a different directory for use by PSE, but that seems way too complicated.  Why should I have to do that?  Please help if you can.
    John

    I'm using OS X 10.4.11. 
    Maybe I didn't explain it very well.  Let me try again:
    I would like to be able to connect my camera to the USB port of the iMac, turn on the camera, and then view the images from the camera memory on the screen using Bridge (the subroutine for file management in Photoshop Elements).  I have not been able to do that. 
    Instead, my iMac immediately displays the camera images by opening iPhoto.  There is no option in iPhoto for importing the images to anything other than the iPhoto library.  So I have to go find them there, copy them into the directory were I want them, and then erase them from the library (which is a little tricky by itself).  Then I can manage them in Elements/Bridge.
    I thought when I bought Photoshop Elements that I would be able to open it and then tell it to import the images from my camera, into a directory of my choosing.  That would be less error-prone and a lot less work. 

  • I have problems with uploading images to my printing company have the images have been manipulated through CS6 i have saved images as jpeg but the printer company tell me they are not j peg, they will not upload images save from a camera are fine

    I have problems with uploading images to my internet printing company when  the images have been manipulated through CS6 and  i have saved images as jpeg  the printer company tell me they are not j peg,
    but images saved from my phone or camera images that have not been manipulated upload fine, What am i doing wrong?

    Save/Export them as JPG. Photoshop defaults to PSD, so make sure you select JPG and not just rename the file to .jpg.
    There are two ways to save them as JPG: Regular Save as option or Save for Web & Devices
    Take your pick.

  • Images disappered from WebI reports

    Hi,
    No image (any type .gif, .jpg) is getting displayed in Web Intelligence XIR2 reports. The issue is with all the reports and apart from customized logo; default BusinessObjects logo/skin also doesnu2019t get displayed.
    This has happened suddenly (was working previously) however no changes have been done in BO installation or on system. The issue is not user or machine specific, occurs on server as well.
    The images are stored on the required location i.e. Install Dir/Program files/BusunessObjects 11.5/Images on server. Not using clustered environment.
    Please advice.

    Hi Alan,
    Thank you for the response.
    To point out the image URL path I used the following steps:
    1. Place the image in a separate virtual directory and make sure you can access the image file from the browser just by typing in the correct
    URL.                                                                               
    2. Use an absolute path in the Web Intelligence report. For example: http://webserver/images/mylogo.gif  
    However I am getting the following error message:
    'HTTP Status: /images/filename.gif'
    'The requested  resource /images/filename.gif is not available'.
    Please advice.
    Thanks,
    Hitesh

  • How to save image catch from USB camera to database ?

    Hi guys.
    I needed help on IMAQdx tools. But i dont know how to save image that catch from USB camera to database.

    So you can acquire the image OK?
    And you want to save it to a SQL database?
    See here:
    http://zone.ni.com/devzone/cda/epd/p/id/5210

  • Capture images (JPEG) from IP-Camera

    Hey there!
    I have been trying to capture images from an IP-Camera. I understand that this has to be done by using a custom DataSource and I have tried many many example found here on the net, but with no results.
    I think I've tried every piece of code found here at this forum regarding this subject.. :/
    The best I could do was not getting an error while creating a custom DataSource from a BufferedStream..but the when I try to configure/realize the Processor - created with Manager.createProcessor(customdatasource) - it gives me an error which, I think, has something to do with unrecognized content..
    I could post all the examples I tried but I think it would be too much of a confusion so...does anyone have a full working example of code to achieve this? WITH the frame grabber class? plizzzzzzzzz?
    Thanks,
    Edd

    I felt Captfoss' solution was inspired and so gave it a go. The following builds a video from an ip cam jpg stream using a version of Sun's JpegImagesToMovie.java. It is hacked together quickly and with scope for improvement, but it works, proves the idea, and is a good example.
    Run as:- java JpegImagesToMovie -w 320 -h 240 -f 30 -o file:test.avi
    * @(#)JpegImagesToMovie.java     1.3 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.
    * Some public domain modifications by Andy Dyble for avi etc by self and from 
    * other internet resources 19/11/2008. Reads editable 20 ip cam network jpg files.
    * Supported formats tested for compression options. This code could be much improved
    * further to these amendments. Absolutely no warranties. www.exactfutures.com
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.awt.Dimension;
    import javax.media.*;
    import javax.media.control.*;
    import javax.media.protocol.*;
    import javax.media.protocol.DataSource;
    import javax.media.datasink.*;
    import javax.media.format.VideoFormat;
    import javax.media.format.JPEGFormat;
    * This program takes a list of JPEG image files and convert them into
    * a QuickTime movie.
    public class JpegImagesToMovie implements ControllerListener, DataSinkListener {
        public boolean doIt(int width, int height, int frameRate, Vector inFiles, MediaLocator outML, String outputURL)
         ImageDataSource ids = new ImageDataSource(width, height, frameRate, inFiles);
         Processor p;
         try {
             System.err.println("- create processor for the image datasource ...");
             p = Manager.createProcessor(ids);
         } catch (Exception e) {
             System.err.println("Yikes!  Cannot create a processor from the data source.");
             return false;
         p.addControllerListener(this);
         // Put the Processor into configured state so we can set
         // some processing options on the processor.
         p.configure();
         if (!waitForState(p, p.Configured)) {
             System.err.println("Failed to configure the processor.");
             return false;
         // Set the output content descriptor to QuickTime.
         if(outputURL.endsWith(".avi") || outputURL.endsWith(".AVI"))
              p.setContentDescriptor(new ContentDescriptor(FileTypeDescriptor.MSVIDEO));
         if(outputURL.endsWith(".mov") || outputURL.endsWith(".MOV"))
              p.setContentDescriptor(new ContentDescriptor(FileTypeDescriptor.QUICKTIME));
         // Query for the processor for supported formats.
         // Then set it on the processor.
         TrackControl tcs[] = p.getTrackControls();
         for(int i=0;i<tcs.length;i++)
              System.out.println("TrackControl "+i+" "+tcs);
         Format f[] = tcs[0].getSupportedFormats();
         if (f == null || f.length <= 0) {
         System.err.println("The mux does not support the input format: " + tcs[0].getFormat());
         return false;
         for(int i=0;i<f.length;i++)
              System.out.println("Supported Format "+i+" "+f[i]);
    //     tcs[0].setFormat(f[0]);
         if(outputURL.endsWith(".avi") || outputURL.endsWith(".AVI"))     // must be VideoFormat
              System.err.println("Setting the track format to: "     // INDEO50 CINEPAK f[0] etc
                   + tcs[0].setFormat(new VideoFormat(VideoFormat.INDEO50)));
         if(outputURL.endsWith(".mov") || outputURL.endsWith(".MOV"))
              System.err.println("Setting the track format to: "     // JPEG CINEPAK RGB f[0] etc
                   + tcs[0].setFormat(new VideoFormat(VideoFormat.JPEG)));
         //System.err.println("Setting the track format to: " + f[0]);
         // We are done with programming the processor. Let's just
         // realize it.
         p.realize();
         if (!waitForState(p, p.Realized)) {
         System.err.println("Failed to realize the processor.");
         return false;
         // Now, we'll need to create a DataSink.
         DataSink dsink;
         if ((dsink = createDataSink(p, outML)) == null) {
         System.err.println("Failed to create a DataSink for the given output MediaLocator: " + outML);
         return false;
         dsink.addDataSinkListener(this);
         fileDone = false;
         System.err.println("start processing...");
         // OK, we can now start the actual transcoding.
         try {
         p.start();
         dsink.start();
         } catch (IOException e) {
         System.err.println("IO error during processing");
         return false;
         // Wait for EndOfStream event.
         waitForFileDone();
         // Cleanup.
         try {
         dsink.close();
         } catch (Exception e) {}
         p.removeControllerListener(this);
         System.err.println("...done processing.");
         return true;
    * Create the DataSink.
    DataSink createDataSink(Processor p, MediaLocator outML) {
         DataSource ds;
         if ((ds = p.getDataOutput()) == null) {
         System.err.println("Something is really wrong: the processor does not have an output DataSource");
         return null;
         DataSink dsink;
         try {
         System.err.println("- create DataSink for: " + outML);
         dsink = Manager.createDataSink(ds, outML);
         dsink.open();
         } catch (Exception e) {
         System.err.println("Cannot create the DataSink: " + e);
         return null;
         return dsink;
    Object waitSync = new Object();
    boolean stateTransitionOK = true;
    * Block until the processor has transitioned to the given state.
    * Return false if the transition failed.
    boolean waitForState(Processor p, 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) {
         evt.getSourceController().stop();
         evt.getSourceController().close();
    Object waitFileSync = new Object();
    boolean fileDone = false;
    boolean fileSuccess = true;
    * Block until file writing is done.
    boolean waitForFileDone() {
         synchronized (waitFileSync) {
         try {
              while (!fileDone)
              waitFileSync.wait();
         } catch (Exception e) {}
         return fileSuccess;
    * Event handler for the file writer.
    public void dataSinkUpdate(DataSinkEvent evt) {
         if (evt instanceof EndOfStreamEvent) {
         synchronized (waitFileSync) {
              fileDone = true;
              waitFileSync.notifyAll();
         } else if (evt instanceof DataSinkErrorEvent) {
         synchronized (waitFileSync) {
              fileDone = true;
              fileSuccess = false;
              waitFileSync.notifyAll();
         public static void createInputFiles(Vector files)
              // Create a file for the directory
              File file = new File("images");
              // Get the file list...
              String s[] = file.list();
              files.removeAllElements();     // if any set from arguments
              for(int i=0;i<s.length;i++)
                   if(s[i].indexOf(".jp")!=-1)
                        files.addElement("images"+File.separator+s[i]);     // and to sort if required
                   else
                        System.out.println((i+1)+": "+s[i]+" - ignored");
    public static void main(String args[]) {
         if (args.length == 0)
         prUsage();
         // Parse the arguments.
         int i = 0;
         int width = -1, height = -1, frameRate = 1;
         Vector inputFiles = new Vector();
         String outputURL = null;
         while (i < args.length) {
         if (args[i].equals("-w")) {
              i++;
              if (i >= args.length)
              prUsage();
              width = new Integer(args[i]).intValue();
         } else if (args[i].equals("-h")) {
              i++;
              if (i >= args.length)
              prUsage();
              height = new Integer(args[i]).intValue();
         } else if (args[i].equals("-f")) {
              i++;
              if (i >= args.length)
              prUsage();
              frameRate = new Integer(args[i]).intValue();
         } else if (args[i].equals("-o")) {
              i++;
              if (i >= args.length)
              prUsage();
              outputURL = args[i];
         } else {
              inputFiles.addElement(args[i]);
         i++;
    ///     createInputFiles(inputFiles);
         if (outputURL == null)// || inputFiles.size() == 0)
         prUsage();
         // Check for output file extension.
         if(!outputURL.endsWith(".avi") && !outputURL.endsWith(".AVI") && !outputURL.endsWith(".mov") && !outputURL.endsWith(".MOV"))
              System.err.println("The output file extension should end with a .mov extension");
              prUsage();
         if (width < 0 || height < 0) {
         System.err.println("Please specify the correct image size.");
         prUsage();
         // Check the frame rate.
         if (frameRate < 1)
         frameRate = 1;
         // Generate the output media locators.
         MediaLocator oml;
         if ((oml = createMediaLocator(outputURL)) == null) {
         System.err.println("Cannot build media locator from: " + outputURL);
         System.exit(0);
         JpegImagesToMovie imageToMovie = new JpegImagesToMovie();
         imageToMovie.doIt(width, height, frameRate, inputFiles, oml, outputURL);
         System.exit(0);
    static void prUsage() {
         System.err.println("Usage: java JpegImagesToMovie -w <width> -h <height> -f <frame rate> -o <output URL>");// <input JPEG file 1> <input JPEG file 2> ...");
         System.exit(-1);
    * Create a media locator from the given string.
    static MediaLocator createMediaLocator(String url) {
         MediaLocator ml;
         if (url.indexOf(":") > 0 && (ml = new MediaLocator(url)) != null)
         return ml;
         if (url.startsWith(File.separator)) {
         if ((ml = new MediaLocator("file:" + url)) != null)
              return ml;
         } else {
         String file = "file:" + System.getProperty("user.dir") + File.separator + url;
         if ((ml = new MediaLocator(file)) != null)
              return ml;
         return null;
    // Inner classes.
    * A DataSource to read from a list of JPEG image files and
    * turn that into a stream of JMF buffers.
    * The DataSource is not seekable or positionable.
    class ImageDataSource extends PullBufferDataSource {
         ImageSourceStream streams[];
         ImageDataSource(int width, int height, int frameRate, Vector images) {
         streams = new ImageSourceStream[1];
         streams[0] = new ImageSourceStream(width, height, frameRate, images);
         public void setLocator(MediaLocator source) {
         public MediaLocator getLocator() {
         return null;
         * Content type is of RAW since we are sending buffers of video
         * frames without a container format.
         public String getContentType() {
         return ContentDescriptor.RAW;
         public void connect() {
         public void disconnect() {
         public void start() {
         public void stop() {
         * Return the ImageSourceStreams.
         public PullBufferStream[] getStreams() {
         return streams;
         * We could have derived the duration from the number of
         * frames and frame rate. But for the purpose of this program,
         * it's not necessary.
         public Time getDuration() {
         return DURATION_UNKNOWN;
         public Object[] getControls() {
         return new Object[0];
         public Object getControl(String type) {
         return null;
    * The source stream to go along with ImageDataSource.
    class ImageSourceStream implements PullBufferStream {
         Vector images;
         int width, height;
         VideoFormat format;
         int nextImage = 0;     // index of the next image to be read.
         boolean ended = false;
         float frameRate;
         long seqNo = 0;
         public ImageSourceStream(int width, int height, int frameRate, Vector images) {
         this.width = width;
         this.height = height;
         this.images = images;
              this.frameRate = (float)frameRate;
         format = new VideoFormat(VideoFormat.JPEG,
                        new Dimension(width, height),
                        Format.NOT_SPECIFIED,
                        Format.byteArray,
                        (float)frameRate);
         * We should never need to block assuming data are read from files.
         public boolean willReadBlock() {
         return false;
    byte[] input_buffer;
    byte[] imgbytearray;
    byte[] imgusebyte;
    int camWidth = 320;
    int camHeight = 240;
    URL url;
    long timeStamp;long timeStamp0=System.currentTimeMillis();long resultTimeStamp;
         public boolean urlFetchJPG()
              String ipcamserver = "146.176.65.10";     // examples 146.176.65.10 , 62.16.100.204 , 194.168.163.96 , 84.93.217.139 , 194.177.131.229 , 148.61.171.201
              try
                   url = new URL("http://"+ipcamserver+"/axis-cgi/jpg/image.cgi?camera=&resolution=320x240".trim());
              catch(Exception e){System.out.println("Exception url "+e);}
              try
                   if(input_buffer==null)input_buffer = new byte[8192];
                   if(imgbytearray==null)imgbytearray = new byte[camWidth*camHeight*3];
                   URLConnection uc = url.openConnection();
                   uc.setUseCaches(false);
                   //uc.setDoInput(true);
                   //uc.setRequestProperty("accept","image/jpeg,text/html,text/plain");
                   BufferedInputStream in;
                   int bytes_read;
                   int sumread=0;
                   in = new BufferedInputStream(uc.getInputStream());
                   while((bytes_read=in.read(input_buffer, 0, 8192))!=-1)
                        if(sumread+bytes_read>imgbytearray.length)
                             byte[] imgbytearraytemp = new byte[sumread+bytes_read+8192];
                             System.arraycopy(imgbytearray,0,imgbytearraytemp,0,imgbytearray.length);
                        System.arraycopy(input_buffer,0,imgbytearray,sumread,bytes_read);
                        sumread=sumread+bytes_read;
                   in.close();
                   imgusebyte = new byte[sumread];
                   System.arraycopy(imgbytearray,0,imgusebyte,0,sumread);
              catch(Exception e){System.out.println("Exception urlFetchJPG "+e);}
              return true;
         * This is called from the Processor to read a frame worth
         * of video data.
         public void read(Buffer buf) throws IOException {
         // Check if we've finished all the frames.
         if (nextImage >= 20) //images.size())
              // We are done. Set EndOfMedia.
              System.err.println("Done reading all images.");
              buf.setEOM(true);
              buf.setOffset(0);
              buf.setLength(0);
              ended = true;
              return;
    ///     String imageFile = (String)images.elementAt(nextImage);
         nextImage++;
    //     System.err.println(" - reading image file: " + imageFile);
         // Open a random access file for the next image.
    ///     RandomAccessFile raFile;
    ///     raFile = new RandomAccessFile(imageFile, "r");
         byte data[] = null;
         // Check the input buffer type & size.
    ///     if (buf.getData() instanceof byte[])
    ///          data = (byte[])buf.getData();
              urlFetchJPG();
              data = imgusebyte;
         // Check to see the given buffer is big enough for the frame.
    ///     if (data == null || data.length < raFile.length()) {
    ///          data = new byte[(int)raFile.length()];
              buf.setData(data);
         // Read the entire JPEG image from the file.
    ///     raFile.readFully(data, 0, (int)raFile.length());
    //     System.err.println(" read " + raFile.length() + " bytes.");
         buf.setOffset(0);
    ///     buf.setLength((int)raFile.length());
              buf.setLength(data.length);
         buf.setFormat(format);
         buf.setFlags(buf.getFlags() | buf.FLAG_KEY_FRAME);
    ///          long time = (long)(seqNo * (1000D / frameRate) * 1000000);
              timeStamp = System.currentTimeMillis();
              resultTimeStamp = timeStamp - timeStamp0;
              long time = resultTimeStamp * 0xf4240L;
              buf.setTimeStamp(time);
              buf.setSequenceNumber(seqNo++);
         // Close the random access file.
    ///     raFile.close();
         * Return the format of each video frame. That will be JPEG.
         public Format getFormat() {
         return format;
         public ContentDescriptor getContentDescriptor() {
         return new ContentDescriptor(ContentDescriptor.RAW);
         public long getContentLength() {
         return 0;
         public boolean endOfStream() {
         return ended;
         public Object[] getControls() {
         return new Object[0];
         public Object getControl(String type) {
         return null;
    {code}

  • Is it possible to animate videos and images coming from web service.

    i am calling a webservice. from that i am getting response. in that i have images and videos. i took those in an array. Now i need to animate those array values. just like animating images. So please tell me is it possible to animate videos are not. if yes how?

    Then, if it's not self-powered and you don't have a USB hub to power it, it's impossible.
    If you DO have a hub, give it a try. If the HDD is formatted in FAT32 or other, iOS-friendly formats (NOT NTFS!), you may be able to import videos / pics from it so that you can access them as imported media files.

  • Best way to save images streamed from web to device?

    We have an app for browsing a catalog that streams content from a web server. There is an image for each product, some in JPG format and some in PNG format. Our server is fast and reliable so everything has been running smoothly so far, but we'd like to give users the option of saving the data to their device so they don't have to stream every time. I've only worked with SharedObjects before, which are capped at 100kb and won't be useful in this situation.
    What would be the best approach for storing the images, and keeping them from being overwritten during updates? Saving an uncompressed Bitmap will use too much storage space. Adobe's JPEGEncoder class is completely useless as it takes 10-30 seconds to save a moderately-sized image on a typical device. It also doesn't make sense to re-encode the JPGs, and we need to preserve the transparency in the PNGs.
    Right now we're using a Loader to retrieve the images and using loader.content to access the image data in code. Is it possible to save the image file in its original format locally when it is downloaded with a Loader? We would want the images stored in the application data and not accessible through the gallery. As for saving the data for each product (e.g. price, description, etc), would the built-in SQLite support be sufficient or should we create our own files?
    Thanks for any tips!

    We typically use a native extension to do this, but it is certainly possible in ActionScript.
    When the file has been downloaded, we save it to the applicationStorageDirectory.
    Next time, we check to see if exists locally, if so - use that and don't download.
       var file:String = renameFile(_externalHttpImage);
       //see if we already have a copy of the image
       var loader:Loader = new Loader();
       var ba:ByteArray = new ByteArray();
       if( fileExists(file)){
        file = File.applicationStorageDirectory.resolvePath(file).nativePath;
        loader.contentLoaderInfo.addEventListener(Event.COMPLETE, local_loader_complete);
        loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorOnChargeFile);
        var f:File = File.applicationStorageDirectory.resolvePath(file);
        if( f.exists){
         var fs:FileStream;
         try {
          //now load the size of the file
          fs = new FileStream();
          fs.open(f, FileMode.READ);
          fs.readBytes(ba);
          //  trace("READ " + fs.readUTF());
          fs.close();
         catch(e:Error){
          trace( "Error Loading Image File  '" +file + ": " +  e.message+ "\n"+ e.getStackTrace());
        loader.loadBytes(ba);

  • How to animate images coming from web service in iphone sdk.

    this is my code check once and give me reply.
    - (void)parserDidEndDocument:(NSXMLParser *)parser{
        moreListTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 10, 320, 350) style:UITableViewStylePlain];
        moreListTableView.delegate = self;
        moreListTableView.dataSource = self;
        [self.view addSubview:moreListTableView];
        for(i=0; i < [advImagesList count]; i++){
            NSString *data=[[NSString alloc]initWithFormat:[advImagesList objectAtIndex:i]];
            Byte inputData[[data lengthOfBytesUsingEncoding:NSUTF8StringEncoding]];
            [[data dataUsingEncoding:NSUTF8StringEncoding] getBytes:inputData];
            size_t inputDataSize=(size_t)[data length];
            size_t outputDataSize=EstimateBas64DecodedDataSize(inputDataSize);
            Byte outputData[outputDataSize];
            Base64DecodeData(inputData, inputDataSize, outputData, &outputDataSize);
            NSData *theData=[[NSData alloc]initWithBytes:outputData length:outputDataSize];
            imgview=[[UIImageView alloc]initWithImage:[UIImage imageNamed:data]];
            imgview.frame=CGRectMake(0, 317, 320, 50);
            imgview.image=[UIImage imageWithData:theData];
            [self.view addSubview:imgview];
        Timer = [NSTimer scheduledTimerWithTimeInterval:.1 target:self selector:@selector(moveRect) userInfo:nil repeats:YES];
    -(void)moveRect
      //  imgview.animationImages=advImagesList;
        [imgview startAnimating];
        [imgview setAnimationDuration:2];

    This is a user forum.  Try developer.apple.com.

Maybe you are looking for

  • Crystal report 9 Sql Server 2008 R2 compatability

    Can we use Crystal report version 9 in Sql server 2008 R2 to generate reports in web server. Kindly tell us about the compatability of  these two. If there is any support issue between these two kindly mention the same. Edited by: Deepan1 on Jun 7, 2

  • Time machine corrupted sparsebundle? how to repair? time machine restore not working

    On my macbook pro, after starting with Cmd-R, I erased the hard disk, re-installed Mavericks and I want to restore my back up with Time Machine. I select the NAS where the backup is, it sees the backup file but it says: "There is a problem with this

  • Loop is better or while is better for lakhs of records?

    hi experts,............... let us suppose we have lakhs of records in then using loop is better or while is better? instead of using loop inside the loop what we will use? thanks in adavance

  • Time Capsule backup keeps growing even though I have no data!

    I have just bought a new 2TB Time Capsule. I set up Time Machine to backup my hard drive and two USB disk drives that hold music and film. The initial backup seem to work fine - but every incremental backup then repeats large chunks of the backup. In

  • Linksys WRT54G & additional Router

    I have had a WRT54G network working for the past two years with no problems. However I have now purchased a Freecom FSG combined router & harddisk, as I wanted a networked HD. I configured this router up as per the Freecom instructions, giving the WA