Save the capture from a WebCam to a file

Hi!
I am trying to save the capture from a webcam to a file. This should be really easy but I have this stack trace when closing the Processor:
java.lang.NullPointerException
     at com.sun.media.multiplexer.video.AVIMux.writeFooter(AVIMux.java:827)
     at com.sun.media.multiplexer.BasicMux.close(BasicMux.java:142)
     at com.sun.media.BasicMuxModule.doClose(BasicMuxModule.java:172)
     at com.sun.media.PlaybackEngine.doClose(PlaybackEngine.java:872)
     at com.sun.media.BasicController.close(BasicController.java:261)
     at com.sun.media.BasicPlayer.doClose(BasicPlayer.java:229)
     at com.sun.media.BasicController.close(BasicController.java:261)
     at com.mdarveau.WebCamGrabber.TestWebCam.<init>(TestWebCam.java:47)
     at com.mdarveau.WebCamGrabber.TestWebCam.main(TestWebCam.java:59)Any idea why? It is probably something stupid in my code but I can't find it!
Here is the code:
    //Get the original source
    CaptureDeviceInfo webCam = CaptureDeviceManager.getDevice("vfw:Video Blaster WebCam 3/WebCam Plus (VFW):1");
    DataSource cam = Manager.createDataSource(webCam.getLocator());
    cam.connect();
    Format [] formats = {new VideoFormat(null) };
    FileTypeDescriptor ftd = new FileTypeDescriptor("video.x_msvideo");
    ProcessorModel pm = new ProcessorModel(cam, formats, ftd);
    Processor p = Manager.createRealizedProcessor(pm);
    MediaLocator save = new MediaLocator("file:test.avi");
    DataSink datasink = Manager.createDataSink(p.getDataOutput(), save);
    datasink.open();
    datasink.start();
    Thread.sleep(5000);
    p.stop();
    p.close();
    datasink.close();Thanks!
Manuel Darveau

I think you should start the processor, just after the datasink is started.
datasink.satrt();
p.start();
Try it and ask again if it's not the problem.

Similar Messages

  • How can i save the data from the Oracle database to my local directory

    How can i save the data from the Oracle database to my local directory instead Of saving the data file to the Directory created on the Oracle Server ?
    I require to design the Procedure which will pull the data from various tables and needs to store the data in the Client's local directory.

    Since SQL*PLUS runs on the client, you can use SQL*PLUS to spool data to your local drive.
    You could also use the database to write a a specified drive where all users have access to (mapped network drive, e.g.). I wouldn't recommend doing it that way, but it is sometimes useful when the files are created in some nightly batch run.

  • Trying to save the data from the pdf into XML

    I have Adobe Live Cycle 8.0 installed and without the blade for Reader Extension.
    The objective is to save the editable data from the pdf into a XML file
    the code for that is:
    // to fetch the input pdf file from the local drive
    FileInputStream fileInputStream2 = new FileInputStream("C:\\Adobe-Final PDF\\stitched_Letters.pdf");
    Document inPDF = new Document(fileInputStream2);
    Properties connectionProps=new Properties();
    connectionProps.load(new FileInputStream(_propertiesPath));
    //propertiesPath is the path of the properties file
    ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);
    FormDataIntegrationClient dataClient = new FormDataIntegrationClient(myFactory);
    Document resultPDF=dataClient.exportData(inPDF);
    What happens is that this ultimate resultPDF does not get the XML with data but rather with empty tags. Does this require Reader Extension?

    //Set connection properties required to invoke LiveCycle ES
    Properties connectionProps = new Properties();
    connectionProps.setProperty("DSC_DEFAULT_EJB_ENDPOINT", "jnp://localhost:1099");
    connectionProps.setProperty("DSC_TRANSPORT_PROTOCOL","EJB");
    connectionProps.setProperty("DSC_SERVER_TYPE", "JBoss");
    connectionProps.setProperty("DSC_CREDENTIAL_USERNAME", "administrator");
    connectionProps.setProperty("DSC_CREDENTIAL_PASSWORD", "password");
    //Create a ServiceClientFactory object
    ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);
    //Create a FormDataIntegrationClient object
    FormDataIntegrationClient dataClient = new FormDataIntegrationClient(myFactory);
    //Reference a PDF form from which to export data
    FileInputStream fileInputStream2 = new FileInputStream("C:\\Adobe\\Loan.pdf");
    Document inputPDF = new Document(fileInputStream2);
    //Export data from the form
    Document resultPDF = dataClient.exportData(inputPDF);
    //Save the exported form data as an XML file
    File resultFile = new File("C:\\Adobe\\formData.xml");
    resultPDF.copyToFile(resultFile);
    }catch (Exception e) {
    e.printStackTrace();

  • How to save the string from JTextFied to database?

    can i know how to save the data from JTextFied to databse. Is it using update?

    The most straightforward way would be something like:
    String myKey=myKeyField.getText();
    String foo=fooField.getText();
    String sql="update mytable set foo='"+foo+"' where mykey='"+myKey+"'";
    connection.createStatement().executeUpdate(sql);
    This example assumes that the input fields cannot possibly contain quotes or the string won't be built correctly. Which by the way brings up a question I'd be interested in hearing others answer: What do you do about this? Sometimes I use PreparedStatement which handles that problem, other times I write my own little function to escape the string properly.
    You can also read the record into a ResultSet and use ResultSet.update(). I'm mostly using mySql and I found that in mySql ResultSet.update just creates a SQL update statement like I did above and executes it, so the only real advantage would be if you find the syntax more convenient. Perhaps other database drivers do something different that would give other pros and cons.

  • Procedure to save the output of a query into excel file or flat file

    Procedure to save the output of a query into excel file or flat file
    I want to store the output of my query into a file and then export it from sql server management studio to a desired location using stored procedure.
    I have run the query --
    DECLARE @cmd VARCHAR(255)
    SET @cmd = 'bcp "select * from dbo.test1" queryout "D:\testing2.xlsx;" -U "user-PC\user" -P "" -c '
    Exec xp_cmdshell @cmd
    error message--
    SQLState = 28000, NativeError = 18456
    Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'user-PC\user'.
    NULL
    Goel.Aman

    Hello,
    -T:
    Specifies that the bcp utility connects to SQL Server with a trusted connection using integrated security. The security credentials of the network user,
    login_id, and password are not required. If
    –T is not specified, you need to specify
    –U and –P to successfully log in.
    -U:
    Specifies the login ID used to connect to SQL Server.
    Note: When the bcp utility is connecting to SQL Server with a trusted connection using integrated security, use the
    -T option (trusted connection) instead of the
    user name and password combination
    I would suggest you take a look at the following article:
    bcp Utility: http://technet.microsoft.com/en-us/library/ms162802.aspx
    A similar thread regarding this issue:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/b450937f-0ef5-427a-ae3b-115335c0d83c/bcp-connection-error-sqlstate-28000-nativeerror-18456?forum=sqldataaccess
    Regards,
    Elvis Long
    TechNet Community Support

  • Is there any way I can convert a .exe file to .iso on my MacBook Air? I'm trying to install Windows via BootCamp but the download from Microsoft is a .exe file which does me no good.

    I'm trying to install Windows 8 via Boot Camp, but the download from Microsoft is a .exe file so when I go to create the bootable USB drive, it fails. I've read some of the other threads about this topic, but I want to know if there is any way to convert to .iso without having to find someone's Windows computer to borrow. Can anyone help?

    No. You would require a PC in order to run the executable which is an installer, not a disc image or an archive.

  • Is there anyway to pull the data from an iPhone/iTunes backup file?

    Is there anyway to pull the data from an iPhone/iTunes backup file so it can be read and imported into a DROID phone. Have a customer with a dead iPhone and they went out and purchased a DROID as a replacement and would like all their contacts to be imported into the DRIOD. Is there any software out there that can do this?

    Here is one that can at least get at the data: iPhone Backup Extractor
    There may well be others of better value. Google is your friend.
    You'll probably need to do something with the data you can extract, like add it to Outlook, rather than being able to send it directly to the driod.
    tt2

  • Transmiting video captured from a webcam to another system through internet

    Hi there, I developed an application catch video stream from the webcam and transmit it another system within LAN network , I would like know possibility to senting it over internet to another system?? is it possible sent this streams to more than one location simultaneously. Any idea?
    Best regards
    anoop

    hi tony
    Thank you very much for reply, I very appreciate this.for tansnsmitting video using rtp protocol we need to specify the network output for media transmission(ie Medialocator).what i mean is we need to create a medialocator specifing the destination of our broadcast. which look like a typical url rtp://address:port/content-type ,here the address is the address to which video must be tansmitted.to transmit in unicast mode this address should be the address of the intended machine.its working fine.to transmit in mulitcast mode with a subnet we can do this by replacing 255 with last field of the address part.it also working fine within subnet so that we can display video captured from one cam to multiple destination
    ** this is the real problem whcih i m facing now is how to make it to work in internet? to mutliple destination? whether i need to create multiple medialocator url??? anybody have any idea? plz help thanking u in advance?
    anoop

  • Is there a way to mass export/save the reports from database to server

    Hi Everyone,
    Hope all is well,
    We use Discoverer to report off of an ODS. We are moving from ODS 3.1 to ODS 8.
    Is there a way to mass download the reports into ODS 8.
    My idea at this time, would be to individually save as the query to a folder on server.
    Then open another Discoverer instance, sign to ODS 8, open the query from server and do save as to database.
    This would take time ....
    Please advise with your thoughts and ideas, tx, sandra

    hi sandra,
    This question can be answered by Michael,he is expertise in sungard banner.
    By,
    Kranthi.

  • HT1766 How do I save the music from my iphone 5c to my laptop?

    Hi,
    How do I save the the music from my iphone 5c to my laptop?
    Thank you.

    Hello daisyruth,
    If the music on your iPhone 5c was purchased from iTunes there are two different ways to get this music to your iTunes library. You can either connect your iPhone to iTunes and transfer the purchases or you can download your purchases directly to your iTunes library from the iTunes program itself. The following articles will help you get that music to your computer.
    iTunes Store: Transferring purchases from your iOS device or iPod to a computer
    http://support.apple.com/kb/ht1848
    Download past purchases
    http://support.apple.com/kb/ht2519
    Thanks for reaching out,
    -Joe

  • IW22 notification - to save the text from text editor to database

    Hi,
    In Iw21/22/23 notification screens are configured to custom screens.. and these screens are having text editors.... when i write some text in editor and try to save the notification.. the text should get saved so that i can see it nxt when i display the notification....
    Please suggest any ideas...
    I thought of saving in table in PAI... but it doesnt come to the event.....  and if i try to use an enhancement while saving.... that enhancement should consider the data with respect to tabs... and save differently
    please suggest..
    Edited by: Poonam 24 on Oct 9, 2011 7:55 AM

    First you need to retrieve the contents from the text editor (jn PBO) e.g.
    * Retrieve text currently inside the textedit control
      data:
        lt_text             type tdline occurs 10.
          call method go_d9999_textedit->get_text_as_r3table
            importing
              table                  = lt_text
            exceptions
              error_dp               = 1
              error_cntl_call_method = 2
              error_dp_create        = 3
              potential_data_loss    = 4
              others                 = 5.
    and then persist the "lt_text" contents, e.g. you could use functions from the STXD group (e.g. SAVE_TEXT) or your own table that would need to have something like
    MANDT    "key - client
    LINK_KEY "key - whatever you are are linking this text to
    SEQ      "key - one row of text
    TEXTLINE
    (the first three columns would be the primary key per row of text).
    Jonathan

  • How to save the data from AI Read.vi?

    Hi,
    The main target is that testing the strength of a object which is extended by a force. The desired results are
    1. The strength of object under the force(main target, I am trying now);
    2. Displacement of object being extended(I have mimicly done);
    3. Images of deformation of the object extended(I have mimicly done).
    4. The sub procedure will stop when the object under testing is broken. I intend to use the big pulse from force sensor by analizing the data acquired.( it is more difficult if using machine vision).
    What I am mainly trying to do now is implementation of a sub vi to collect the data which is acquired from channel 0 of PCI-6052E which is connected to a force sensor. I have tried to use an existing exam
    ple as attached with some modifications. I have tested the data from the sensor by comparing to measurement by multimeter and it takes sense. But
    1. I still don't know how to save data displayed by AI Read.vi? And use what kind data type could save more memory?
    2. I think that memory management is very important because each points of the result includes its strength, image and displacement. How can I acquire enough significant points for the final results being reliable and save these data down to an array or cluster synchronously? (each sub procedure has no time limited)
    3.Because I think that a continuous data acquisition would occupy ALL CPU TIME and their related images and displacements would have no chance to be taken down by CPU at the same moment. Am I right?--I am sure that it is not very difficult problem but my mind is still in caose and the time is quite limited to me now.
    I am looking for your sugguestion or solution or control philosophy too. You can modify the fi
    le attached if you can. I will learn from your idea.
    Thank you very much for your time and energy!
    Your
    Swedlin
    Attachments:
    Acquire_N_Scans_1_10.vi ‏75 KB

    Hello;
    Regarding your question on the data type that would use less storage space, the answer is binary type. Actually, you can use another shipping example as start point of your application. The example I'm mentioning is a data logger, that saves binary data to a file on your hard drive. You can find that example at Search Examples->I/O Interfaces->Data Acquisition->Data Logger->High Speed Data Logger.
    Regarding your question about the CPU time, the statement is valid. In case you use a synchronous AI task, the CPU execution will get stuck inside the AI Read.vi untill the buffer is ready to be read. One thing you can do about that is to change the acquisition task to be asynchronous. There is a good example in Labview showing how you can accomplish that.
    You can find the example at Search Examples->I/O Interfaces->Data Acquisition->Analog Input->DAQ Occurrences.
    You can combine both examples to accomplish the task you need.
    Hope this helps.
    Filipe A.
    Applications Engineer
    National Instruments

  • I've just finished building a new website with iWeb, I want to build a new site, how can I save the details from the first site?

    Hi There.
    I've been building a new website with iWeb. Its now complete, but I will need to keep all the detasils involved as I make amendments from time to time. Now I want to start a new site on a completely different subject. But every time I go to start the new site, it just seems to be 'papering' over the details of the old one. How can I begin a completely new site without overwriting the details of the previous site, and where do I save the original site details to for easy access.
    Thanks,
    Gerbles

    To create a new site in the same domain file use the File ➙ New File menu option.
    to give you this:
    OT

  • How to save the text from text area back to a text file?

    Hi all,
    Now I am doing a small panel which containts a JTextArea, this TextArea will read the content from a text file, then display the content of the text file on the TextArea itself.
    My idea is, allow the user to modify the content in the textarea (I set it Editable=true;), then save it. After the user press the save button, the content in the text file will be updated accordng to the user;s modification on TextArea.
    I had done the displaying part by using JavaI/O (BufferReader), now any expert here know how to update the TextArea content back to the text file itself? PLease teach me, THANKS !!!

    NOw I had manage to clear out the error, but now the problem is when I click on the 'save' button, this function clear out the entire text file for me !!!
    The code are as below:
           if(e.getSource()== vButtons[0])
              try{
               String str;
               String Ky = tArea.getText();
               BufferedWriter buffWrite=null;
               BufferedWriter in1 = new BufferedWriter(new FileWriter("Keyword.txt"));
                        buffWrite.write(Ky);
                    buffWrite.flush();
                        buffWrite.close();
                    in1.close();
              catch (IOException ex) {
              ex.printStackTrace();
            if(e.getSource()== vButtons[1])
                  new panel();
                  dispose();
             if(e.getSource()== vButtons[2])
                System.exit(0);           
        }     Please tell me how to save the TextArea to the text file, THANKS !!!

  • How do I get sound into the computer from my webcam?

    Hello,
    I have a mac pro intel 8-core and need to use webcam with skype. The thing is, there is no build in mic on the 8-core and there is no mini audio input jack so how do I get the sound in from a webcam?
    In fact, are there webcams available that have the built-in mic sending the signal through USB or firewire? The only webcams I found had a mic with a mini-audio plug for plugging into the computer. But of course, there is no jack to plug it into.
    Besides using a firewire camcorder, is there anyway to get sound in from a webcam?
    Thanks so much,
    Kirk

    Hi
    I'm using Skype with a Logitech Pro 9000 camera with built in Mic.
    I didn't need special drivers, it worked as soon as it was connected. It was configured in -
    System Preferences - Sound - Input - then select Logitech Camera, USB and you are done.
    Regards, Ian Macdonald

Maybe you are looking for

  • How can I continuously auto-save and auto-name the JPEG files with a controlled time interval

    Hi, I am newly involved in some Labview projects that out of my knowledge. I am trying to save multiple JPEG images from a live imaging task to a folder in the computer hard disk every certain minutes. I'd like to name these files with the date and t

  • Send PDF as email attachment using Outlook 2011 ERROR

    Every time I try to send a PDF as an email attachment, I get the following error: "An error occurred while trying to create a mail document.  Acrobat is unable to complete your request." Prior to getting this error, every time I sent an email Adobe w

  • The Organizer – Using file names as captions in SlideShow

    I am using Vista.  I just switched from using ZoomBrowser to The Organizer and I have a collections of thousands of photos. In ZoomBrowser I could show the file names (which I used to describe the slide) at the bottom of the slides during a slide sho

  • Reg : Access control installationn

    HI all, My system has kernel 6.40 SP19 . i am trying to installing grc access control 5.3 .Can we go ahead with installtion Is there any difference between netweaver 2004 and netweaver 2004s.but i access control has a prerequisite of having netweaver

  • Help with pico /etc/profile

    I have redhat 7.3 and i install the sdk. Its in usr/java/j2sdk1.4.1/bin Where exactly do I put the line path so every user can use the java/javac etc commands anywhere. I tried. but it dont work. Im I clicked on save settings, but im not sure that sa