Getting data from XML database and updating textfields live (dynamic text)

Hey guys, new here.

Have been looking at pushing data from a database to a .ft textfield and updating it live.

Is this at all possible do get live data through to caspercg and what frequency does casperccg support. Has anyone pushed the limits here?

Have seen some pointers to XML but not pushing out data live from lets say a client.

It is possible for sure. There are several ways of doing it. You can do a Flash template, that uses, for instance, a timer to pool the datasource. You could do a similar approach in HTML and JavaScript. Or you could write a custom client that updates the template from time to time.

Doing it directly in Flash/ActionScript or HTML/JavaScript is good, when you don‘t have a user interface for an operator. The second way, using a custom client is good, if you want the operator to see the data. I use this for clocks in sports, were the time is also shown in the UI.

What is your use case?

1 Like

Thx for the reply,

looking into e-sports. I also think the client way to do it would give me more options to what i want to do with the data. I can push it several places.

Any ideas on updaterate in caspar? Could i push data every 10 ms or 1 ms? Would this create a bottleneck?

I have only tried it with 1 second updates. Keep in mind, that the frame rate in Europe 25/50 corresponds to 40ms. Humans are able to see about 10 frames per second as different frames, so everything bellow 100ms is a waste of resources anyway.

1 Like

Indeed! was actually thinking about this yesterday, you dont need to push data to fast through.

Testet the AMCP Clear command at 100ms intervals. Seems to run, are there any heartbeat solutions yet?

There is a VERSION command, that you can use for that. It gives back the servers version and as soon as the connection is lost, you get nothing back. I do live shows, that run many hours, without any heat beat, and never had any failure, as the server is very stable.

1 Like

Also the same here using the Update command once per second with no issues to a html template

Yeah, i tried down to .1 sec and it worked fine. Without limitations in my .py script i got a overflow error. Reading in the sourcecode for the AMCP it says that exceeding 128 commands in the AMCP que and the overflow error is raised. In FPS games the amount of data is pretty big, have some concerns about raising the overflow error.
I guess the CG UPDATE command must be sent for every dynamic text in the Template? Dont know if there are any workarounds here

Well you can send all the textfield updates in one command (im sending about 60 - 80 data points per command) you could also look at nodeCG which I believe was built for use with OBS from E-sport point of view?

1 Like

Ohh, all in one long string then? Will check out nodeCG🙂

You should use websockets in the template itself for receiving the data.

Yes so you send xml or json updates with each fieldname and value in one go

Could You explain how it is possible to communicate via websocket in the JavaScript please?

Tonnes of tutorials on websockets on the internet.

Aaah. I misunderstood…:frowning:
I though, that adibub needed to communicate between his (probably .NET) application as client and CasparCG server.

There are always more than one way ro the destination. Queriing via websocket from inside a HTML template is one. Another can be to send an XML tree of data, via commands like CG LOAD, CG PLAY or CG UPDATE to a template. As I said elsewhere, it depends on the use case, what is the best way to go.

The same goes for FLASH templates aswell using actionscript i guess?

Yes, there is a Socket object in ActionScript also. But, AFAIK, it‘s problematic to connect to websites, that are on other servers. I use it manly to control stuff on other Caspar layers, like playing background videos etc.

1 Like

I’ve managed to make it this far - however I feel as if I’m getting a little out of depth (after reading a little of the NodeCG stuff)

Would you recommend someone who’s not got much experience at coding/HTML/Javascript to try and use NodeCG or websockets to get XML data into a template?

Thanks!