Package com.xuggle.mediatool

Examples of com.xuggle.mediatool.MediaViewer$SelfServicingMediaQueue


        writer = new MediaWriter(outURL, reader);
        reader.addListener(writer);
      }
      if (doViewer)
      {
        MediaViewer viewer = new MediaViewer(viewerMode,
            true,
            WindowConstants.EXIT_ON_CLOSE);
        reader.addListener(viewer);
         
      }
View Full Code Here


      return;
    File file = new File(PREFIX + "transcode-to-flv.flv");
    file.delete();
    assert(!file.exists());
    MediaWriter writer = new MediaWriter(file.toString(), mReader);
    writer.addListener(new MediaViewer(mViewerMode, true));
    mReader.addListener(writer);
    while (mReader.readPacket() == null)
      ;
    assert(file.exists());
    assertEquals(1062946, file.length(), 300);
View Full Code Here

      return;
    File file = new File(PREFIX + "transcode-to-mov.mov");
    file.delete();
    assert(!file.exists());
    MediaWriter writer = new MediaWriter(file.toString(), mReader);
    writer.addListener(new MediaViewer(mViewerMode, true));
    mReader.addListener(writer);
    while (mReader.readPacket() == null)
      ;
    assert(file.exists());
    // allow 100k difference for debug builds
View Full Code Here

    File file = new File(PREFIX + "transcode-container.mov");
    file.delete();
    assert(!file.exists());
    MediaWriter writer = new MediaWriter(file.toString(),
      mReader.getContainer());
    writer.addListener(new MediaViewer(mViewerMode, true));
    mReader.addListener(writer);
    while (mReader.readPacket() == null)
      ;
    assert(file.exists());
    // allow 100k difference for debug builds
View Full Code Here

    int h = 200;

    // create the writer
   
    MediaWriter writer = new MediaWriter(file.toString());
    writer.addListener(new MediaViewer(mViewerMode, true));

    // add the video stream

    ICodec codec = ICodec.findEncodingCodec(ICodec.ID.CODEC_ID_FLV1);
    writer.addVideoStream(videoStreamIndex, videoStreamId, codec, w, h);
View Full Code Here

    int sampleRate = 44100;

    // create the writer
   
    MediaWriter writer = new MediaWriter(file.toString());
    writer.addListener(new MediaViewer(mViewerMode, true));

    // add the video stream

    ICodec videoCodec = ICodec.findEncodingCodec(ICodec.ID.CODEC_ID_FLV1);
    writer.addVideoStream(videoStreamIndex, videoStreamId, videoCodec, w, h);
View Full Code Here

    MediaReader reader = new MediaReader(INPUT_FILENAME);
    MediaWriter writer = new MediaWriter(OUTPUT_FILENAME, reader);
    reader.addListener(writer);

    writer.addListener(new MediaViewer(mViewerMode, true, 0));

    MediaDebugListener readerCounter = new MediaDebugListener(URL, META_DATA);
    MediaDebugListener writerCounter = new MediaDebugListener(EVENT, META_DATA);

    reader.addListener(readerCounter);
View Full Code Here

    if (mTestContainer)
    {
      final MediaWriter writer = new MediaWriter(mDestination,
        reader.getContainer());
      writer.setMaskLateStreamExceptions(false);
      writer.addListener(new MediaViewer(mViewerMode, true));

      writer.addListener(new MediaDebugListener(OPEN, CLOSE));

      reader.addListener(new MediaListenerAdapter()
        {
          public void onVideoPicture(IVideoPictureEvent event)
          {
            writer.onVideoPicture(event);
          }
         
          /** {@inheritDoc} */
         
          public void onAudioSamples(IAudioSamplesEvent event)
          {
            writer.onAudioSamples(event);
          }
        });

      // transcode

      while (reader.readPacket() == null)
        ;

      // close the container
     
      writer.close();
    }

    // construct a writer give a reader, the easy simple case

    else
    {
      // construct the writer, no need to keep a reference to the
      // writer, it's maintained in the reader

      MediaWriter writer = new MediaWriter(mDestination, reader);
      reader.addListener(writer);
      writer.setMaskLateStreamExceptions(false);
      writer.addListener(new MediaViewer(mViewerMode, true));

      writer.addListener(new MediaDebugListener(EVENT, META_DATA));

      // transcode

View Full Code Here

      return;
    File file = new File(PREFIX + "transcode-to-flv.flv");
    file.delete();
    assert(!file.exists());
    MediaWriter writer = new MediaWriter(file.toString(), mReader);
    writer.addListener(new MediaViewer(mViewerMode, true));
    mReader.addListener(writer);
    while (mReader.readPacket() == null)
      ;
    assert(file.exists());
    assertEquals(1111676, file.length(), 300);
View Full Code Here

      return;
    File file = new File(PREFIX + "transcode-to-mov.mov");
    file.delete();
    assert(!file.exists());
    MediaWriter writer = new MediaWriter(file.toString(), mReader);
    writer.addListener(new MediaViewer(mViewerMode, true));
    mReader.addListener(writer);
    while (mReader.readPacket() == null)
      ;
    assert(file.exists());
    // allow 100k difference for debug builds
View Full Code Here

TOP

Related Classes of com.xuggle.mediatool.MediaViewer$SelfServicingMediaQueue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.