JavaFX, GStreamer and screen recording.

John Hendrikx john.hendrikx at gmail.com
Tue May 23 11:19:42 UTC 2023


Hi, in my opinion, JavaFX is first and foremost a framework that 
provides an abstraction that hides the underlying implementations of the 
platform it runs on (DirectX/3D, OpenGL but also GStreamer).  GStreamer 
is indeed currently used, but that does not mean that JavaFX can expose 
all its functionalities as that would tie the platform to this library 
(GStreamer is just the means to an end, but by no means the only option).

Instead, exposing such additional functionality would first require a 
well researched design of how this should be abstracted in JavaFX. This 
should/must be GStreamer independent, and may/will require looking at 
GStreamer alternatives to come to a balanced, universally applicable and 
future proof API design.

So although I can't answer your question if such functionality will ever 
be in JavaFX, I do think it would be a massive undertaking.  It is also 
a relatively niche feature that most FX applications will never need, so 
I don't think it will be soon. In the mean time, you could use your own 
GStreamer bindings or look into OpenCV (org.bytedeco.javacv). Although I 
haven't used this API to do what you want, I do know it provides easy 
access to ffmpeg and computer vision and camera related features.  It's 
a lot more complicated to use than JavaFX, but should give you the 
flexibility you need.

--John

On 23/05/2023 10:42, Davide Perini wrote:
>
> Hi all,
> as far as I know JavaFX uses GStreamer for the video player 
> functionalities.
>
> Why don't use GStreamer for screen recording too?
>
> GStreamer is much faster than everything else in the Java world since 
> it uses native APIs like Desktop Duplication API in Windows and native 
> APIs on Mac and Linux.
>
> Will we ever see a real screen recording feature in JavaFX that uses 
> GStreamer?
>
> Thanks
>
> Davide
>


More information about the openjfx-dev mailing list