boolean write = false; int skip = 0; private class AppSinkListener implements AppSink.NEW_SAMPLE { public void rgbFrame(int width, int height, IntBuffer rgbBuffer) { // If the EDT is still copying data from the buffer, just drop this frame if (!bufferLock.tryLock()) { return; } skip++; BufferedImage img = new BufferedImage(3440, 1440, 1); int[] rgbArray = new int[rgbBuffer.capacity()]; rgbBuffer.rewind(); rgbBuffer.get(rgbArray); img.setRGB(0, 0, img.getWidth(), img.getHeight(), rgbArray, 0, img.getWidth()); try { // skip some frames if (!write && skip == 90) { write = true; ImageIO.write(img, "jpg", new File("screenshot.jpg")); } } catch (IOException e) { throw new RuntimeException(e); }
Hi all,
I'm screen capturing using GStreamer bindings for Java without problems since a lot of time,
it works super awesome at all screen resolutions.
I'm using a pipeline like this:
d3d11screencapturesrc monitor-handle={0} ! d3d11convert ! d3d11download ! video/x-raw(memory:SystemMemory),width=3440,height=1440
this pipeline works as expected.
I recently switched to this "new pipeline" that should be more optimized for the purpose:
d3d11screencapturesrc monitor-handle={0} ! d3d11convert ! video/x-raw(memory:D3D11Memory),width=3440,height=1440
this "new pipeline" works well at every screen resolutions except 3440x1440,
I even tried another 21:9 resolution like 2560x1080 and it works well at 2560x1080 but not on 3440x1440.
--
You received this message because you are subscribed to the Google Groups "gstreamer-java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gstreamer-jav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gstreamer-java/8fe58dc4-ad16-094d-08fd-94bfe75e3c9a%40dpsoftware.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/gstreamer-java/CABYxBqpW71rXKgq%2Bkx-yfuEMXcfD3%2Bj4_WJWf3X0%2BsENwaw4cA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gstreamer-java/186b3655118.2883.3c8a1e3a2388806d058c6e4a23c6ecab%40dpsoftware.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/gstreamer-java/c7de7227-b768-48ce-a3b4-fcfc35c79b95n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gstreamer-java/78801434-21e9-5f9b-5258-9c7e1086a304%40laposte.net.
To view this discussion on the web visit https://groups.google.com/d/msgid/gstreamer-java/2adc2169-1158-882d-611a-a8daa58b87a0%40laposte.net.
To view this discussion on the web visit https://groups.google.com/d/msgid/gstreamer-java/c6a8ce1d-6c0d-4663-beac-c5d8cc86ae92%40dpsoftware.org.
--
You received this message because you are subscribed to the Google Groups "gstreamer-java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gstreamer-jav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gstreamer-java/0495bcc8-c477-4a9a-8a19-f6499de43b66n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gstreamer-java/0512a7a6-f153-45b0-a39a-a48ec6011e73n%40googlegroups.com.
private class AppSinkListener implements AppSink.NEW_SAMPLE { public void rgbFrame(int width, int height, IntBuffer rgbBuffer) {
int capacity = rgbBuffer.capacity(); // at 3440x1440 resolution this number is 4.976.640 final int exectedCapacityWithoutStride = 3440*1440; // this constant equals to 4.953.600 int tmp = capacity - exectedCapacityWithoutStride; // this equals to 23.040 int tmp2 = tmp / 1440; // that equals to 16 int stride = 3440 + tmp2; // that equals to your stride 3.456
To view this discussion on the web visit https://groups.google.com/d/msgid/gstreamer-java/dafc4bc7-ff42-9ff5-5c57-04d8c3382950%40laposte.net.
To view this discussion on the web visit https://groups.google.com/d/msgid/gstreamer-java/e1535b8d-c356-4090-a2a3-7cf6b620dad1%40dpsoftware.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/gstreamer-java/cb85d888-a4b9-7949-d8a3-ecca5446524f%40laposte.net.
To view this discussion on the web visit https://groups.google.com/d/msgid/gstreamer-java/de2fdeb0-40a7-42d5-a95f-3fd1b37dc5e7%40dpsoftware.org.
Stream.of(registration(VideoMeta.class, VideoMeta.GTYPE_NAME, VideoMeta::new)); buffer.getMeta(VideoMeta.API).getStrideForPlane(0) buffer.getMeta(VideoMeta.API).getStrideForPlane(1)
You received this message because you are subscribed to a topic in the Google Groups "gstreamer-java" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gstreamer-java/q0juwEUJiWc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gstreamer-jav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gstreamer-java/2ba134fd-2609-43a6-a1df-e2126283a5df%40dpsoftware.org.