# Has anyone got P5 to work with Spout?

**URL:** <https://discourse.processing.org/t/has-anyone-got-p5-to-work-with-spout/38670>\
**Category:** p5py\
**Created:** [September 7, 2022, 4:51pm UTC](https://discourse.processing.org/t/has-anyone-got-p5-to-work-with-spout/38670 "2022-09-07T16:51:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DusX](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/dusx/32/16895_2.png) [@DusX](https://discourse.processing.org/u/DusX)\
**Post date:** [September 7, 2022, 4:51pm UTC](https://discourse.processing.org/t/has-anyone-got-p5-to-work-with-spout/38670/1 "2022-09-07T16:51:58Z")

</div>

I am interested in outputting the video created with P5 via Spout.  
see: [GitHub - jlai/Python-SpoutGL: Python wrapper for SpoutGL](https://github.com/jlai/Python-SpoutGL)  
I have this working with Pygame, but I would rather use P5  
Any help greatly appreciated.

---

<div class="post-metadata">

**Author:** ![tushar55](https://avatars.discourse-cdn.com/v4/letter/t/45deac/32.png) [@tushar55](https://discourse.processing.org/u/tushar55)\
**Post date:** [September 7, 2022, 5:33pm UTC](https://discourse.processing.org/t/has-anyone-got-p5-to-work-with-spout/38670/2 "2022-09-07T17:33:50Z")

</div>

Maybe I could help, but I am not sure what are you trying to do. Can you share some more information on it ?

---

<div class="post-metadata">

**Author:** ![DusX](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/dusx/32/16895_2.png) [@DusX](https://discourse.processing.org/u/DusX)\
**Post date:** [September 8, 2022, 4:05pm UTC](https://discourse.processing.org/t/has-anyone-got-p5-to-work-with-spout/38670/3 "2022-09-08T16:05:45Z")

</div>

Pygame uses PyOpenGL.  
In that environment, I create an off-screen surface (pygame surface), and a OpenGL texture.  
I draw to the surface using Pygame methods, and once complete use surfaceToTexture() to provide access for SpoutGL to send the texture.

I am not well versed in OpenGL. I understand P5 uses another library.  
Ideally, I would like to draw to an off-screen buffer and access it in OpenGL to send it via SpoutGL.

Not sure if that helps.

---

<div class="post-metadata">

**Author:** ![tushar55](https://avatars.discourse-cdn.com/v4/letter/t/45deac/32.png) [@tushar55](https://discourse.processing.org/u/tushar55)\
**Post date:** [September 15, 2022, 4:26pm UTC](https://discourse.processing.org/t/has-anyone-got-p5-to-work-with-spout/38670/4 "2022-09-15T16:26:20Z")

</div>

Apologies for the late reply. I am not sure why I am not getting notifications from Discourse.

I think the new create graphics API in the experimental  
skia renderer will help you with the offscreen rendering task.

You can access the surface and canvas of that offscreen buffer and use it.

Also the default sketch’s surface and canvas are directly accessible as well.

Take a look at SkiaSurface and SkiaCanvas in Skia’s docs to convert them into suitable format to send it further
