Video address from txt in CasparCG Client

Hello! Is there a way in CasparCG Client to play a video taking the location from a txt? The idea is to have an updateable txt with the different weather animated icons, and that in CasparCG Client you can somehow take that txt and reproduce what is indicated in it. I know very well that I could make my own client, that I even have several of my own clients created, but in this case CasparCG Client is ideal for our work and I would not want to change it. Thanks!

You can do that, but only with a trick: You build a template, that is fully transparent and that reads the text file and plays the video by sending AMCP comands to Caspar. This can very easy be done in Flash. In HTML it is not that easy, as you need a proxy program that sends the commands to Caspar as JavaScript can only connect to http. But there are a few of these. In you rundown you then play the template.

So it could be easier, because the idea is just when I launch a flash template with the weather data, it plays the corresponding icon (video). Could you give me some tips on how to do it? I honestly don’t know how from Action Script.

It is not that easy to explain, as I don’t know, how it should lock etc. Maybe it is easier to play the icon inside the template as a MovieClip in Flash or as WebM clips in HTML. Do you have a budget?

Well, the point is that they are animated icons. I’ve had several experiences importing png sequences into Flash as movie clips and performance suffered tremendously. I’m also talking about more than 20 different ones. What idea could you give me?

…how big are they? Only counting the size of the icon, not the full screen.

I’ve been doing weather maps in CCG with HTML templates and animated webp icons for many years.

Example: Veðurfréttir - Sjónvarp - Vísir (the template that runs this hasn’t been modified since 2014!)

1 Like

…I would also do it that way. I try not to do Flash templates too much these days :slight_smile:

I found an unconventional solution. In the channel we have an HTTP server that we use for various purposes, including some clients for CasparCG and VMix in php. In the case of CasparCG using a CosmonovaRnD library. I am going to create a PHP file that is responsible for reading the TXT and sending the command to the CasparCG server. In CasparCG Client I enter an HTTP POST Request to tell PHP to do its job. I’m going to do that now and post results. I need such a solution, because depending on the temperature I also want the videos to change. It is complex, but the result would be excellent.

That is also a way to do it.

The problem is the habit and the time to learn. I’ve been doing solutions in Flash for 7 years and over the years we’ve gained experience. Honestly I NEVER did anything in HTML, maybe it’s easier, but time is also complicated.

1 Like

Obviously I never did anything for CasparCG in HTML I meant.

That is my problem also. I started with HTML about a year ago and found, that I can reuse a lot of my ActionScript skills also for JavaScript. So the learning curve is not that steep, as one may think. But sure, for a quick solution I would also do it with the tooling I already know.

Well, after many hours I was able to achieve the goal. However not complete. I use 6 layers of Caspar for this, I used from 1 to 6, in them I have the background, in 2 the weather icon (video), in 3 all the texts in a Flash template, in 4 the icons (video) of temperature, winds, etc… in layer 5 a routing of layer 2, to show the weather icon (video) in small size and in layer 6 some light effects for the flash template. There are 2 stages, current weather and forecast. In the first stage the color of the background is shown according to the temperature, this goes from 8 degrees down, between 8 and 15, between 15 and 23, between 23 and 30, and greater than 30. In the second stage it is same, only that the background changes about 10 seconds after it enters the air, because in the forecast we have minimum and maximum temperature. All the transitions except for the texts are generated on the fly by Caspar according to my commands. From the Caspar client, I send a GET command to the page where all the commands are hosted, thanks to Cosmonovand’s PHP library. Within the PHP I have 3 possibilities, current weather, forecast, and stop. Due to the complexity, as you will see in the video, the moment the background changes in the forecast the video freezes. Unfortunately that feature will have to be disabled. Our server is an i5, 4GB Ram and a Radeon R7 card. We reproduce fill and key in 1080p25 for this reason, when doing too complex work the server does not help.

CasparCG - Estado del tiempo