Automate Viewer Stop and Start

dwskau's picture

I am in charge of an installation that runs Quartz Composer 24 hours a day and gets video input from AXIS cameras. Every so often the network connection fails causing the images to freeze on the last frame. The best way I have found to fix this is to stop and start the viewer again. Rather than doing this manually, is there a good way to automate this to happen every night at say, 3:00 AM? I know I can schedule things with launchd, but what method would be the best to actually do the starting and stopping? An applescript to click the menu item? Is there a better way?

gtoledo3's picture
Re: Automate Viewer Stop and Start

I'm not sure what is technically the best way, but it might be easiest and just as good as anything else to run an Automator action. It's probably shamefully easy!

I would be curious, if all renderers had a conditional attached that was "false" if it's 3AM (and maybe with some tolerance, so it lasts a few seconds), and then the renderers start up again, if it would suffice. It might and may be the easiest fix of all.

You would probably have to keep system time evaluating by attaching it to a 3D transform or something, while all of your other Billboards (or whatever the case may be) shut down, and then start back up. I would attempt to solve it via the composition first.

(I understand that the nature of the hose up may require an actual reinitialization of the composition, and the shut renderers down thing may not work).

dust's picture
Re: Automate Viewer Stop and Start

you could use my apple script plugin in the repo here on kineme. not sure if qc has apple script dictionary but you could just send keyboard command apple period to stop etc..

dwskau's picture
Re: Automate Viewer Stop and Start

I didn't even think of resetting it in the composition, thanks for the tip! Hopefully it works to reset things and the network connection is actually what is causing the problem...

dust's picture
Re: Automate Viewer Stop and Start

i use PreFab UI Actions in concatenation with my apple script plugin to automate system things or get info or click in other applications from inside qc for example.

http://pfiddlesoft.com/uiactions/

its really a time saver the ui actions and browser. it generates apple scripts for you by sort of graphically. like if you actually want to push stop and start on the viewer these apps will help you find the window id by name or index. then you can then just say click at xy. i do cool things like add inertia to my system windows and stuff. the viewer window is kind of hard to find without a program like this as viewer window isn't derived from quartz composer its a qc player app inside the qc bundle. i mean you can do widow focusing and window indexing but once you find the actual name of the a ui element it makes it much easier to deal with.

m.oostrick and i where talking about this as he has a led wall in a subway that had the same sort of problem. he had to actually restart the computer once a day. i will ask him, if i remember correctly it was a hardware solution not software but he most likely had to make an automater or apple script to launch the qc file once the computer re-booted.

franz's picture
Re: Automate Viewer Stop and Start

running a comp from QC editor is a bad idea, generally (there are exceptions... I'm running my Euphoria show from the editor, for instance, but just because I'm sooo lazy)

Can't you make an app, and start/stop the comp using a timer ? Check if time >= 3AM, then start/stop the QCview, or QCrenderer.

It would be wayyyyyyy easier. Check the apple docs, but it is nothing impossible to do. Btw, Xcode by default propose a QCapp template that has start/stop bindings (to a QCview) already set up. A good place to start from, IMHO.

Sorry if I seem too obvious.

Good luck

(if you come up with an elegant solution, I would love to have you share it...)

EDIT: another option would be to calculate time from within QC (using System Time patch), modulus 24hours + your restart-time, and have an on/off switch to your network macro. This should restart the concerned patch.

photonal's picture
Re: Automate Viewer Stop and Start

franz wrote:
running a comp from QC editor is a bad idea, generally (there are exceptions...

Just wondering why that is the case? Are they're additional overheads from running a comp in QC rather than a standalone app?

jd's picture
Re: Automate Viewer Stop and Start

I would be way interested in a elegant solution for this too. I have found no easy-peasy way to start the imagewriter back to frame one besides stopping/restarting the comp. It keeps counting upwards forever....

thanks jd