Package com.xuggle.xuggler

Examples of com.xuggle.xuggler.IContainer.open()


   
    // Create a Xuggler container object
    IContainer container = IContainer.make();
   
    // Open up the container
    if (container.open(filename, IContainer.Type.READ, null) < 0)
      throw new IllegalArgumentException("could not open file: " + filename);
   
    // query how many streams the call to open found
    int numStreams = container.getNumStreams();
   
View Full Code Here


        public IMediaWriter addMusic(int streamIndex, IMediaWriter orangeMovie,long total)
        {
                IContainer container = IContainer.make();      
                System.out.println("Adding music");
               
                if (container.open(musicPath, IContainer.Type.READ, null) < 0)
                {
                      throw new IllegalArgumentException("could not open file");
                }

                int numStreams = container.getNumStreams();
View Full Code Here

    IContainer container = IContainer.make();

    // open up the container

    if (container.open(filename, IContainer.Type.READ, null) < 0)
      throw new IllegalArgumentException("could not open file: " + filename);

    // query how many streams the call to open found

    int numStreams = container.getNumStreams();
View Full Code Here

   
    params.setValue("framerate", "30/1");
    params.setValue("video_size", "320x240");   

    // Open up the container
    int retval = container.open(deviceName, IContainer.Type.READ, format,
        false, true, params, null);
    if (retval < 0)
    {
      // This little trick converts the non friendly integer return value into
      // a slightly more friendly object to get a human-readable error name
View Full Code Here

   
    // Create a Xuggler container object
    IContainer container = IContainer.make();
   
    // Open up the container
    if (container.open(filename, IContainer.Type.READ, null) < 0)
      throw new IllegalArgumentException("could not open file: " + filename);
   
    // query how many streams the call to open found
    int numStreams = container.getNumStreams();
   
View Full Code Here

   
    IContainer container = IContainer.make();
   
    // open the container
   
    if (container.open(TEST_FILE_20_SECONDS, IContainer.Type.READ,
        null, false, true) < 0)
      throw new IllegalArgumentException(
        "could not open: " + TEST_FILE_20_SECONDS);
       
    // create a new media reader
View Full Code Here

    IPixelFormat.Type pixFmt= IPixelFormat.Type.NONE;
    int sampleRate = -1;
    int channels = -1;
   
    IContainer container = IContainer.make();
    container.open("fixtures/testfile.mp3", IContainer.Type.READ, null);
    IStream stream = container.getStream(0);
   
    // get the audio stream
    mCoder = stream.getStreamCoder();
    bitRate = mCoder.getBitRate();
View Full Code Here

  @Test
  public void testGetCodecTypeBugFix2508480()
  {
    IContainer container = IContainer.make();
    assertTrue("should be able to open",
        container.open("fixtures/subtitled_video.mkv", IContainer.Type.READ, null) >= 0);
    assertEquals("unexpected codec type", ICodec.Type.CODEC_TYPE_VIDEO, container.getStream(0).getStreamCoder().getCodecType());
    assertEquals("unexpected codec type", ICodec.Type.CODEC_TYPE_AUDIO, container.getStream(1).getStreamCoder().getCodecType());
    assertEquals("unexpected codec type", ICodec.Type.CODEC_TYPE_SUBTITLE, container.getStream(2).getStreamCoder().getCodecType());
  }
View Full Code Here

  @Test
  public void testGetCodecTag()
  {
    IContainer container = IContainer.make();
    assertTrue("should be able to open",
        container.open("fixtures/subtitled_video.mkv", IContainer.Type.READ, null) >= 0);
    IStreamCoder coder = container.getStream(0).getStreamCoder();
   
    assertEquals("should be 0 by default", 0, coder.getCodecTag());
    coder.setCodecTag(0xDEADBEEF);
    assertEquals("should be set now", 0xDEADBEEF, coder.getCodecTag());
View Full Code Here

  @Test
  public void testGetCodecTagArray()
  {
    IContainer container = IContainer.make();
    assertTrue("should be able to open",
        container.open("fixtures/subtitled_video.mkv", IContainer.Type.READ, null) >= 0);
    IStreamCoder coder = container.getStream(0).getStreamCoder();
  
    char[] tag = coder.getCodecTagArray();
    assertNotNull("should exist", tag);
    assertEquals("should always be 4", 4, tag.length);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.