【问题标题】:Get Video from frames in Xuggler从 Xuggler 中的帧获取视频
【发布时间】:2011-12-29 07:41:58
【问题描述】:

我正在尝试使用 xuggler 将图像列表编码为视频。我有一组缓冲图像。我正在使用以下代码。

public void encodeImage(BufferedImage originalImage, long timestamp) 
{

    //  BufferedImage worksWithXugglerBufferedImage = convertToType(originalImage, BufferedImage.TYPE_3BYTE_BGR);

    BufferedImage worksWithXugglerBufferedImage = convertToType(originalImage, BufferedImage.TYPE_3BYTE_BGR);

    IPacket packet = IPacket.make();
    IConverter converter = ConverterFactory.createConverter(worksWithXugglerBufferedImage, IPixelFormat.Type.YUV420P);

    IVideoPicture outFrame = converter.toPicture(worksWithXugglerBufferedImage, timestamp * 1000);
    outFrame.setQuality(0);


    outStreamCoder.encodeVideo(packet, outFrame, 0);

    if (packet.isComplete()) 
        outContainer.writePacket(packet); 

}

问题是它返回我以下错误..

[WARN] [NioProcessor-1] com.xuggle.xuggler - Got error: picture is not of the same width as this Coder (../../../../../../../csrc/com/xuggle/xuggler/StreamCoder.cpp:1204)
[WARN] [NioProcessor-1] com.xuggle.xuggler - Got error: picture is not of the same width as this Coder (../../../../../../../csrc/com/xuggle/xuggler/StreamCoder.cpp:1204)
[WARN] [NioProcessor-1] com.xuggle.xuggler - Got error: picture is not of the same width as this Coder (../../../../../../../csrc/com/xuggle/xuggler/StreamCoder.cpp:1204)
[WARN] [NioProcessor-1] com.xuggle.xuggler - Got error: picture is not of the same width as this Coder (../../../../../../../csrc/com/xuggle/xuggler/StreamCoder.cpp:1204)
[WARN] [NioProcessor-1] com.xuggle.xuggler - Got error: picture is not of the same width as this Coder (../../../../../../../csrc/com/xuggle/xuggler/StreamCoder.cpp:1204)

错误是由于outFrame产生的,我检查了创建的框架的宽度和高度,图片是一样的。任何人都可以在这里帮助我或给我一个提示..

我使用了这里的来源。谢谢。

http://wiki.xuggle.com/Encoding_Video_from_a_sequence_of_Images

【问题讨论】:

    标签: java eclipse flash-builder xuggle xuggler


    【解决方案1】:

    问题是先生,您一定是错误地设置了外流的高度和宽度。例如

    outStreamCoder.setHeight(height);
    outStreamCoder.setWidth(width); 
    

    您应该在此处正确放置视频高度,宽度也应如此。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多