Package com.xuggle.xuggler.video

Examples of com.xuggle.xuggler.video.IConverter


  private IVideoPicture convertToPicture(int streamIndex, BufferedImage image,
    long timeStamp)
  {
    // lookup the converter

    IConverter videoConverter = mVideoConverters.get(streamIndex);

    // if not found create one

    if (videoConverter == null)
    {
      IStream stream = mStreams.get(streamIndex);
      IStreamCoder coder = stream.getStreamCoder();
      videoConverter = ConverterFactory.createConverter(
        ConverterFactory.findDescriptor(image),
        coder.getPixelType(),
        coder.getWidth(), coder.getHeight(),
        image.getWidth(), image.getHeight());
      mVideoConverters.put(streamIndex, videoConverter);
    }

    // return the converter
   
    return videoConverter.toPicture(image, timeStamp);
  }
View Full Code Here


    if (coder.getCodecType() == ICodec.Type.CODEC_TYPE_VIDEO &&
      getMode().showVideo())
    {
      // create a converter for this video stream

      IConverter converter = mConverters.get(streamIndex);
      if (null == converter)
      {
        converter = ConverterFactory.createConverter(
            ConverterFactory.XUGGLER_BGR_24, coder.getPixelType(), coder
                .getWidth(), coder.getHeight());
View Full Code Here

    {
      // if the image is null, convert the picture to the image

      if (null == image)
      {
        IConverter converter = mConverters.get(mStreamIndex);
        image = converter.toImage(picture);
      }

      if (mShowStats)
      {
        drawStats(picture, image);
View Full Code Here

    long now = System.currentTimeMillis();
    if (firstTimeStamp == -1)
      firstTimeStamp = now;
   
    IConverter converter = null;
    try
    {
      converter = ConverterFactory.createConverter(
          worksWithXugglerBufferedImage, IPixelFormat.Type.YUV420P);
    }
    catch (UnsupportedOperationException e)
    {
      System.out.println(e.getMessage());
      e.printStackTrace(System.out);
    }

    long timeStamp = (now - firstTimeStamp)*1000; // convert to microseconds
    IVideoPicture outFrame = converter.toPicture(worksWithXugglerBufferedImage,
        timeStamp);

    outFrame.setQuality(0);
    int retval = outStreamCoder.encodeVideo(packet, outFrame, 0);
    if (retval < 0)
View Full Code Here

    if (picture == null)
      throw new IllegalArgumentException("The video picture is NULL.");

    // create the converter

    IConverter converter = ConverterFactory.createConverter(
      ConverterFactory.XUGGLER_BGR_24, picture);

    // return the conveter

    return converter.toImage(picture);
  }
View Full Code Here

        " but is required to be BufferedImage.TYPE_3BYTE_BGR of type #" +
        BufferedImage.TYPE_3BYTE_BGR + ".");

    // create the converter

    IConverter converter = ConverterFactory.createConverter(
      image, IPixelFormat.Type.BGR24);

    // return the converted picture

    return converter.toPicture(image, pts);
  }
View Full Code Here

  private IVideoPicture convertToPicture(int streamIndex, BufferedImage image,
    long timeStamp)
  {
    // lookup the converter

    IConverter videoConverter = mVideoConverters.get(streamIndex);

    // if not found create one

    if (videoConverter == null)
    {
      IStream stream = mStreams.get(streamIndex);
      IStreamCoder coder = stream.getStreamCoder();
      videoConverter = ConverterFactory.createConverter(
        ConverterFactory.findDescriptor(image),
        coder.getPixelType(),
        coder.getWidth(), coder.getHeight(),
        image.getWidth(), image.getHeight());
      mVideoConverters.put(streamIndex, videoConverter);
    }

    // return the converter
   
    return videoConverter.toPicture(image, timeStamp);
  }
View Full Code Here

    {
      // if the image is null, convert the picture to the image

      if (null == image)
      {
        IConverter converter = mConverters.get(mStreamIndex);
        image = converter.toImage(picture);
      }

      if (mShowStats)
      {
        drawStats(picture, image);
View Full Code Here

    if (coder.getCodecType() == ICodec.Type.CODEC_TYPE_VIDEO &&
      getMode().showVideo())
    {
      // create a converter for this video stream

      IConverter converter = mConverters.get(streamIndex);
      if (null == converter)
      {
        converter = ConverterFactory.createConverter(
            ConverterFactory.XUGGLER_BGR_24, coder.getPixelType(), coder
                .getWidth(), coder.getHeight());
View Full Code Here

    long now = System.currentTimeMillis();
    if (firstTimeStamp == -1)
      firstTimeStamp = now;
   
    IConverter converter = null;
    try
    {
      converter = ConverterFactory.createConverter(
          worksWithXugglerBufferedImage, IPixelFormat.Type.YUV420P);
    }
    catch (UnsupportedOperationException e)
    {
      System.out.println(e.getMessage());
      e.printStackTrace(System.out);
    }

    long timeStamp = (now - firstTimeStamp)*1000; // convert to microseconds
    IVideoPicture outFrame = converter.toPicture(worksWithXugglerBufferedImage,
        timeStamp);

    outFrame.setQuality(0);
    int retval = outStreamCoder.encodeVideo(packet, outFrame, 0);
    if (retval < 0)
View Full Code Here

TOP

Related Classes of com.xuggle.xuggler.video.IConverter

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.