what is the optimal workflow to encode bufferedimage animations of TYPE_INT_ARGB (alpha composite)? #2085
-
Hi, this is my first attempt to use this excellent library. I need to create high resolution videos from bufferedimage animations (timers in paintcomponent), with extensive use of alpha transparency by using alpha composite and custom composite objects. Bufferedimages are of TYPE_INT_ARGB. I was wondering what is the optimal way to encode this animation with ffmpeg to a high quality video. Nvidia RTX GPU acceleration would be great if it could be used. As far as I can see there is a setPixelFormat(AV_PIX_FMT_RGBA); that sets the pixel format the RGBA realm, is that OK to use, is it optimal? Do I have to use this to have the highest encoding quality? Do I have to use a specific encoder as an intermediaten video and then use the ("h264_nvenc") GPU-accelerated codec for the final export? Confused! Thanks... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 15 replies
-
If you're saying you want to encode in RGBA, you'll need to select manually a codec that supports that pixel format, yes, but that's it. Not many do support that though. |
Beta Was this translation helpful? Give feedback.
OK I have found a solution and surprisingly is fast enough in my case. Here is the code for conversion on the BufferedImage level and used in convertImageToFrame,.