Passing binary data via network

mattgolsen's picture

Does anyone know of a way to pass binary data, like images or a video feed from one composition to another? I'm thinking like the Network Send/Receive patches except instead of a string, changing it to an "Image" data type, or even audio...

Any pro/cons for this?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

cwright's picture
Re: Passing binary data via network

Pros:

  • Awesome
  • Useful

Cons:

  • Not (currently) Possible

Images, sadly, aren't just "binary data" (well, they are, but more abstractly) -- if they come off the end of a CoreImage filter chain, the image is actually a CI "recipe" that can use several images + filters for the final result. Sending all image data + recipe is expensive, bandwidth-wise, and evaluating it ("flattening") locally can be compute-intensive (no more so than just drawing it on the screen, however). Just a complication, not an impossibility.

Audio is another can of worms, since you have realtime deadline constraints that most networks are not designed to handle perfectly. Another complication, not an impossibility. (QC's overall lack of audio support is a much larger hurdle to deal with first, in my opinion).

mattgolsen's picture
Re: Passing binary data via network

For the image portion could you have something that "flattens" (thinking like Photoshop here), all of those recipes and filters down in some way? I think the biggest win would be image data, audio definitely a secondary thought.

cwright's picture
Re: Passing binary data via network

yeah, flattening is totally possible (that's what CoreImage does when you ask for the resultant image in a non-CI format -- it renders stuff at that point). I had mentioned that (it's the compute intensive part).

QC obfuscates image data a fair amount (it has to, to juggle PDF/vector images, CI recipes, static images, QT images, etc all seamlessly as it does), which makes it tricky, but, like I said, not impossible. It's simply a matter of finding an elegant way to do so. QC also likes to store images on the GPU when possible, and reading those (vram -> sys ram) is very expensive.

When I said not currently possible, I meant that there aren't any patches that do what you're looking for currently, not that it's extraordinarily difficult technically infeasible or something :)

mattgolsen's picture
Re: Passing binary data via network

One of the guys I work with made a structure patch from this image pixel reader plugin, but we didn't have a way of reassembling the bits after turning it into the structure. It was sort of an inadvertent idea as he was trying to create a bar code reader... it would have worked... I think.

At any rate, thanks for entertaining my musings. I've often wondered why something like this wasn't in QC. Makes sense now!

usefuldesign.au's picture
Re: Passing binary data via network

mattgolsen wrote:
One of the guys I work with made a structure patch from this image pixel reader plugin, but we didn't have a way of reassembling the bits after turning it into the structure.

Hey matt. Here is comp I added a reassemble-the-bits patch to for Tangible Interactive. The particle-generator and the image strip marker is Tangible's and is used to feed a custom patch that drives an LED 5x7 matrix display via a private custom plugin.

[Reassemble strip image with ImagePixel patch qtz comp](http://kineme.net/files/CK Rainbow Box 7i.qtz)

There is a plugin called Image PixelS which you need to download for my other comp. This comp uses the plugin's patch to generate the numeric structures (RGB|A) which I fold into a single structure. Then a simple nested iterator setup generates the pixel grid at an enlarged size (you choose how big!) from the structure. It's a crude implementation but much faster than other patch. (Typically 2-3 times or, to use Applespeak, up to 4x faster comparing old min fps to new max fps ;) )

There's a NI flipimage patch which isn't required if you don't have it just noodle the two Rain Effect patches together and skip it and watch the rain rise. Rain Effect part of patch is by Alex of Tangible Interactive. Just don't attach a large image the input port or it will put QC into a deep deep slumber...FQuit required unless you can wait it out.

Faster Bit-Strip-and-Reconstitute qtz comp

PreviewAttachmentSize
CK Rainbow Box 7i.qtz221.72 KB
pixelS.foo_.qtz180.46 KB