Question

I have been using Flash + Zinc for a while to create simple interactive software for live TV shows, mostly for quiz shows, live election results and other scenarios where visuals cannot be prepared previously and need to respond to an ongoing situation. The video signal would then be output from a video out port or a VGA to video converter, and would go through the video mixer where it would be luma or chroma-keyed. Under this setup, the controls for the application would reside beneath the area being output to video.

The only problem with this setup is that there is no alpha channel, and using luma and chroma-keying is very limited.

To solve this problem I started to use Caspar CG. To my best understanding this software system takes the SWF and plays it in an ActiveX Flash Player, from which it is able to extract both the color and the alpha channel, and send them to a professional DeckLink Card which supports separated color and alpha channels. The whole thing works extremely well visually, but since the ActiveX control is not visible during playback, there is no way for my SWF to capture mouse or keyboard events.

I tried to have the SWF poll a local web server for input, but while it works while testing in Adobe Flash, it fails during playback in the ActiveX hosted by Caspar CG Server. From what I read this has to do with the security policies embedded in the Flash Player, and there was not much I could do about it.

I ended up having the SWF poll a local file for new commands at 100 ms intervals. In the meanwhile a simple controlling application (JS + PHP in a local XAMPP server - just because I am very at ease with web development) would write the command in the text file corresponding to the button pressed.

This has caused some issues when the file was open by either Flash or PHP, and I got around to this by having both parties retry reading/writing until they succeeded.

All in all, the setup works, but I feel it cannot be less elegant than this. For one, I found no way for the SWF to write to a local text file in order to report on its status, so a lot of advanced functionality is impractical to achieve (even basic ui stuff, like disabling buttons on the controller side while certain animations are being played on the SWF).

My questions are not even clear to me, but here they are:

  1. Is it possible for a locally played SWF to write to disc?
  2. Can anyone suggest a better way of doing the whole communication thing?
Was it helpful?

Solution

An alternative for #2 could be LocalConnection, provided that you can run the Caspar CG executable and a controlling swf/Zinc application on the same computer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top