Java - Xuggler - Encode FFV1

mvv

New Member
I want to encode some ByteBuffers as FFV1 video. I use LWJGL/OpenGL to draw and currently glReadPixels to populate the ByteBuffer.This totally works when I encode as HuffYUV:\[code\]final IMediaWriter writer = ToolFactory.makeWriter(url);final int stream = writer.addVideoStream(0, 0, ICodec.ID.CODEC_ID_HUFFYUV, scene.getWidth(), scene.getHeight());final IStreamCoder streamCoder = writer.getContainer().getStream(stream).getStreamCoder();streamCoder.setPixelType(IPixelFormat.Type.RGB24);final IVideoPicture picture = IVideoPicture.make(IPixelFormat.Type.RGB24, scene.getWidth(), scene.getHeight());picture.setQuality(0);final ByteBuffer bb = picture.getByteBuffer();picture.setTimeStamp(100000L * frame / scene.framerate);// renderglReadPixels(0, 0, scene.getWidth(), scene.getHeight(), GL_RGB, GL_UNSIGNED_BYTE, bb);writer.encodeVideo(stream, picture);\[/code\]This is a simplified version, actually the re is loop in there, but it works.However, when I try to change to codec to ICodec.ID.CODEC_ID_FFV1 it just tells me "Failed to envode video".After I searched a bit, it seems like FFV1 prefers BGR0 as pixel format. So when I set the pictures pixel format to IPixelFormat.Type.BGR0 and glReadPixels to GL_BGR it doesn't complian, but creates a file 10 times larger then the HuffYUV video transcoded to FFV1 via FFMPEG that just contains black and some light grey raster.I also tried to use IVideoResampler:\[code\]pictureIn = IVideoPicture.make(IPixelFormat.Type.RGB24, scene.getWidth(), scene.getHeight());glReadPixels(0, 0, scene.getWidth(), scene.getHeight(), GL_RGB, GL_UNSIGNED_BYTE, pictureIn.getByteBuffer());pictureOut = IVideoPicture.make(IPixelFormat.Type.BGR0, scene.getWidth(), scene.getHeight());resampler.resample(pictureOut, pictureIn);\[/code\]It it always returns -1, what is the error code for "Operation not permitted".Does anyone has an idea how to encode FFV1 with xuggler?Or a comparable lossless codec that accepts RGB color space?HuffYUV creates way too large files.
 
Back
Top