About capture and save to file

i can view the movie and save to the file,but i cant use the mediaplayer to play it,who can give a suggestion.thanks
my code as follow:
public void tryCapture() {
di = CaptureDeviceManager.getDevice(
"vfw:Microsoft WDM Image Capture (Win32):0");
try {
if (p != null) {
return;
MediaLocator aa = di.getLocator();
p = Manager.createProcessor(di.getLocator());
p.configure();
p.addControllerListener(this);
catch (Exception e) {
e.printStackTrace();
if (p == null) {
System.exit(0);
public synchronized void controllerUpdate(ControllerEvent event) {
if (event instanceof ConfigureCompleteEvent) {
p.setContentDescriptor(new FileTypeDescriptor(FileTypeDescriptor.
QUICKTIME));
p.realize();
if (event instanceof RealizeCompleteEvent) {
Panel panel = new Panel();
panel.setLayout(new BorderLayout());
Component comp;
int height = 0, width = 0;
Control controls[];
if ( (comp = p.getControlPanelComponent()) != null) {
panel.add(comp, BorderLayout.SOUTH);
if ( (comp = p.getVisualComponent()) != null) {
panel.add(comp, BorderLayout.CENTER);
else {
controls = p.getControls();
for (int i = 0; i < controls.length; i++) {
if (! (controls[i] instanceof MonitorControl)) {
continue;
mc = (MonitorControl) controls;
comp = mc.getControlComponent();
if (comp == null) {
continue;
panel.add(comp, BorderLayout.CENTER);
contentPane.add(panel, new XYConstraints(0, 100, 400, 380));
this.setBounds(300, 120, 420, 520);
validate();
mc.setEnabled(true);
try {
DataSource ds = p.getDataOutput();
MediaLocator ml = new MediaLocator("file://e:/test.avi");
dts = Manager.createDataSink(ds, ml);
dts.open();
dts.start();
catch (Exception ex) {
ex.printStackTrace();
p.start();

i get it ,
just because i haven't stop the DataSink before close it..
who can tell me why?
regards

Similar Messages

  • How to capture a .gif file from a spectrum analyzer and save the file in PC

    I want to capture a .gif file from a spectrum analyzer and save the file in PC, but I've got a problem when read data from the instrument. I'm not sure how to format the string got from the instrument , When I use "%s" or "%t" as the read string format the data got from the instrument is truncated.
    my code are as follows, could anyone tell me where i am wrong?
    char resultsArray[5000];
    viPrintf(hSpectrumInstr, ":MMEMTORCR 'CICTURE.GIF'\n");
     viQueryf(hSpectrumInstr, ":MMEMATA? 'CICTURE.GIF'\n", "%t", resultsArray);
     printf("%s", resultsArray);
     getchar();       
    Solved!
    Go to Solution.
    Attachments:
    readResult.docx ‏50 KB

    char resultsArray[5000];
    viPrintf(hSpectrumInstr, ":MMEMTORCR 'CICTURE.GIF'\n");
    viQueryf(hSpectrumInstr, ":MMEMATA? 'CICTURE.GIF'\n", "%b", resultsArray);

  • How to capture or  save video files or trailers in to apple tv thru intern

    hi
    i Hvw purchased apple tv .in that iam unable to see trailers only and iam unable o save the video file in the apple t.v every time has to connect the internet to see the video file is there any setttings to do plz tell me friends .iam waiting to ur reply how to capture or save video files or trailers in to apple tv thru internet

    when there is 40 gb h.d.d is it not possible to capture the videos or songs all the time i have to connfigure the dhcp settings or resetting to factory defaults
    then only iam able to play the trailers your answer is little clear to me my dear frnd plz dont mind can u help me some extra points to hti sappale tv

  • HT201250 I accidentally didn't save a document on my desktop--a report.  Can I go back with time machine and recover my desktop and save the file?

    I accidentally didn't save a document on my desktop--a report.  Can I go back with time machine and recover my desktop and save the file?

    If you saved it at least once, then time machine should have a copy of the document at the state you last saved it.  I'm guessing tha's not the case however or the copy of the file would still be on your Desktop.
    If you never saved it a single time, yet closed the window and dismissed the warnings about an unsaved document, then you are out of luck as far as I know.

  • I recently updated my macbook, i don't know if that has any effect to my recent problem, but when i try to download and save .mp3 files from the internet, like i have done in the past, it downloads but not as an mp3 file, its "blank"

    i recently updated my macbook, i don't know if that has any effect to my recent problem, but when i try to download and save .mp3 files from the internet, like i have done in the past, it downloads but not as an mp3 file, its "blank" and when i try to open it, i can't? I NEED HELP !

    Here is the download page

  • Open and Save Excel Files

    Hi All,
    I need code of How to open and save excel file in local system in Oracle forms.
    With Regards,
    Chandra Shekhar

    Hello Chandra,
    Webutil can be used to achieve this functionality.
    STEPS TO FOLLOW
    ================
    1. Install and configure Webutil following instructions in the webutil manual
    and the readme file.
    2. Create a form with a block Eg. DEPT
    3. Create a button, and in that button put the following code -
    DECLARE
    application Client_OLE2.Obj_Type;
    workbooks Client_OLE2.Obj_Type;
    workbook Client_OLE2.Obj_Type;
    worksheets Client_OLE2.Obj_Type;
    worksheet Client_OLE2.Obj_Type;
    args Client_OLE2.List_Type;
    cell ole2.Obj_Type;
    j INTEGER;
    k INTEGER;
    BEGIN
    application := Client_OLE2.create_obj('Excel.Application');
    workbooks := Client_OLE2.Get_Obj_Property(application, 'Workbooks');
    workbook := Client_OLE2.Invoke_Obj(workbooks, 'Add');
    worksheets := Client_OLE2.Get_Obj_Property(workbook, 'Worksheets');
    worksheet := Client_OLE2.Invoke_Obj(worksheets, 'Add');
    go_block('dept');
    first_record;
    j:=1;
    k:=1;
    while :system.last_record = 'FALSE'
    loop
    for k in 1..3 /* DEPT has 3 columns */
    loop
    If not name_in(:system.cursor_item) is NULL Then
    args:=Client_OLE2.create_arglist;
    Client_OLE2.add_arg(args, j);
    Client_OLE2.add_arg(args, k);
    cell:=Client_OLE2.get_obj_property(worksheet, 'Cells', args);
    Client_OLE2.destroy_arglist(args);
    Client_OLE2.set_property(cell, 'Value', name_in(:system.cursor_item));
    Client_OLE2.release_obj(cell);
    End If;
    next_item;
    end loop;
    j:=j+1;
    next_record;
    end loop;
    /* For the last record */
    for k in 1..3
    loop
    If not name_in(:system.cursor_item) is NULL Then
    args:=Client_OLE2.create_arglist;
    Client_OLE2.add_arg(args, j);
    Client_OLE2.add_arg(args, k);
    cell:=Client_OLE2.get_obj_property(worksheet, 'Cells', args);
    Client_OLE2.destroy_arglist(args);
    Client_OLE2.set_property(cell, 'Value', name_in(:system.cursor_item));
    Client_OLE2.release_obj(cell);
    End If;
    next_item;
    end loop;
    Client_OLE2.Release_Obj(worksheet);
    Client_OLE2.Release_Obj(worksheets);
    /* Save the Excel file created */
    args := Client_OLE2.Create_Arglist;
    Client_OLE2.Add_Arg(args,'d:\test.xls');
    Client_OLE2.Invoke(workbook, 'SaveAs', args);
    Client_OLE2.Destroy_Arglist(args);
    /* release workbook */
    Client_OLE2.Release_Obj(workbook);
    Client_OLE2.Release_Obj(workbooks);
    /* Release application */
    Client_OLE2.Invoke(application, 'Quit');
    Client_OLE2.Release_Obj(application);
    END;
    4. Save the form and compile it.
    5. Run the form.
    6. Execute the query in the block.
    7. Click on the button.
    8. An excel file will be created in the d:\ directory by the name test.xls.
    Kind regards,
    Alex
    If someone's answer is helpful or correct please mark it accordingly.

  • How to create and save a file in flex web application ?

    Hi,
          I want to create and save a file form flex web application. Is it possible ?
    I have done some googling and found that its only possible through file referece, which needs some serverside implementation be called.
    Is it not possible with file reference to create and save file directly ?
    Can any one suggest how to over come this.
    Thanks in advance.

    Alex,
    code written with the Flex Builder 3 libraries will certainly run in Flash Player 10. However, what you need is not so much the capabilities of FP10 but the library functionalities of the Flex 4 package. And I think that Flex 4 code will only run in FP10 and not 9 (but haven't tested this as at work we have not yet been permitted to upgrade, so there is not a lot of point going for Flex 4!).
    Richard

  • I am not able to download ITunes. I had some problems with ITunes and had to uninstall but now when I reinstall iTunes after I click on download iTunes and save the File, I get this message"Thank you for downloading iTunes" and nothing else happens. I don

    I had some problems with ITunes and had to uninstall but now when I reinstall iTunes after I click on download iTunes and save the File, I get this message"Thank you for downloading iTunes" and nothing else happens. I don't see any thing else. Now not sure what else I have to do.
    Thanks,
    Ranjit

    See the further information area of Troubleshooting issues with iTunes for Windows updates.
    tt2

  • Flash Player update 10.3 unable to download and save flv files

    Hello,
    Since the Flash Player update to 10.3.183.10 it is no longer possible for me to download and save *.flv files. A file of only 2320 kb is saved along with a meta file of 1 kb. The 2320 kb file has a flv extension but the file will not play in any of my media players. Files of mp4 type still download and play fine. The problem only occurred following the last upgrade and even though I uninstalled then reinstalled Adobe Flash Player I cannot overcome the problem. My PC runs MS Windows Vista Home Premium Version: 6.0.6002 Service Pack 2 Build 6002. Browser Internet Explorer 9.0.8112.16421.
    Your assistance would be much appreciated.
    Dibloc

    Thank you.
    The problem only occurs when downloading flv files from YouTube. For all video downloads I have been using RealPlayer and experience no problems when downloading flv files from sites other than YouTube.
    Have been able to download these files now using the site http://www.savevid.com/
    Perhaps YouTube are blocking the use of RealPlayer from downloading flv files?

  • How do I download and saves html files off my website to store and save using Dreamweaver CS3?

    How do I download and saves html files off my website to store and save using Dreamweaver CS3?
    I need to save all files from web and store onto a drive to reupload to a new domain name.  I use Dreamweaver CS3.

    First define your Local Site folder in Dreamweaver.  DW will use this folder to store your site files.
    Go to Manage Sites > New or Edit site.  See screenshots.
    Servers:  Enter your remote server's log-in details.  When complete, hit TEST to see if the connection is working.  If all is well, hit SAVE.
    From the Files Panel (F8), click on Remote Server to show the files that are currently there.  Click the green Down Arrow to GET files from remote server to your local site folder.
    Nancy O.

  • When I try and save a file Photoshop crashes "McAfee blocked suspicious activity-Buffer overflow"

    I never had this problem before. When i try and save a file Photoshop just fails instantly crashes and I get this error message from McAfee software:

    Well, you could just make your firewall behave and create an exception rule as the warning suggests... It's unlikely that this is PS itself, anyway. Eitehr it's a flakey driver or a cracked plug-in you may be using (not implying anything here, so keep cool) may produce a wrong hash value/ signature and trigger the alarm.
    Mylenium

  • How does APEX create and save new files. What extension does it save in?

    Hi can someone help me with this question?
    How does APEX create and save new files. What extension does it save in?
    Cheers!
    VJ

    It's really too bad we can't see VJ's face when the concept sinks in. This is one of my favorite moments when teaching APEX classes. Most people love it, some people don't. If nothing else it really proves the power and performance of the Oracle database. Each page view can generate 40+ queries, yet on the average system this takes less than .04 seconds.
    Keep in mind there are no undocumented features or "Oracle Internals" that the APEX team uses to achieve this performance, just sound database design. With every feature they add they evaluate how it will be used and design the tables and indexes to most efficiently answer the query. Sometimes this means going against "purist" normalized principals.

  • How to render and save a file as windows media file or mp3?

    I have worked in Sony Vegas 9 and I was hoping Adobe Premier Pro CC was similar--- but its not. I can't figure out how to render and save a file as a windows media or mp3 or in any format for that matter.

    Search for exporting in the help file
    Not all for PProCC, but The PPro/Encore tutorial list in message #3 http://forums.adobe.com/message/2276578 may also help, with more help in message #5
    PS - rendering is the process of creating temporary files to aid in timeline playback, while exporting creates new files

  • HT1296 How can I capture and save an image on my screen for later retrieval

    How can I capture and save an image on my iPad screen for later retrieval, perhaps on my Laptop (Windows 7)?
    Is there a way to copy the image to a storage device?
    Thanks, Don.

    The Apple Support Communities are an international user to user technical support forum. As a man from Mexico, Spanish is my native tongue. I do not speak English very well, however, I do write in English with the aid of the Mac OS X spelling and grammar checks. I also live in a culture perhaps very very different from your own. When offering advice in the ASC, my comments are not meant to be anything more than helpful and certainly not to be taken as insults.
    Its easy to take an iPad screenshot. Press & release the Home and the Power buttons quickly at the same time. I have trouble with that so I press & hold the Home button and then very quickly press and release the Power button. Your screenshot is stored in the Camera Roll of the Photos app. Probably the easiest way to get it to your PC is to be using iCloud, or email it to your PC. There are also some wireless sync apps in the iTunes app store that let you send photos from the iPad to a Mac or PC. I use PhotoSync.

  • Tiff Viewer which disables print, copy and save TIFF file

    I am looking TIFF Viewer solution which woul disable any print, save and copy functions for a TIFF file. Thisfunctionality is available for PDF but I need to disable print, copy and save for TIFF files.
    Would anyone know a TIFF viewer or solution that supports the following functions:
    1)      TIFF viewer where we can turn off any options to print the TIFF file or save it to disk.  That would include disabling any options where the user could right click on the TIFF and save the file somewhere else.
    2)      It would need to be able to open multi-page TIFFs. 
    3)      It would be nice if the TIFF viewer could be run on both Mac and Windows platforms.
    I need to send files to users for view only, and these should be in TIFF fomat, not converted into a PDF.
    Thank you for your help.
    Regards,
    Sapna

    The same answer applies to any kind of file.
    You need a Digital Rights Management solution. Very expensive.

Maybe you are looking for