<div><div><div dir="auto">I am in touch with Nvidia & while it builds, it doesn’t run correctly for some reason. Difficult to debug because they use a closed source per-built lib.</div></div><div dir="auto"><br></div><div dir="auto">That’s why I am trying to figure out how they used xcb (which it sounds like they did).</div><div dir="auto"><br></div><div dir="auto">They’re trying to figure out why. Its docs are from 2015.</div></div><div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 5, 2019 at 10:21 PM James Jones <<a href="mailto:jajones@nvidia.com" target="_blank">jajones@nvidia.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If you want to do this specifically on NVIDIA cards with NVENC, you'll <br>
more than likely want to be using this:<br>
<br>
<a href="https://developer.nvidia.com/capture-sdk" rel="noreferrer" target="_blank">https://developer.nvidia.com/capture-sdk</a><br>
<br>
This will be much faster and lower latency than grabbing desktop content <br>
using shared memory via XCB commands.<br>
<br>
Thanks,<br>
-James<br>
<br>
On 8/5/19 9:49 AM, Suhail Doshi wrote:<br>
> Thanks so much Peter. I'll look at this stuff today.<br>
> <br>
> Question: Do you have any guidance on how to extract/use the OBS library <br>
> that's cross-platform? I wouldn't want to include everything that OBS <br>
> has to offer to keep the footprint of our application low. Any docs on <br>
> their API as well?<br>
> <br>
> Suhail<br>
> <br>
> --<br>
> <br>
> Founder<br>
> <br>
> <br>
> On Mon, Aug 5, 2019 at 9:20 AM Peter Harris <<a href="mailto:peter@harr.ca" target="_blank">peter@harr.ca</a> <br>
> <mailto:<a href="mailto:peter@harr.ca" target="_blank">peter@harr.ca</a>>> wrote:<br>
> <br>
> On 2019-08-05 11:07 a.m., Suhail Doshi wrote:<br>
> > My question is: Is there a way to get an image of the desktop that<br>
> > returns a pointer that's GPU memory? For example, in Windows 10,<br>
> there's<br>
> > an API called the Desktop Duplication API which will allows you to do<br>
> > this. Then, it lets you copy the data in that GPU memory block to<br>
> > another one such that you can encode the frame with H264, for<br>
> example. I<br>
> > am using NVIDIA GPUs and utilizing their NVENC SDK.<br>
> ><br>
> > I am looking for an equivalent.<br>
> <br>
> XCB is very low-level. For most things, you probably want to use a<br>
> higher level library (such as, for example, OBS:<br>
> <a href="https://github.com/obsproject/obs-studio" rel="noreferrer" target="_blank">https://github.com/obsproject/obs-studio</a> , which includes a<br>
> cross-platform library with an API that is probably closer to the<br>
> Desktop Duplication API than anything in XCB).<br>
> <br>
> With that said, if you want to implement the details yourself, you can<br>
> take a peek inside OBS and see that the capture method that copies<br>
> uncompressed pixels back to main memory uses xcb_shm_get_image (and<br>
> xcb_xfixes_get_cursor_image, and xcb_xinerama_query_screens, among other<br>
> things).<br>
> <a href="https://github.com/obsproject/obs-studio/blob/master/plugins/linux-capture/xshm-input.c" rel="noreferrer" target="_blank">https://github.com/obsproject/obs-studio/blob/master/plugins/linux-capture/xshm-input.c</a><br>
> <br>
> Peter Harris<br>
> <br>
> <br>
> _______________________________________________<br>
> Xcb mailing list<br>
> <a href="mailto:Xcb@lists.freedesktop.org" target="_blank">Xcb@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/xcb" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/xcb</a><br>
> <br>
</blockquote></div></div>-- <br><div dir="ltr" class="m_-7070519220509347404gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><br></div><div dir="ltr">Suhail</div><div dir="ltr"><br></div><div dir="ltr">--</div><div dir="ltr"><br></div><div dir="ltr">Founder</div></div></div></div></div>
</div>