TCPIP bridge : early stages of development

Posted by Ryan Webber on 1 December 2015 | Comments

Tags: , , , , , , ,

Over the past few months, I have needed a few extras from some of my interactive media projects.
Since most of my work is done within the Isadora media control software, I started looking for ways to add features to the system in an easy and extensible fashion.
Python being a fast and powerful language; as well as, a language I enjoy working in seemed to be a natural option for creating features.. but how to integrate it with Isadora.

Well, my years of web development, have made me very accustom to HTTP, TCP-IP, and Restful API's so I looked for the best way to marry these elements since both Isadora and Python speak TCP-IP.
My very first test used the Cherrypy python framework. It worked beautifully, and I was able to get my first few projects running with this as my framework, however; after some time, I started to see how I might want to extend beyond the scope of Cherrypy (well beyond what I could find intermediate documentation for.. this was the problem in the end with Cherrypy, there just wasn't a wide variety of documentation due to the small user base), so I started looking for alternatives.
Next I migrated my code to Flask. This framework was lightweight like Cherrypy, and had a larger community so documentation was easy to find, additionally it was easily extended, and could become nearly anything I would want.
Somehow... I didn't love it.. and with some web dev work coming up, I was interested in a framework I could use for both purposes. Flask wasn't it for a few personal reasons.. it didn't feel right.

Django, the best known of the Python web frameworks, had seemed like overkill for my media related work, but after some research and reading articles on 'light weight Django' and finding a great hosted Django CMS service for my upcoming web dev work, I started porting my code once again to Django.
After having some issues with the built in dev webserver, I added an async webserver, Tornado, it solved my only problem with the framework and opened up options for communicating with web-sockets (something I was doing for an installation piece). Django had it all, and this time it stuck. 

I tried to wrap up the web based API in a Kivy UI, using a chrome browser widget.. but it just wasn't stable.. the browser object would randomly crash, and lock everything up.
I dropped Kivy (for now) and whipped up a QT (pyside) UI, with a webkit browser widget. Did some heavy testing and Yes.. its stable.
Strapped in Bootstrap, added a nice dark theme and started to document the API.
This is where I was at when I did this screen capture of a simple Isadora patch sending a TCP-IP get request to TCPIPbridge, and it in return opening an EXE that outputs video via Spout video sharing to Isadora where it is live mixed.

Since recording this video, a number of things have been added, and 'User Actors' for Isadora have been created that make the use of the API very easy.
More work it being done to find any issue related to working with different media types so the API is expanding quickly.

A few things I am thinking about adding are:

  1. screen capture (define region?)
  2. getImage (from URL with scraping)
  3. save image as (over internal image)
  4. stream live data sources (web-sockets) via OSC
  5. Twilio ??
  6. print (passed string or file)
  7. twitter latest post
  8. Facebook latest post
  9. webscraper with jquery like selector
  10. opencv tracking
  11. and more..

For now this is just a place where I can document my thoughts, and maintain a list of options ;)