@SuppressWarnings("static-access")
public boolean doIt(int width, int height, 
                      int frameRate, List<String> inFiles, 
                      MediaLocator outML,
                      String type) {
    this.fRate = frameRate;
    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. 
    p.setContentDescriptor(new ContentDescriptor(type));
    
    // Query for the processor for supported formats.
    // Then set it on the processor.
    TrackControl tcs[] = p.getTrackControls();
    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;
    }
    
    tcs[0].setFormat(f[0]);
    
    //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;
  }