Data Transfer using DataSink from DataSource to MediaLocator not working

I wrote this pretty straightforward program to transfer from a DataSource to a MediaLocator and when i run it nothing happens. I waited for around 10 minutes and still nothing happened. I manually closed the program to see if any data has been transferred to the destination file but the destination file timpu.mp3 is empty. Can someone tell me why it isn't working?
import javax.swing.*;
import javax.media.*;
import java.net.*;
import java.io.*;
import javax.media.datasink.*;
import javax.media.protocol.*;
class Abc implements DataSinkListener
     DataSource ds;
     DataSink dsk;
     public void transfer() throws Exception
          ds=Manager.createDataSource(new MediaLocator(new File("G:/java files1/jmf/aa.mp3").toURL()));
          MediaLocator mc=new MediaLocator(new File("G:/java files1/jmf/timpu.mp3").toURL());
          dsk=Manager.createDataSink(ds,mc);
          System.out.println(ds.getContentType()+"\n"+dsk.getOutputLocator().toString());
          dsk.open();
          dsk.start();
          dsk.addDataSinkListener(this);
     public void dataSinkUpdate(DataSinkEvent event)
          if(event instanceof EndOfStreamEvent)
               try
                    System.out.println("EndOfStreamEvent");
                    dsk.stop();
                    dsk.close();
                    System.exit(1);
               catch(Exception e)
public class JMFCapture5
     public static void main(String args[]) throws Exception
          Abc a=new Abc();
          a.transfer();          
}Message was edited by:
qUesT_foR_knOwLeDge

Have thrown this together - so it's not pretty, but should give you an idea
public class ABC extends JFrame implements DataSinkListener, ControllerListener, ActionListener{
    private Container cont;
    private JButton jBRecord;
    private boolean bRecording = false;
    private Processor recordingProcessor;
    private DataSource recordingDataSource;
    private DataSink recordingDataSink;
    private Processor mainProcessor;
    private DataSource mainDataSource;
     public ABC(){
        super("Basic WebCam Handler");
        cont = getContentPane();
        cont.setLayout(new BorderLayout());
        //     control panel buttons
        jBRecord = new JButton("R+");
        jBRecord.setToolTipText("Record On / Off");
        cont.add(jBRecord, BorderLayout.NORTH);
        //     & Listeners
        jBRecord.addActionListener(this);
        addMyCamera();
        pack();
        setVisible(true);
    private void addMyCamera()
        Vector vCDs = CaptureDeviceManager.getDeviceList(null); //     get Devices supported
        Iterator iTCams = vCDs.iterator();
        while(iTCams.hasNext())
            CaptureDeviceInfo cDI = (CaptureDeviceInfo)iTCams.next();
            if(cDI.getName().startsWith("vfw:"))
                try{
                    MediaLocator mL = cDI.getLocator();
                    mainDataSource = Manager.createCloneableDataSource(Manager.createDataSource(mL));
                    mainProcessor = Manager.createProcessor(mainDataSource);
                    mainProcessor.addControllerListener(this);
                    mainProcessor.configure();
                    break;
                }catch(Exception eX){
                    eX.printStackTrace();
     private void startRecording(){
         if(!bRecording){
              try{
                System.out.println("startRecording");
                recordingDataSource = ((SourceCloneable)mainDataSource).createClone();
                recordingProcessor = Manager.createProcessor(recordingDataSource);
                recordingProcessor.addControllerListener(this);
                recordingProcessor.configure();
                bRecording = true;
              }catch(Exception eX){
                   eX.printStackTrace();
     private void stopRecording(){
         if(bRecording){
            System.out.println("stopRecording");
            bRecording = false;
            try{
                recordingProcessor.close();
                recordingDataSink.stop();
                recordingDataSink.close();
            }catch(Exception eX){
                 eX.printStackTrace();
    public void actionPerformed(ActionEvent e)
        Object obj = e.getSource();
        if(obj == jBRecord)
            if(jBRecord.getText().equals("R+"))
                jBRecord.setText("R-");
                startRecording();
            else
                jBRecord.setText("R+");
                stopRecording();
     *     ControllerListener
    public void controllerUpdate(ControllerEvent e)
          Processor p = (Processor)e.getSourceController();
         if(e instanceof ConfigureCompleteEvent){
               System.out.println("ConfigureCompleteEvent-" + System.currentTimeMillis());
               if(p == recordingProcessor){
                 try{
                     VideoFormat vfmt = new VideoFormat(VideoFormat.CINEPAK);
                     TrackControl [] tC = p.getTrackControls();
                     tC[0].setFormat(vfmt);
                     tC[0].setEnabled(true);
                     p.setContentDescriptor(new FileTypeDescriptor(FileTypeDescriptor.QUICKTIME));
                     Control control = p.getControl("javax.media.control.FrameRateControl");
                     if(control != null && control instanceof FrameRateControl){
                          FrameRateControl fRC = (FrameRateControl)control;
                         fRC.setFrameRate(30.0f);
                 catch(Exception eX)
                     eX.printStackTrace();
               else{
                    p.setContentDescriptor(null);
               p.realize();
         else if(e instanceof RealizeCompleteEvent){
               System.out.println("RealizeCompleteEvent-" + System.currentTimeMillis());
               try{
                    if(p == mainProcessor){
                         Component c = p.getVisualComponent();
                         if(c != null){
                              cont.add(c);
                         p.start();
                         validate();
                    else if(p == recordingProcessor){
                     GregorianCalendar gC = new GregorianCalendar();
                         File f = new File("C:/Workspace/" + gC.get(Calendar.YEAR) + gC.get(Calendar.MONTH) +
                             gC.get(Calendar.DAY_OF_MONTH) + gC.get(Calendar.HOUR_OF_DAY) +
                             gC.get(Calendar.MINUTE) + gC.get(Calendar.SECOND) + ".mov");
                     MediaLocator mL = new MediaLocator(f.toURL());
                     recordingDataSink = Manager.createDataSink(p.getDataOutput(), mL);
                     p.start();
                     recordingDataSink.open();
                     recordingDataSink.start();
               }catch(Exception eX){
                    eX.printStackTrace();
         else if(e instanceof EndOfMediaEvent){
              System.out.println("EndOfMediaEvent-" + System.currentTimeMillis());
            p.stop();
         else if(e instanceof StopEvent){
            System.out.println ("StopEvent-" + System.currentTimeMillis());
            p.close();
     public void dataSinkUpdate(DataSinkEvent event)
          if(event instanceof EndOfStreamEvent){
               try{
                    System.out.println("EndOfStreamEvent-" + System.currentTimeMillis());
                    recordingDataSink.stop();
                    recordingDataSink.close();
               }catch(Exception e){
     public static void main(String args[]) throws Exception
          ABC a=new ABC();
//          a.transfer();          
}

Similar Messages

  • Date of last extraction from DataSource 0HR_PY_PP_2 is not available

    Hello all,
    We are using this data source to extract data for HR in BW. We are currently on BI 7.0
    When I used this datasource in BW development system it worked fine. But now I am trying to extract data using the same datasource in BW QA system and I am getting this error.
    "Date of last extraction from DataSource 0HR_PY_PP_2 is not available     HR_BIW_PP"
    The datasource is delta supported so I am trying to init it, and thats when I am getting this error.
    Has anyone seen this message before, can some give some suggestions?
    Thanks in advance

    Just quick check, check rsa3 if you can get any data and  also it seems like it is complaining about changes in extract structure, can you compare the extract structure of the two system manually? If you have made changes to the extract structure, did you move that change in the source system? Sometimes it worth it to replicate the datasource and reactivate the transfer structure using program RSActiTran.
    thanks.
    Wond

  • Date of last extraction from DataSource 0HR_PP_REC_52 is not available

    Hi ,
    Iam getting another error for data source 0HR_PP_REC_52 , it follows:
    Date of last extraction from DataSource 0HR_PP_REC_52 is not available HR_BIW_PP 1
    Please help as iam not aware of this type of extrcator.
    Thanks in advance.

    Hi,
    Did you delete the request under scheduler menu of your infopackage?
    Scheduler->Init options from the Source system->delete the request
    run Init with transfer option now. If it doesn;t help, simply replicate the datasources once and try initializing.
    Regards,
    Suman

  • Data transfer using EDI from one SAP system to other SAP system

    Dear all,
    I understand that i should use normal ale-idoc features to transfer data from one sap to other sap system.
    but can i transfer those idocs using EDI from one SAP to other SAP system

    Hello,
    surely you can do so.
    EDI means that you transfer data in standardized EDI-formats. To get the data at the source  into that formats you normally use an EDI-Converter, which maps the IDOC-format into the EDI-format. Then you send the data in EDI-format to an EDI-converter at the target. There's the reverse mapping. You map the EDI-Format into IDOC-format and book these IDOCs into SAP.
    I think this makes only sense if you cross organizational borders within the business process, e.g., if you define an exchange with many customers, but not all of them have an SAP-system. 
    Regards Wolfgang
    Edited by: Wolfgang Valtin on May 19, 2009 6:13 PM

  • Search using categories from 2nd cat schema not working

    Hi,
    We're currently using 2 categorization schemas in our transactions.  However, the Category search criterion doesn't seem to work when we try to search for transactions using categories from the second categorization schema.  The same search criterion works well with the first categorization schema.  Can you pls. give us an idea on what configurations we could be missing out on?  Will greatly appreciate your help.  Thanks in advance.
    Regards,
    Theresa

    Hi,
    We're currently using 2 categorization schemas in our transactions.  However, the Category search criterion doesn't seem to work when we try to search for transactions using categories from the second categorization schema.  The same search criterion works well with the first categorization schema.  Can you pls. give us an idea on what configurations we could be missing out on?  Will greatly appreciate your help.  Thanks in advance.
    Regards,
    Theresa

  • Transfer functions imported from Simulink through MIT not working in Labview

    Hi,
    I am just starting to use Labview interface with Simulink using Model Interface Toolkit (MIT). I am trying to import an integrater model from simulink. The model is very simple. An input port connected to an output port through an integrator model (1/s). Here are the steps I used:
    1. Build the model in Simulink.
    2. Add the NI input-output ports to the model and place the NIVeriStandSignal Probe in the model.
    3. Generate the dll using NiVeriStand.tlc as the target file option.
    4. Import that dll into Labview using Load Model.vi. Follow the steps given in the example file for importing the input/ output ports info along with the timing info.
    5. Then use a numeric control to input value to the integrator dll and pass the output from dll to a waveform chart.
    But when I run the labview VI, the output in the chart is always zero. What could be the possible reason? Please let me know if I am making any mistake in the process?
    I have used Fixed time step with ode4 (Runge-Kutta) as the solver options in Simulink during dll generation. I am using Labview 2014 and Matlab R2014a.
    I have found the issue to occur only when I use any transfer functions or Plecs circuit with inductors or capacitors in my Simulink model. But when I use simulink model with only constant or maths functions like add, subtract etc, this process works and gives me the correct result in Labview.
    Any help would be appreciated.
    Thanks.

    Hello Sachin_Madhu,
    Can you build example programs with a solver included? Does the model work in The MathWorks, Inc. Simulink® Software without tying into LabVIEW? It is important that when you built the model you followed the four steps listed in this help file:
    http://zone.ni.com/reference/en-XX/help/374160A-01​/vsmithelp/mit_convert_model_to_dll/
    MATLAB®, Simulink®, and Real-Time Workshop® are registered trademarks of The MathWorks, Inc. Other product and company names listed are trademarks and trade names of their respective companies.
    Siana A.
    Application Engineering
    National Instruments

  • Does the data transfer used in the back up in time capsule included in the data allowance from my service provider?

    Is the data transfer used in the backup with airport time capsule included in the data allowance with my service provider?

    gheefromsa wrote:
    I am using Ethernet cable to connect TC to the modem. I am only backing up my mac book air within range of the TC. So I guess it will be OK from your reply. As a trial I did interrupt the back up by turning off the TC, disconnecting the Ethernet cable, turning TC back on. The mac would not connect wirelessly with the TC without the Ethernet connection.
    It is not using ISP .. absolutely for sure. Well 99.999%.. absolute tends to be only in maths.
    But you did the test wrongly.. I said to disconnect the modem.. during the backup.. not turn off the TC.. obviously once interrupted the TC will not work again until everything is plugged in.. but it will work even bridged for a short time.. just unplug the WAN port from the modem.
    The test is moot now.. as I can give you a 99.999% promise it is not using ISP.

  • ISSUE:regarding production version tab of MRP4 of  data transfer using BD10

    Hi all,
    This is regarding production version tab of MRP4 of  data transfer using ALE idoc (BD10).
    When i transfer the data using BD10 the production version is received at receiving end through segment
    but not created in MRP4 view tab.An error is coming as-
    "You wanted to maintain the master record of the material AB_06.04.09(2). However, it is already being processed by the user EBGABAP and is therefore locked."
    I logged in as-EBGABAP
    Please help me resolve the issue.
    Thanks
    Edited by: sanu debu on May 6, 2009 11:08 AM
    Edited by: sanu debu on May 6, 2009 11:09 AM
    Edited by: sanu debu on May 6, 2009 11:11 AM

    >
    sanu debu wrote:
    > Hi,
    > I have to upload production version tab data of  MRP4 view(MM01).Please suggest a function  moduleor bapi  for the same.
    >
    > Thanks.
    >
    > Edited by: sanu debu on May 6, 2009 3:24 PM
    BAPI_MATERIAL_SAVEDATA can be used, populate the respective fields in input parameter PLANTDATA

  • Redemption code from Photoshop Elements 12 purchased from Best Buy does not work 'Oops! This code doesn't seem to be active. Please contact the retailer you purchased the card from, or use a different code.'   I have an invoice and the pickup notice from

    Redemption code from Photoshop Elements 12 purchased from Best Buy does not work 'Oops! This code doesn't seem to be active. Please contact the retailer you purchased the card from, or use a different code.'   I have an invoice and the pickup notice from Best Buy.   What other information does Best Buy need?   What will they do?   Will I get a new box?   What happened to the days of just typing in a simple s/n?   

    Redemption Code Help
    http://helpx.adobe.com/x-productkb/global/redemption-code-help.html

  • HT1202 The manual mode to transfer music to my iTune from my iPhone does not work as described. When I click on Manually manage... it displays the warning message that all music on my iPhone will be erased and replaced by iTune music.

    The manual mode to transfer music to my iTune from my iPhone does not work as described. When I click on Manually manage... it displays the warning message that all music on my iPhone will be erased and replaced by iTune music.
    How can I transfer my music to a second computer iTune?
    Thanks,

    See this user tip
    Syncing iPhone to a "New" Computer or replacing a "crashed" Hard Drive

  • HT204053 I tried to make a purchase with my apple id after changing the experiration date on my credit card and it does not work

    I tried to make a purchase from the app store ( the French app store using my French apple ID and credit card) , i had just changed the experition date for my credit card and it did not work, should I do anything else?
    Thanks

    Then you should contact them:
    http://www.apple.com/emea/support/itunes/contact.html

  • Streaming Audio through Iphone 5 to desktop or laptop using bluetooth preinstalled on all devices not working. Help!!!.

    Streaming Audio through Iphone 5 to desktop or laptop using bluetooth preinstalled on all devices not working. Help!!!. Does anybody else have this problem?. Or does anybody have a solution to the problem. If So please help me its driving me demented seriously concidering to go to android for that sort of stuff cause of the dame restrictions on apple devices!

    iOS devices do not pair with computers, as data transfer over bluetooth is not supported.
    Computers are not airplay compatible unless you have downloaded an app to make them so.
    User to user forum, so I don't care if you switch to android or any other threats you make.

  • Reopen All Windows from Last Session is not working

    The option Reopen All Windows from Last Session is not working, is there any other way to recover the tabs from my last session?
    Last night I fell asleep and my friend shut down my laptop.
    When I woke up in the morning I couldn't restore my last session which had several tabs opened for my research.
    I don't know the exact date when I found them, so I haven't been able to find them in History either.
    I've looked around on the internet, but haven't been able to find anything that helped me out.
    Hope you can help me! Thanks.

    Restart your Mac.
    Check the box for:  Reopen windows when logging back in
    Then check History >  Reopen Windows from Last Session

  • Wish to post KeyNote file as pdf. Export from KN to iW not working

    Wish to post KeyNote file as pdf. Export from KN to iW not working - get blank screen. Tried to upload PDF to mobile me and link to that file - also didn't work. I'm not familiar with iFrames but have read about them in this forum - is that my only option? Why wouldn't a KN export work?
    Thanks, Brian

    I have just tried this with a test site and publishing to a folder and it does work perfectly for me.
    I had a Keynote document already so all I did was click on File and then selected the Print option. I then selected the save as pdf option the the pdf document was created on my desktop instantly.
    All I then did was open iWeb and type some words in a text box My Prices. I then highlighted My Prices and opened the Inspector and went to Hyperlink and clicked on the option Hyperlink to a file. I then selected the pdf file from my desktop.
    I then used ftp to a folder on my desktop and when I opened the appropriate page, I click on the words My Prices and the pdf file opened straight away.
    As OT has suggested, check that you have linked to the correct file. If it does not work, either you have not created the pdf correctly or at all or you have not linked to the correct file.
    As I said, it worked for me.

  • Help!!! I can not make or receive calls! other functions itself. Internet, sms, whatsapp work. I restored as new iphone from the phone and from itunes and still not working.

    I can not make or receive calls! other functions itself. Internet, sms, whatsapp work. I restored as new iphone from the phone and from itunes and still not working.
    Sorry for my english i'm spanish

    I have not tried that...I will look up the process so that I can do it correctly (and still transfer all of my files, contacts, etc).  Any suggestions?  What is the advantage of restoring as a new device..is this more akin to a complete wipe of a hard drive?

Maybe you are looking for

  • Out of storage ?

    I have a late 2010 27" i3 iMac upgraded to 12gb RAM and running Yosemite.  I got a message telling me that my HD ( !TB) was full  -i'm pretty sure this isn't the case. I checked under " about this mac" and it showed 500mb free(!)  I ran verify disk,

  • Reader 11 / Windows Trusted Sites

    Hello everyone I'm trying to configure Adobe Reader to recognize my Windows Trusted Sites so I can enable the protected view for all documents. In the internet options security zone "trusted sites" I already added my fileserver. (file://fs001) I can'

  • CF/Flex App  Wizard - Detail Query  - cols selected multiple times

    Dragging a "many" table for the master into the detail work area causes its columns to be selected multiple times - the whole column set is repeated 2 to 4 times. Oracle db, all the tables I tried. It's a pain to go into the generated code and remove

  • JComboBox newbie question

    I cant seem to find out how to add items to my jcombobox using Forte. I have this : String[] dbId = { "579", "459", "789", "098", "297" }; jComboBox1.addItem(dbId); Where do I put this code to fill the combo box with the String array? Steve

  • Kindle app on the macbook pro

    Does anyone know why the kindle app on the macbook pro shuts down by itself? Is there a way to fix that or should I just take my mac to apple?