I am newbie in CAsparCG .
I try to play a map html page in casparcg. My command:
play 1-61 [HTML] "file:///C:/img/map.html"
Caspar cg gives error:
Failed to initialize WebGL.
[2024-11-02 16:54:30.596] [info] Received message from Console: play 1-61 [HTML] "file:///C:/img/map.html"\r\n
#202 PLAY OK
What version of CasparCG do you use? It does not help to install Chrome to check, if WebGL is supported, you need to know, if it’s supported inside Caspars embedded Chromium browser.
Here are two websites that perform some tests on the WebGL capability of any browser - https://get.webgl.org and https://webglreport.com. The latter test reports version 1 properties by default. To show V2 properties in CasparCG add /?v=2 to the end of the command line.
I can see you have enabled the gpu, which I think is a requirement for WebGL in Caspar. I tested CasparCG server 2.4.0, which reported WebGL was disabled or unavailable. When I enabled GPU and re-tested the WebGL reported working and supported.
I tried this command and gives play ok but didnt show
play 1 [HTML] "file:///C:/img/map.html/?v=2"
[2024-11-02 21:50:45.349] [info] Received message from Console: play 1 [HTML] "file:///C:/img/map.html/?v=2"\r\n
#202 PLAY OK
The ?v=1 and ?v=2 ONLY apply to test website webglreport.com. So the two forms of command to that test site are: https://webglreport.com/?=1 https://webglreport.com/?=2
I had problems loading local textures in webgl templates.
Did you try playing a web version of that map?
You can run a local webserver: node.js, nginx.
In a conventional browser you can access the debug tools, including console log error reports, using a right click. The same inspection tools can be accessed for an html page or template running in CasparCG server, although the mechanism is slightly different.
Modify the casparcg.config <html> segment to reference an IP port number that is used for the debug tools. For example:
The port number may be any free port number on your CasparCG host computer. Restart the server after the configuration change.
Start an instance of Chrome Browser on the CasparCG server host. Enter page address chrome://inspect/#devices
On the displayed page, tick Discover network targets, and click the Configure button. Add the localhost address with the port number defined in the <html> tag - 127.0.0.1:8101 and click the Done button. The value is saved for future visits.
After a few seconds there should be a list of html pages and html templates running in CasparCG server. Click on the inspect text in the entry with your page. A new window opens that has a minature version of the http page at the left, and the standard browser inspection tools in the rest of the window. You can now view any console messages, inspect variables, set breakpoints and trace javascript code processes.