Introducing SPX-GC. A new control client for CasparCG and streaming applications

You can move the DATAROOT and LOG folders to any location, just make sure config.json is updated to point to those paths.

This is an great tool, thanks for sharing it!
I have some issues with templates created with Hype using this method: https://github.com/5opr4ni/casparcg_template_hype

When stopping an item, it seems like it is stuck on the last frame without properly stopping. The continue button is active and restarts the item. This behavior is not found on the included templates.
Any idea whats wrong? I’m not good with code, thats why I use the Hype workflow, so I don’t really know where to start looking.

Hey,

I have not created any templates with Hype (I should!), so cannot say straight away what the difference is.

Could you share a template with me so I could take a look at it? This issue will most likely come up with other people also.

Thanks!

-Tuomo

Thanks, I’ll email you some templates.

Thank you very much. It’s running well and i like it. Do you think about some way to preview before send to air action? I mean something like a preview window plus a take button or a direction key where you can send the graphics to a preview channel. In live use the preview is an absolute need. And i think this app may be used in live environments because is simple and fast. Thank you again.

hello,
I just can’t get it to work. Connection is OK, but i get these messages:

on CasparCG:

[2021-02-11 14:06:08.064] [6668]  [info]    flash-player[cg20.fth.pal|1024x576] Uninitialized.
[2021-02-11 14:06:08.097] [11220] [info]    Screen consumer [1|1080p2500] Successfully Initialized.
[2021-02-11 14:06:08.120] [9224]  [info]    output[1] Screen consumer [1|1080p2500] Added.
[2021-02-11 14:06:08.129] [10328] [info]    flash[cg20.fth.pal|2439] Uninitialized.
[2021-02-11 14:06:08.134] [10504] [info]    Screen consumer [1|1080p2500] Successfully Initialized.
[2021-02-11 14:06:08.166] [11220] [info]    oal[1|1080p2500] Sucessfully Initialized.
[2021-02-11 14:06:08.206] [9224]  [info]    output[1] oal[1|1080p2500] Added.
[2021-02-11 14:06:08.217] [11220] [info]    Initialized channels.
[2021-02-11 14:06:08.224] [11220] [info]    Initialized thumbnail generator.
[2021-02-11 14:06:08.228] [11220] [info]    WinSock2 Initialized.
[2021-02-11 14:06:08.231] [11220] [info]    Listener successfully initialized
[2021-02-11 14:06:08.234] [11220] [info]    Initialized controllers.
[2021-02-11 14:06:08.240] [11220] [info]    Initialized osc.
[2021-02-11 14:06:08.243] [11220] [info]    Started initial media information retrieval.
[2021-02-11 14:06:09.361] [1876]  [info]    Initial media information retrieval finished.
[2021-02-11 14:06:27.565] [6600]  [info]    Accepted connection from 127.0.0.1 2
[2021-02-11 14:07:27.966] [6600]  [info]    Received message from 127.0.0.1: CG 1-3 ADD 1 "http://192.168.254.120:5000/templates/smartpx/Template_Pack_1/SPX1_TICKER_MANUAL.html" 1 "<templateData><componentData id=\"f0\"><data id=\"text\" value=\"YOUR TURN\"/></componentData><componentData id=\"f1\"><data id=\"text\" value=\"Click blue + to add more items to this rundown.\"/></componentData></templateData>"\r\n
[2021-02-11 14:07:28.023] [4544]  [warning] Could not find template HTTP://192.168.254.120:5000/TEMPLATES/SMARTPX/TEMPLATE_PACK_1/SPX1_TICKER_MANUAL.HTML
[2021-02-11 14:07:28.051] [4544]  [debug]   Executed command: CGCommand
[2021-02-11 14:07:28.071] [4544]  [info]    Sent message to 127.0.0.1: 404 CG ERROR\r\n

on SPX-gc this massage:

** Config file (D:\SPX-GC\config.json) not found, generating defaults. **
** Writing default config values to [D:\SPX-GC\config.json] **

2021-02-11T13:06:27.559Z [SPX GC] info: START-UP INFORMATION:

SPX GC ................. Copyright 2020-2021 SmartPX <tuomo@smartpx.fi>
Version ................ 1.0.9
Homepage ............... https://github.com/TuomoKu/SPX-GC
Config file ............ D:\SPX-GC\config.json
Cfg / locale ........... english.json
Cfg / loglevel ......... info (options: error | warn | info | verbose | debug )
Cfg / dataroot ......... D:/SPX-GC/DATAROOT/
Cfg / template files ... D:/SPX-GC/ASSETS/templates/
Cfg / logfolder ........ D:/SPX-GC/LOG/
Cfg / templatesource ... spxgc-ip-address (http://192.168.254.120)
SPX-GC server address .. http://192.168.254.120:5000


──────────────────────────────────
     Open SPX-GC in a browser:
     http://192.168.254.120:5000
──────────────────────────────────


2021-02-11T13:07:27.962Z [SPX GC] info: CasparCG playoutController - command ADD, Template: http://192.168.254.120:5000/templates/smartpx/Template_Pack_1/SPX1_TICKER_MANUAL.html
2021-02-11T13:07:27.996Z [SPX GC] error: Error with OVERLAY: 404 CG ERROR
 - Verify CasparCG's (OVERLAY) access to templates on SPX-GC server at http://192.168.254.120.

connection (OVERLAY) is ok. It plays on gc preview window and in render window, but not on caspar?

Hey, see CCG log line 2021-02-11 14:07:28.023, it says Could not find template (+ url) and the same is being repeated in the SPX-GC log (the last line).

First things first, which CasparCG server are you using? 2.3.0 LTS is the one which imho has worked the best.

Can you verify with a web browser the URL for the template is actually reachable (and not in another network, Docker etc)

Thanks,
–T

1 Like

What happens, if you omit the :5000 from the template url?

5000 is the (default) port of SPX-GC server which serves templates over http in the /templates path, so skipping port will most likely just result in http error 404…

Have you tried it? Because to me it looks like port 5000 is for a user interface, as it sais: Cfg / templatesource ... spxgc-ip-address (http://192.168.254.120) What would mean the templates are on the standard port 80.

Is the web server case insensitive? Caspar seems to capitalize the URL as the warning line shows.

The server does both things in the same port (template source and UI).

There is one more thing to keep in mind. There is a config parameter “templatesource” where you can define casparcg-template-path as the value, then SPX-GC will use “relative” paths as specified in the CasparCG config. This would mean you need to have the templates in two places: within SPX-GC’s Assets/templates folder (for web use) AND in CasparCG:s own templates folder.

Expand to see a section from README

general.templatesource (Added in v 1.0.9) For CasparCG playout the templates can be loaded from the filesystem or via http-connection provided by SPX-GC. Supported values are:

spxgc-ip-address to automatically use SPX-GC’s IP address and http -protocol for playing out templates from SPX-GC’s template folder. This is the default behaviour.

casparcg-template-path to playout templates from target CasparCG server’s file system template-path. (See caspar.config file) Note, in this workflow the templates must be in two places: in SPX-GC ASSETS/templates -folder and CasparCG’s templates folder. And if a changes are done to either location, those changes should also be done to the other. rsync or other mirroring technique should be considered…
ip-address manually entered address can be used when the automatically generated IP address is not usable. For instance Docker containers or VM hosted instances may expose internal IP address
which can not be accessed from outside.
Please note templatesource only affects CasparCG playout and not web playout. Also file:// protocol is more restrictive in using external data sources and it can yield javascript errors, such as CORS.

To me the CasparCG log looks like it’s from an older version or the server and I can’t know if HTML templates works on that specific server at all… Have you tried loading HTML templates on that server with the standard client?

At least on Windows it is case insensitive, so “FILE” and “file” is the same thing.

On Linux it seem to be case sensitive. So there is a difference. I can look into that if that is something I could force it to behave the same across all OS’es. Not a bad idea :bulb: eventhough this is not something you often need to worry about…

Hey, this one is pretty cool! I`m new to CasparCG and this one is a big help for me to start.

One question for understandig: Is it possible to use this Client together with the regular Caspar CG Client? Like Caspar CG Client for Playout and SPX CG for Overlays? I tried this but there is no Output from SPX if playing a video in the client. Allthough I switched the Layer of the Videos to 1.

This is my error from server:

2021-02-11T21:36:33.404Z [SPX GC] error: Error with OVERLAY: 401 CG ERROR
 - Verify CasparCG's (OVERLAY) access to templates on SPX-GC server at http://192.168.178.67.

Best wishes,
Mike

Hey,
yes it is absolutely possible, I use it exactly for that very often.

The 401 error here means CasparCG got “Unauthorized error”, so something in the environment is preventing the connection from CasparCG to SPX-GC’s http server… Please see README section Configuration > Config parameters > templatesource. That might help in figuring it out.

It works with 2.3.0 LTS version. Thank you a lot :+1:
But now I have some isues with decklink output. It seams some problem with drivers. Am I right?
Here is code from caspercg at startup:

Type "q" to close application.
Logging [info] or higher severity to log/

[2021-02-14 15:28:17.952] [info]    ############################################################################
[2021-02-14 15:28:17.953] [info]    CasparCG Server is distributed by the Swedish Broadcasting Corporation (SVT)
[2021-02-14 15:28:17.953] [info]    under the GNU General Public License GPLv3 or higher.
[2021-02-14 15:28:17.953] [info]    Please see LICENSE.TXT for details.
[2021-02-14 15:28:17.953] [info]    http://www.casparcg.com/
[2021-02-14 15:28:17.953] [info]    ############################################################################
[2021-02-14 15:28:17.953] [info]    Starting CasparCG Video and Graphics Playout Server 2.3.0 a4a7c053 Dev
[2021-02-14 15:28:18.406] [info]    Initializing OpenGL Device.
[2021-02-14 15:28:18.413] [info]    Initialized OpenGL 4.5.0 NVIDIA 388.13 NVIDIA Corporation
[2021-02-14 15:28:18.416] [info]    Initialized ffmpeg module.
[2021-02-14 15:28:18.416] [info]    Initialized oal module.
[2021-02-14 15:28:18.416] [info]    Initialized decklink module.
[2021-02-14 15:28:18.416] [info]    Initialized screen module.
[2021-02-14 15:28:18.417] [info]    Initialized newtek module.
[0214/152818.450:ERROR:gpu_process_transport_factory.cc(990)] Lost UI shared context.
[2021-02-14 15:28:18.467] [info]    Initialized html module.
[2021-02-14 15:28:18.467] [info]    Flash support is disabled
[2021-02-14 15:28:18.468] [info]    Initialized flash module.
[2021-02-14 15:28:18.470] [info]    Initialized bluefish module.
[2021-02-14 15:28:18.470] [info]    Initialized image module.
[2021-02-14 15:28:18.471] [info]    "C:/Users\I7\Documents\casparCg 3.2.0. LTE\casparcg-server\casparcg.config":
[2021-02-14 15:28:18.471] [info]    -----------------------------------------
[2021-02-14 15:28:18.471] [info]    <?xml version="1.0" encoding="utf-8"?>
[2021-02-14 15:28:18.471] [info]    <configuration>
[2021-02-14 15:28:18.471] [info]       <paths>
[2021-02-14 15:28:18.471] [info]          <media-path>media/</media-path>
[2021-02-14 15:28:18.471] [info]          <log-path>log/</log-path>
[2021-02-14 15:28:18.471] [info]          <data-path>data/</data-path>
[2021-02-14 15:28:18.471] [info]          <template-path>template/</template-path>
[2021-02-14 15:28:18.471] [info]       </paths>
[2021-02-14 15:28:18.471] [info]       <lock-clear-phrase>secret</lock-clear-phrase>
[2021-02-14 15:28:18.471] [info]       <channels>
[2021-02-14 15:28:18.471] [info]          <channel>
[2021-02-14 15:28:18.471] [info]             <video-mode>1080i5000</video-mode>
[2021-02-14 15:28:18.471] [info]             <consumers>
[2021-02-14 15:28:18.471] [info]                <decklink>
[2021-02-14 15:28:18.471] [info]                   <device>1</device>
[2021-02-14 15:28:18.471] [info]                   <embedded-audio>true</embedded-audio>
[2021-02-14 15:28:18.471] [info]                </decklink>
[2021-02-14 15:28:18.471] [info]             </consumers>
[2021-02-14 15:28:18.471] [info]          </channel>
[2021-02-14 15:28:18.471] [info]       </channels>
[2021-02-14 15:28:18.471] [info]       <controllers>
[2021-02-14 15:28:18.471] [info]          <tcp>
[2021-02-14 15:28:18.471] [info]             <port>5250</port>
[2021-02-14 15:28:18.471] [info]             <protocol>AMCP</protocol>
[2021-02-14 15:28:18.471] [info]          </tcp>
[2021-02-14 15:28:18.471] [info]       </controllers>
[2021-02-14 15:28:18.471] [info]       <amcp>
[2021-02-14 15:28:18.471] [info]          <media-server>
[2021-02-14 15:28:18.471] [info]             <host>localhost</host>
[2021-02-14 15:28:18.471] [info]             <port>8000</port>
[2021-02-14 15:28:18.471] [info]          </media-server>
[2021-02-14 15:28:18.471] [info]       </amcp>
[2021-02-14 15:28:18.471] [info]    </configuration>
[2021-02-14 15:28:18.471] [info]    -----------------------------------------
[2021-02-14 15:28:18.481] [info]    Initialized OpenGL Accelerated GPU Image Mixer for channel 1
[2021-02-14 15:28:18.481] [info]    video_channel[1|1080i5000] Successfully Initialized.
[2021-02-14 15:28:18.512] [info]    [decklink_consumer] Uninitialized.
[2021-02-14 15:28:18.512] [error]   Exception: c:\program files (x86)\jenkins\workspace\casparcg-server-dep\v2.3.x-lts\src\modules\decklink\util\../decklink_api.h(93): Throw in function class ATL::CComQIPtr<struct IDeckLinkConfiguration,&struct __s_GUID const _GUID_1e69fcf6_4203_4936_8076_2a9f4cfd50cb> __cdecl caspar::decklink::iface_cast<struct IDeckLinkConfiguration,struct IDeckLink>(const class ATL::CComPtr<struct IDeckLink> &,bool)
[2021-02-14 15:28:18.512] [error]   Dynamic exception type: class boost::exception_detail::clone_impl<struct caspar::not_supported>
[2021-02-14 15:28:18.512] [error]   [struct caspar::tag_msg_info * __ptr64] = Could not cast from struct IDeckLink to struct IDeckLinkConfiguration. This is probably due to old Decklink drivers.
[2021-02-14 15:28:18.512] [error]   [struct caspar::tag_stacktrace_info * __ptr64] =  0# 0x00007FF6C6C59DEE in casparcg
[2021-02-14 15:28:18.512] [error]    1# 0x00007FF6C6C89150 in casparcg
[2021-02-14 15:28:18.512] [error]    2# 0x00007FF6C6E8A594 in casparcg
[2021-02-14 15:28:18.512] [error]    3# 0x00007FF6C6E8BD89 in casparcg
[2021-02-14 15:28:18.512] [error]    4# 0x00007FF6C6E8E8D1 in casparcg
[2021-02-14 15:28:18.512] [error]    5# 0x00007FF6C6CA0288 in casparcg
[2021-02-14 15:28:18.512] [error]    6# 0x00007FF6C6D3E93E in casparcg
[2021-02-14 15:28:18.512] [error]    7# 0x00007FF6C6D3B9E0 in casparcg
[2021-02-14 15:28:18.512] [error]    8# 0x00007FF6C6C54B29 in casparcg
[2021-02-14 15:28:18.512] [error]    9# beginthreadex in ucrtbase
[2021-02-14 15:28:18.512] [error]   10# BaseThreadInitThunk in KERNEL32
[2021-02-14 15:28:18.512] [error]   11# RtlUserThreadStart in ntdll
[2021-02-14 15:28:18.512] [error]
[2021-02-14 15:28:18.512] [error]
[2021-02-14 15:28:18.512] [error]    0# 0x00007FF6C6C59DEE in casparcg
[2021-02-14 15:28:18.512] [error]    1# 0x00007FF6C6C5971F in casparcg
[2021-02-14 15:28:18.512] [error]    2# 0x00007FF6C7128AE7 in casparcg
[2021-02-14 15:28:18.512] [error]    3# 0x00007FFCB1E01030 in VCRUNTIME140
[2021-02-14 15:28:18.512] [error]    4# is_exception_typeof in VCRUNTIME140
[2021-02-14 15:28:18.512] [error]    5# RtlCaptureContext in ntdll
[2021-02-14 15:28:18.512] [error]    6# 0x00007FF6C6C86EAF in casparcg
[2021-02-14 15:28:18.512] [error]    7# 0x00007FF6C6C89212 in casparcg
[2021-02-14 15:28:18.512] [error]    8# 0x00007FF6C6C5D2CD in casparcg
[2021-02-14 15:28:18.512] [error]    9# 0x00007FF6C6C60BAB in casparcg
[2021-02-14 15:28:18.512] [error]   10# 0x00007FF6C7073CC8 in casparcg
[2021-02-14 15:28:18.512] [error]   11# BaseThreadInitThunk in KERNEL32
[2021-02-14 15:28:18.512] [error]   12# RtlUserThreadStart in ntdll
[2021-02-14 15:28:18.512] [error]
[2021-02-14 15:28:18.585] [info]    Initialized channels.
[2021-02-14 15:28:18.586] [info]    Initialized controllers.
[2021-02-14 15:28:18.586] [info]    Initialized osc.

That’s what the log says, so probably yes. Sorry, don’t know the inner workings of CasparCG so I am not much help here…

Have you tried to “Run as Administaror” of CasparCG server? Sometimes that helps.

Hello,

great project ad work!

I have a question regarding special function as you have set up function stopAll in demoFunctions.js

How to set up a function, which will play all CG in rundown?

Thank you very much for answer!

Sincerely,

Petr H.

Hey, just replied in Github discussions but here is a copy of it here also:

Hey, that’s pretty easy :wink:

There is a built in function playItem(DomElement, ‘play’) which will just play an item on the rundown.

So you can copy the stopAll() function as playAll() and replace
continueUpdateStop('stop', templateItem);
with
playItem(templateItem,'play')

and it will play an item instead of stopping it. Then you will need to add that button to your project or globally in app config. I take it you know how to do that already?

As you can imagine this can get quite humorous on most rundowns, but hey, if you need one you need one :+1:

Hope this helps

–Tuomo