Package com.xuggle.xuggler

Examples of com.xuggle.xuggler.ICodec


    assertTrue("couldn't add a stream", mStream != null);

    mCoder = mStream.getStreamCoder();
    assertTrue("couldn't get a stream coder", mCoder != null);

    ICodec codec = ICodec.guessEncodingCodec(null, null, url, null,
        ICodec.Type.CODEC_TYPE_AUDIO);
    assertTrue("could not guess a codec", codec != null);

    mCoder.setCodec(codec);
    log.debug("Got codec: {}", mCoder.getCodec().getName());
View Full Code Here


    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);

    // create a place for video pictures

    IVideoPicture picture = IVideoPicture.make(IPixelFormat.Type.YUV420P, w, h);
View Full Code Here

   
    IMediaWriter writer = new MediaWriter(file.toString());

    // add the audio stream

    ICodec codec = ICodec.findEncodingCodec(ICodec.ID.CODEC_ID_MP3);
    IContainer container = writer.getContainer();
    IStream stream = container.getStream(
        writer.addAudioStream(audioStreamIndex, audioStreamId,
            codec, channelCount, sampleRate));
    int sampleCount = stream.getStreamCoder().getDefaultAudioFrameSize();
View Full Code Here

    IMediaWriter writer = new MediaWriter(file.toString());

    // add the audio stream

    ICodec codec = ICodec.findEncodingCodec(ICodec.ID.CODEC_ID_MP3);
    IContainer container = writer.getContainer();
    int streamIndex = writer.addAudioStream(
        audioStreamIndex, audioStreamId, codec, channelCount, sampleRate);
    IStream stream = container.getStream(streamIndex);
    int sampleCount = stream.getStreamCoder().getDefaultAudioFrameSize();
View Full Code Here

    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);

    // add the audio stream

    ICodec audioCodec = ICodec.findEncodingCodec(ICodec.ID.CODEC_ID_MP3);
    IContainer container = writer.getContainer();
    IStream stream = container.getStream(writer.addAudioStream(audioStreamIndex, audioStreamId,
      audioCodec, channelCount, sampleRate));
    int sampleCount = stream.getStreamCoder().getDefaultAudioFrameSize();
View Full Code Here

   
    IMediaWriter writer = new MediaWriter(file.toString());

    // add the audio stream

    ICodec codec = ICodec.findEncodingCodec(ICodec.ID.CODEC_ID_MP3);
    IContainer container = writer.getContainer();
    IStream stream = container.getStream(
        writer.addAudioStream(audioStreamIndex, audioStreamId,
            codec, channelCount, sampleRate));
    int sampleCount = stream.getStreamCoder().getDefaultAudioFrameSize();
View Full Code Here

    writer.setMaskLateStreamExceptions(true);

    // add the audio stream

    ICodec codec = ICodec.findEncodingCodec(ICodec.ID.CODEC_ID_MP3);
    IContainer container = writer.getContainer();
    IStream stream = container.getStream(
        writer.addAudioStream(audioStreamIndex, audioStreamId,
            codec, channelCount, sampleRate));
    int sampleCount = stream.getStreamCoder().getDefaultAudioFrameSize();
View Full Code Here

      format = null;
    }
    String url = getUrl();
    if (format == null && (url == null || url.length()<0))
      throw new IllegalArgumentException("Cannot guess codec without container or url");
    ICodec codec = ICodec.guessEncodingCodec(format,
        null, url, null,
        ICodec.Type.CODEC_TYPE_AUDIO);
    if (codec == null)
      throw new UnsupportedOperationException("could not guess audio codec");
   
    try {
      return addAudioStream(inputIndex, streamId, codec,
          channelCount, sampleRate);
    }
    finally
    {
      if (codec != null)
        codec.delete();
    }
  }
View Full Code Here

  public int addAudioStream(int inputIndex, int streamId,
      ICodec.ID codecId, int channelCount, int sampleRate)
  {
    if (codecId == null)
      throw new IllegalArgumentException("null codecId");
    ICodec codec = ICodec.findEncodingCodec(codecId);
    if (codec == null)
      throw new UnsupportedOperationException("cannot encode with codec: "+
          codecId);
    try
    {
      return addAudioStream(inputIndex, streamId, codec,
          channelCount, sampleRate);
    }
    finally
    {
      codec.delete();
    }
  }
View Full Code Here

      format = null;
    }
    String url = getUrl();
    if (format == null && (url == null || url.length()<0))
      throw new IllegalArgumentException("Cannot guess codec without container or url");
    ICodec codec = ICodec.guessEncodingCodec(format,
        null, url, null,
        ICodec.Type.CODEC_TYPE_VIDEO);
    if (codec == null)
      throw new UnsupportedOperationException("could not guess video codec");
   
    try {
      return addVideoStream(inputIndex, streamId,
          codec, frameRate,
          width, height);
    }
    finally
    {
      if (codec != null)
        codec.delete();
    }   
  }
View Full Code Here

TOP

Related Classes of com.xuggle.xuggler.ICodec

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.