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

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!

There is NodeJS and NodeCG. AFAIK with NodeCG you do not build templates in the sense we use it in Caspar, they kind of build a website that is displayed as a whole inside a layer in Caspar. NodeJS is a JavaScript library.

This may not be the best solution if you don’t have that much experience with NodeJS but, I wrote a post on how to setup a basic HTTP server with Websocket support here. Here is a shameless plug for an HTML template guide as well. It will get you up and running with custom / dynamic HTML templates.

Hi, I use the xml way with flash templates and actionscript.
I’m working in motorport and the time keeper share a xml file with all the data.
No problem with refresh rate over 10Hz but no need to go faster.
Unfortunally sometimes I experience some template crash, related to the xml load somehow.
I guess the problem occur when the template read the file when is being written, or something similar.

Are HTML templates better than Flash templates - or it’s just personal preference?

I want to try and make a template for a client who has scoring software which outputs data as XML, and while I’ve managed to create the template in Flash - I didn’t know if it’s better to make in HTML?

Once I know what templates I should making, then I can learn how to get the data into them!!

You should do them in HTML. Flash is EOL.

Balls. Well it was fun learning the Flash method…

Time to get my head round HTML… I’ve got a little bit of experience over the years so hopefully that can be applied!!