Does GStreamer Java support the GStreamer d3d11videosink or autovideosink?

110 views
Skip to first unread message

Davide Perini

unread,
Dec 16, 2020, 10:32:30 AM12/16/20
to gstreamer-java
Hi all,
loving gstreamer and gstreamer Java, thanks Neil for it.

In this merge request:
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1855

Seungha Yang rewrited how to screen capture using GStreamer.

I have downloaded the win64 binary from the CI from here:
https://gitlab.freedesktop.org/seungha.yang/gst-plugins-bad/-/jobs/6185452/artifacts/download?file_type=archive

and trying to make it work with gstreamer java 1.3.0.

this code works well
GStreamerGrabber vc = new GStreamerGrabber();
Bin bin;

    bin = Gst.parseBinFromDescription( "d3d11desktopdupsrc ! d3d11convert",true);

pipe = new Pipeline();
pipe.addMany(bin, vc.getElement());
Pipeline.linkMany(bin, vc.getElement());
JFrame f = new JFrame(Constants.SCREEN_GRABBER);
f.add(vc);
vc.setPreferredSize(new Dimension((int)screenSize.getWidth(), (int)screenSize.getHeight()));
f.pack();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
pipe.play();
f.setVisible(false);

public GStreamerGrabber(AppSink appsink) {

    this.videosink = appsink;
    videosink.set(Constants.EMIT_SIGNALS, true);
    AppSinkListener listener = new AppSinkListener();
    videosink.connect(listener);
    String gstreamerPipeline = "video/x-raw(memory:D3D11Memory),";
        gstreamerPipeline += framerate=30/1,";
    StringBuilder caps = new StringBuilder(gstreamerPipeline);
    videosink.setCaps(new Caps(caps.toString()));
    setLayout(null);
    setOpaque(true);
    setBackground(Color.BLACK);

}


but as soon as I add the d3d11videosink

    bin = Gst.parseBinFromDescription( "d3d11desktopdupsrc ! d3d11convert ! d3d11videosink",true);
it stops capturing without a real error msg. when using d3d11videosink it opens a strange windows titled "D3D11renderer" with a black image in it.

Does gstreamer java supports d3d11videosink?
If yes, what is the right way of using it?

I have the same strange behaviour using autovideosink,
how can I use videosink?

Thank you!

Davide


Neil C Smith

unread,
Dec 16, 2020, 10:41:34 AM12/16/20
to gstream...@googlegroups.com
On Wed, 16 Dec 2020 at 15:32, Davide Perini
<perini...@dpsoftware.org> wrote:
> Does gstreamer java supports d3d11videosink?
> If yes, what is the right way of using it?

You can use any element that GStreamer has. Which is not the same as
saying we have full API coverage .. yet.

However, your question doesn't make sense - you can use an AppSink or
you can use d3d11videosink. But there's no need for both.

Do you need the video data in Java, or do you want to display the
capture in a window with d3d11videosink?

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

Davide Perini

unread,
Dec 18, 2020, 10:18:31 AM12/18/20
to gstream...@googlegroups.com
Ok now I understood what audiovideosink does.

Thanks
Davide

ahmadreza soltani

unread,
Jan 29, 2023, 1:48:11 AM1/29/23
to gstreamer-java
Hi, dear
I want to use gstreamer autovideosink in my java swing component.
May you share your java codes with me?

Thanks.

Davide Perini

unread,
Mar 5, 2023, 9:52:28 AM3/5/23
to gstreamer-java
Reply all
Reply to author
Forward
0 new messages