// PIXELFORMAT, width, height, bgrImage.getWidth(), bgrImage
// .getHeight());
converter = ConverterFactory.createConverter("XUGGLER-BGR-24",
pixelformat, width, height, width, height);
} catch (UnsupportedOperationException e) {
videoSharingSession.reportError(new EncodingException(e));
return;
}
}
image = Decoder.resample(image, new Dimension(width, height));
long timeStamp = (now - firstTimestamp) * 1000; // convert to
// microseconds
com.xuggle.xuggler.IVideoPicture outFrame = converter.toPicture(
convertToType(image, BufferedImage.TYPE_3BYTE_BGR), timeStamp);
if ((errorNumber = coder.encodeVideo(packet, outFrame, 0)) < 0) {
videoSharingSession.reportError(new EncodingException(IError.make(
errorNumber).getDescription()));
return;
}
if (packet.isComplete()) {
if ((errorNumber = container.writePacket(packet)) < 0) {
videoSharingSession.reportError(new EncodingException(IError
.make(errorNumber).getDescription()));
return;
}
}
}