Huge CPU load with JavaFX

138 views
Skip to first unread message

Valentin Dubois-Pivot

unread,
Feb 18, 2022, 11:09:42 AM2/18/22
to gstreamer-java
Hi,
 
I'm having a performance problem with my JavaFX + GStreamer application. It receives two RAW video streams via the network and then displays them using FXImageSink.
Using the "top" or "htop" command in a terminal, my application easily exceeds 250% or even 300% when displaying the videos. When we stop sending the video streams, the application returns between 5% and 15% CPU load.
 
Configuration:
- Ubuntu 20.04
- Java 11
- JavaFX 17

Unfortunately, I can't post code samples but I use a classic software like the FXCamera demo.
 
Is the problem with the color conversion between GStreamer and the JavaFX display?
 
Can I convert to the correct color format using GStreamer and then pass it to JavaFX?
 
Is it possible to replace PixelBuffer in FXImageSink with the aparapi library (https://github.com/Syncleus/aparapi) to send all the processing to the GPU?

Neil C Smith

unread,
Feb 18, 2022, 11:22:37 AM2/18/22
to gstream...@googlegroups.com
On Fri, 18 Feb 2022 at 16:09, Valentin Dubois-Pivot
<valentin.d...@gmail.com> wrote:
> Unfortunately, I can't post code samples but I use a classic software like the FXCamera demo.

If you can't post code samples, there is probably little anyone can
help with on this list. I can, and do, offer private commercial
support if that's of interest - you can email me off list.

> Is the problem with the color conversion between GStreamer and the JavaFX display?

Possibly ...

> Can I convert to the correct color format using GStreamer and then pass it to JavaFX?

It's already converted using GStreamer to *a* colour format supported by JavaFX.

> Is it possible to replace PixelBuffer in FXImageSink with the aparapi library (https://github.com/Syncleus/aparapi) to send all the processing to the GPU?

I doubt that's the right solution. But certainly JavaFX can be
problematic to work with, and the PixelBuffer API is OK but not
brilliant. What the right solution is for your use case really
depends on your use case!

Best wishes,

Neil

--
Neil C Smith
Codelerity Ltd.
www.codelerity.com

Codelerity Ltd. is a company registered in England and Wales
Registered company number : 12063669
Registered office address : Office 4 219 Kensington High Street,
Kensington, London, England, W8 6BD
Reply all
Reply to author
Forward
0 new messages