How do I live encode a video in Java with JCodec?

653 Views Asked by At

In short, my question is: Which is the fastest format for encoding with JCodec, without loosing too much quality (like mangled colors)?

An example to what I mean with "Mangled colours, can be found in the videos in the description of this issue.

The rest here is contextual information to my considerations and what I have tried:

I am creating a screen recorder in Java. I have solved the issue of getting more than 10 FPS as BufferedImages (at least on Windows. Xorg is not very cooperative), but encoding is not fast enough to follow. My solution is threaded with a producer, ad consumer and a BlockingQueue for transfering frames.

I need it to be able to encode at least 15 FPS full HD, but more is better.

I probably need to re-encode after encoding the first time, but for now, I just want to store the frames without loosing too much quality, and saving at least some bits.

I am considering PRORES, since other formats does not seem to play well (most just doesn't write anything, and h.264 mangles the colours), but is that a viable alternative?

Other ways of storing a lot of BufferedImage objects are welcome too, but I would prefer encoding directly to video. (I was considering writing PNGs or BMPs enumerated to a zip, but have not gotten my head around it yet.)

0

There are 0 best solutions below