A modified Spout library using Boost::Python to enable Spout texture sharing using Python. Previous versions of this library have been tested with Python 3.5 / 3.6 / 3.7. This version of the library has been tested with Python 3.9 and a modern NVIDIA RTX A4000 GPU.
python test.py
or just check sample code in the test.py
# import library
from Library.Spout import Spout
def main() :
# create spout object
spout = Spout(silent = True)
# create receiver
spout.createReceiver('input')
# create sender
spout.createSender('output')
while True :
# check on exit
spout.check()
# receive data
data = spout.receive()
# send data
spout.send(data)
if __name__ == "__main__":
main()
If want multiple receivers/senders, check test_mult.py
Parameters and arguments for sender and receiver can be checked in the Library/Spout.py
Install Spout from here
pip install -r requirements.txt
- pygame
- pyopengl
- Allow multiple receivers senders
- Now it can be used as any python library, just few lines of code
- Automatically define the size of receiver and data to send
- Can change receiver size on the go
- Support different receiver/sender imageFormat/type