Straight Alpha CasparCG version 2.2 Stable and later

Hi,

I know that CasparCG works fine with alpha premultiplied, but I have a lot of templates created in alpha straight that are displayed 24/7 (made by a previous person). I have a question, is there any possibility to force the server version to use straight alpha, because these commands do not work (in total, they have no right).

<mixer>
    <blend-modes>true</blend-modes>
    <straight-alpha>true</straight-alpha>
    <chroma-key>true</chroma-key>
  </mixer>
<channels>
    <channel>
      <video-mode>1080i5000</video-mode>
      <straight-alpha-output>true</straight-alpha-output>

Servers operate on two types of machines Dell Precision 7910 and Dell Precision 7920, configuration is below.

Dell Precision 7910

Graphic Card Quadro K2200, Decklink 4K Extreme 6G.

Dell Precision 7920

Graphic Card Quadro 4000, Decklink 4K Extreme 12G.

Displayed alpha on the output looks like this.

and should looks like this.

additional config file

<configuration>
  <paths>
    <media-path>_media/</media-path>
    <log-path>log/</log-path>
    <data-path>data/</data-path>
    <template-path>C:/Templates/</template-path>
    <font-path>font/</font-path>
  </paths>
  <log-level>trace</log-level>
  <flash>
    <buffer-depth>auto</buffer-depth>
</flash>
  <lock-clear-phrase>secret</lock-clear-phrase>
  <channels>
    <channel>
        <video-mode>1080i5000</video-mode>		
        <consumers>
            <decklink>
                <device>1</device>
                <embedded-audio>false</embedded-audio>
                <latency>low</latency>
		<keyer>external</keyer>
		<buffer-depth>3</buffer-depth>
		<custom-allocator>true</custom-allocator>
            </decklink>
	</consumers>
    </channel>
  </channels>
  <controllers>
    <tcp>
      <port>5250</port>
      <protocol>AMCP</protocol>
    </tcp>
  </controllers>
  <amcp>
    <media-server>
      <host>localhost</host>
      <port>8000</port>
    </media-server>
  </amcp>
</configuration>

Interestingly, I also have 1 Dell Precision 7920 server and 1 Dell Precision 7920 server, with 2x Decklink 4K Extreme 12G cards, the servers work as a playout and have the same configuration as the other and the config file as above. Straight alpha on these servers is correctly displayed on the server version 2.2 Stable.

Changes to the graphics card settings give nothing, whether it is GPU or CPU etc.

Maybe someone had a similar problem, or maybe I am doing something wrong, or something needs to be set up (Windows, Graphic Card, Server config), because I would like to switch to 2.2 Stable on production, because on the previous ones after a long operation I get “out of memory”.

Thank you in advance for any tips.

1 Like

How can you do that? At least Flash is always premuliplied, no matter what you do.

Have you checked the settings on the vision mixers keyer? I would guess, that they are wrong.

That has noting to do with they way the keying works.

What kind of vision mixer? ATEM?

Thanks for replies.

Blockquote
@didikunz:
How can you do that? At least Flash is always premuliplied, no matter what you do.

FLV files were rendered in straight alpha, but this should not affect, I think or generally template is premuliplied, but FLV is interpteted as straight, the same effect is with PNG image, dynamically loaded.

Blockquote
@didikunz @TheYouth
Have you checked the settings on the vision mixers keyer? I would guess, that they are wrong.

CasparCG is keyed on Miranda DSK-3901. Is used for logos and animations. SImple fill/key.

Compared to version 2.1 Beta 2, after setting “straight-alpha” to false, I get the same effect on version 2.2, when set to true, everything is OK, from what I saw in the Caspar code, the alpha should be set correct. I have tried everything and it does nothing, but the puzzle is that it works on some devices and not on others at the same configurations.

Just an idea, are the Dynamic Range settings for Nvidia different between systems?

Hmm, maybe, but settings Nvidia are the same on all machines, but I not changed this option. I check it tomorrow. Thanks:grinning:

As far as I am aware, CasparCG requires all sources to be premultiplied. (PNGs are converted while being loaded, to make them usable)
Dynamically base64 loaded pngs may be broken in beta2, I cant remember if that was fixed there or if that only got fixed in later versions (both 2.2 and 2.1NRK).

I do not know the reason, but the straight-alpha setting was removed in 2.2. So it will not be possible to output straight-alpha from that version. Also worth noting is that setting only changed the output signal. Sources are still required to be premultiplied, but simply the output is straightened out before being sent to decklink or screen or whatever.

Also I just remembered that a sure fire way to do straight alpha (atleast with ffmpeg sources) is to run CCG 2.1 in CPU mode with:
<accelerator>cpu</accelerator>

That saved me in a few situations a couple of years ago.

Blockquote
@hreinnbeck
Just an idea, are the Dynamic Range settings for Nvidia different between systems?

I have changed, but the effect is the same. It’s time to convert these templates to HTML.

Thank you all for trying to help.

@Julusian @hreinnbeck

Hi,

[Dell Precision 7910]
I decided to test the NRK 2.1.11 version yet, everything is ok with the alpha channel, but I have another problem, after 5 commands server crash, the “Application has stopped working” window appears, there is nothing in the logs (except CG ADD and then "Ready … next command "). However, in the Windows log, there is an error message regarding “Flash.ocx”, installed version 31.x.x.x (fp_11.8.800.94_archive.zip). This happens after a series of calls of 2x6 second materials with a Clear 1 call, followed by a regular template(CG ADD-> CG PLAY). The server has Windows updates installed, without “Secure Adobe Flash Player” and Visual C ++ Reddistributed 2015-2019, Decklink Desktop Video 11.2.

[Dell Precision 7920]
I also tested the server on a second machine where Decklink Desktop Video 10.6 drivers are installed and everything works.

Maybe someone had a similar problem or I’m doing something wrong? :sweat_smile:

That is why I have a question which NRK version is stable, i.e. it works for a long time and can be used in production [Dell Precision 7910]. :no_mouth:

Thanks for the help

Regards

I’ve found out that using the correct firmware (Desktop Video version) matters. Maybe it’s not even a case of straight alpha vs premultiplied alpha - as @didikunz said, all flash templates are premultiplied. But what I found out with CasparCG server 2.0.7 (using Grass Valley mixers) was that you’d have to use Desktop Video version below 10. Using any firmware above that resulted in incorrect key signal. And not only that - analog passthrough audio also stopped working with 3D Extreme card.

Maybe the developers can comment on this and maybe even make a list of recommended Desktop Video installations with each version of CasparCG, since used SDKs also change with different versions of CasparCG. Please do let me know if I’m completely wrong with this and using the latest firmware is always the answer :slight_smile:

CasparCG NRK v2.1.11

Log Files

[2020-02-27 10:40:32.563] [6276] [trace]   Ready for a new command
[2020-02-27 10:40:37.482] [2880] [info]    Received message from 172.29.11.19: CG 1-1 ADD 0 ClearAll 0 <templateData></templateData>\r\n
[2020-02-27 10:40:37.482] [6276] [debug]   Executing command: CG ADD
[2020-02-27 10:40:37.483] [6276] [error]    Turn on log level debug for stacktrace.
[2020-02-27 10:40:37.483] [6276] [info]    Sent message to 172.29.11.19:404 CG ADD FAILED\r\n
[2020-02-27 10:40:37.483] [6276] [trace]   Ready for a new command
[2020-02-27 10:40:38.482] [2880] [info]    Received message from 172.29.11.19: CG 1-1 ADD 0 ClearAll 0 <templateData></templateData>\r\n
[2020-02-27 10:40:38.482] [6276] [debug]   Executing command: CG ADD
[2020-02-27 10:40:38.483] [6276] [error]    Turn on log level debug for stacktrace.
[2020-02-27 10:40:38.483] [6276] [info]    Sent message to 172.29.11.19:404 CG ADD FAILED\r\n
[2020-02-27 10:40:38.483] [6276] [trace]   Ready for a new command
[2020-02-27 10:40:38.562] [2880] [info]    Received message from 172.29.11.19: CG 1-1 PLAY 0\r\n
[2020-02-27 10:40:38.562] [6276] [debug]   Executing command: CG PLAY
[2020-02-27 10:40:38.562] [8960] [info]    Sent message to 172.29.11.19:202 CG OK\r\n
[2020-02-27 10:40:38.562] [8960] [debug]   Executed command (0s): CG PLAY
[2020-02-27 10:40:38.562] [6276] [trace]   Ready for a new command
[2020-02-27 10:40:38.984] [7740] [info]    Received message from Console: diag\r\n
[2020-02-27 10:40:39.120] [4784] [debug]   Executing command: DIAG
[2020-02-27 10:40:39.121] [8960] [debug]   Executed command (0.002s): DIAG
[2020-02-27 10:40:39.121] [4784] [trace]   Ready for a new command
[2020-02-27 10:40:43.482] [2880] [info]    Received message from 172.29.11.19: CG 1-1 ADD 0 ClearAll 0 <templateData></templateData>\r\n
[2020-02-27 10:40:43.482] [6276] [debug]   Executing command: CG ADD
[2020-02-27 10:40:43.483] [6276] [error]    Turn on log level debug for stacktrace.
[2020-02-27 10:40:43.483] [6276] [info]    Sent message to 172.29.11.19:404 CG ADD FAILED\r\n
[2020-02-27 10:40:43.483] [6276] [trace]   Ready for a new command
[2020-02-27 10:40:44.481] [2880] [info]    Received message from 172.29.11.19: CG 1-1 ADD 0 ClearAll 0 <templateData></templateData>\r\n
[2020-02-27 10:40:44.919] [6276] [debug]   Executing command: CG ADD
[2020-02-27 10:40:44.920] [6276] [error]    Turn on log level debug for stacktrace.
[2020-02-27 10:40:44.920] [6276] [info]    Sent message to 172.29.11.19:404 CG ADD FAILED\r\n
[2020-02-27 10:40:44.920] [6276] [trace]   Ready for a new command
[2020-02-27 10:40:44.962] [2880] [info]    Received message from 172.29.11.19: CG 1-1 PLAY 0\r\n
[2020-02-27 10:40:44.962] [6276] [debug]   Executing command: CG PLAY
[2020-02-27 10:40:44.962] [8960] [info]    Sent message to 172.29.11.19:202 CG OK\r\n
[2020-02-27 10:40:44.962] [8960] [debug]   Executed command (0s): CG PLAY
[2020-02-27 10:40:44.962] [6276] [trace]   Ready for a new command
[2020-02-27 10:40:49.480] [2880] [info]    Received message from 172.29.11.19: CG 1-9 ADD 0 logo 0 "<templateData><componentData id=\"f0\"><data id=\"text\" value=\"P_12\"/></componentData></templateData>"\r\n
[2020-02-27 10:40:49.481] [6276] [debug]   Executing command: CG ADD
[2020-02-27 10:40:49.482] [6276] [error]    Turn on log level debug for stacktrace.
[2020-02-27 10:40:49.482] [6276] [info]    Sent message to 172.29.11.19:404 CG ADD FAILED\r\n
[2020-02-27 10:40:49.482] [6276] [trace]   Ready for a new command
[2020-02-27 10:40:50.480] [2880] [info]    Received message from 172.29.11.19: CG 1-9 ADD 0 logo 0 "<templateData><componentData id=\"f0\"><data id=\"text\" value=\"P_12\"/></componentData></templateData>"\r\n
[2020-02-27 10:40:50.481] [6276] [debug]   Executing command: CG ADD
[2020-02-27 10:40:50.482] [6276] [error]    Turn on log level debug for stacktrace.
[2020-02-27 10:40:50.482] [6276] [info]    Sent message to 172.29.11.19:404 CG ADD FAILED\r\n
[2020-02-27 10:40:50.482] [6276] [trace]   Ready for a new command
[2020-02-27 10:40:50.561] [2880] [info]    Received message from 172.29.11.19: CG 1-9 PLAY 0\r\n
[2020-02-27 10:40:50.561] [6276] [debug]   Executing command: CG PLAY
[2020-02-27 10:40:50.562] [8960] [info]    Sent message to 172.29.11.19:202 CG OK\r\n
[2020-02-27 10:40:50.562] [8960] [debug]   Executed command (0s): CG PLAY
[2020-02-27 10:40:50.562] [6276] [trace]   Ready for a new command
[2020-02-27 10:40:50.601] [2880] [info]    Received message from 172.29.11.19: CG 1-5 ADD 0 cn1 0 "<templateData><componentData id=\"f0\"><data id=\"text\" value=\"4034982\"/></componentData><componentData id=\"f1\"><data id=\"text\" value=\"\"/></componentData></templateData>"\r\n
[2020-02-27 10:40:50.601] [6276] [debug]   Executing command: CG ADD
[2020-02-27 10:40:50.602] [6276] [error]    Turn on log level debug for stacktrace.
[2020-02-27 10:40:50.603] [6276] [info]    Sent message to 172.29.11.19:404 CG ADD FAILED\r\n
[2020-02-27 10:40:50.603] [6276] [trace]   Ready for a new command
[2020-02-27 10:41:20.478] [2880] [info]    Received message from 172.29.11.19: CG 1-5 ADD 0 cn1 0 "<templateData><componentData id=\"f0\"><data id=\"text\" value=\"4034982\"/></componentData><componentData id=\"f1\"><data id=\"text\" value=\"\"/></componentData></templateData>"\r\n
[2020-02-27 10:41:20.478] [6276] [debug]   Executing command: CG ADD
[2020-02-27 10:41:20.479] [6276] [error]    Turn on log level debug for stacktrace.
[2020-02-27 10:41:20.479] [6276] [info]    Sent message to 172.29.11.19:404 CG ADD FAILED\r\n
[2020-02-27 10:41:20.479] [6276] [trace]   Ready for a new command
[2020-02-27 10:41:20.558] [2880] [info]    Received message from 172.29.11.19: CG 1-5 PLAY 0\r\n
[2020-02-27 10:41:20.558] [6276] [debug]   Executing command: CG PLAY
[2020-02-27 10:41:20.559] [8960] [info]    Sent message to 172.29.11.19:202 CG OK\r\n
[2020-02-27 10:41:20.559] [8960] [debug]   Executed command (0.001s): CG PLAY
[2020-02-27 10:41:20.559] [6276] [trace]   Ready for a new command
[2020-02-27 10:41:47.476] [2880] [info]    Received message from 172.29.11.19: CG 1-9 STOP 0\r\n
[2020-02-27 10:41:47.476] [6276] [debug]   Executing command: CG STOP
[2020-02-27 10:41:47.477] [6276] [info]    Sent message to 172.29.11.19:403 CG STOP FAILED\r\n
[2020-02-27 10:41:47.477] [6276] [trace]   Ready for a new command
[2020-02-27 10:41:49.475] [2880] [info]    Received message from 172.29.11.19: CG 1-1 ADD 0 ClearAll 0 <templateData></templateData>\r\n
[2020-02-27 10:41:49.476] [6276] [debug]   Executing command: CG ADD
[2020-02-27 10:41:49.477] [6276] [error]    Turn on log level debug for stacktrace.
[2020-02-27 10:41:49.477] [6276] [info]    Sent message to 172.29.11.19:404 CG ADD FAILED\r\n
[2020-02-27 10:41:49.477] [6276] [trace]   Ready for a new command

Configuration:

<?xml version="1.0" encoding="utf-8"?>
[2020-02-27 10:38:13.354] [7276] [info]    <configuration>
[2020-02-27 10:38:13.354] [7276] [info]       <paths>
[2020-02-27 10:38:13.354] [7276] [info]          <media-path>_media/</media-path>
[2020-02-27 10:38:13.354] [7276] [info]          <log-path>log/</log-path>
[2020-02-27 10:38:13.354] [7276] [info]          <data-path>data/</data-path>
[2020-02-27 10:38:13.354] [7276] [info]          <template-path>C:/CG/CP4/Templates/</template-path>
[2020-02-27 10:38:13.354] [7276] [info]          <font-path>font/</font-path>
[2020-02-27 10:38:13.354] [7276] [info]       </paths>
[2020-02-27 10:38:13.354] [7276] [info]       <log-level>trace</log-level>
[2020-02-27 10:38:13.354] [7276] [info]       <template-hosts>
[2020-02-27 10:38:13.354] [7276] [info]          <template-host>
[2020-02-27 10:38:13.354] [7276] [info]             <video-mode>1080i5000</video-mode>
[2020-02-27 10:38:13.354] [7276] [info]             <filename>cg20.fth</filename>
[2020-02-27 10:38:13.354] [7276] [info]             <width>1920</width>
[2020-02-27 10:38:13.354] [7276] [info]             <height>1080</height>
[2020-02-27 10:38:13.354] [7276] [info]          </template-host>
[2020-02-27 10:38:13.354] [7276] [info]       </template-hosts>
[2020-02-27 10:38:13.354] [7276] [info]       <flash>
[2020-02-27 10:38:13.354] [7276] [info]          <buffer-depth>auto</buffer-depth>
[2020-02-27 10:38:13.354] [7276] [info]       </flash>
[2020-02-27 10:38:13.354] [7276] [info]       <mixer>
[2020-02-27 10:38:13.354] [7276] [info]          <blend-modes>true</blend-modes>
[2020-02-27 10:38:13.354] [7276] [info]          <mipmapping-default-on>false</mipmapping-default-on>
[2020-02-27 10:38:13.354] [7276] [info]          <straight-alpha>true</straight-alpha>
[2020-02-27 10:38:13.354] [7276] [info]       </mixer>
[2020-02-27 10:38:13.354] [7276] [info]       <accelerator>gpu</accelerator>
[2020-02-27 10:38:13.354] [7276] [info]       <lock-clear-phrase>secret</lock-clear-phrase>
[2020-02-27 10:38:13.354] [7276] [info]       <channels>
[2020-02-27 10:38:13.354] [7276] [info]          <channel>
[2020-02-27 10:38:13.354] [7276] [info]             <video-mode>1080i5000</video-mode>
[2020-02-27 10:38:13.354] [7276] [info]             <straight-alpha-output>true</straight-alpha-output>
[2020-02-27 10:38:13.354] [7276] [info]             <channel-layout>16ch</channel-layout>
[2020-02-27 10:38:13.354] [7276] [info]             <consumers>
[2020-02-27 10:38:13.354] [7276] [info]                <decklink>
[2020-02-27 10:38:13.354] [7276] [info]                   <device>1</device>
[2020-02-27 10:38:13.354] [7276] [info]                   <embedded-audio>false</embedded-audio>
[2020-02-27 10:38:13.354] [7276] [info]                   <latency>low</latency>
[2020-02-27 10:38:13.354] [7276] [info]                   <keyer>external</keyer>
[2020-02-27 10:38:13.354] [7276] [info]                   <buffer-depth>2</buffer-depth>
[2020-02-27 10:38:13.354] [7276] [info]                </decklink>
[2020-02-27 10:38:13.354] [7276] [info]             </consumers>
[2020-02-27 10:38:13.354] [7276] [info]          </channel>
[2020-02-27 10:38:13.354] [7276] [info]       </channels>
[2020-02-27 10:38:13.354] [7276] [info]       <audio>
[2020-02-27 10:38:13.354] [7276] [info]          <channel-layouts>
[2020-02-27 10:38:13.354] [7276] [info]             <channel-layout name="16ch" type="16ch" num-channels="16"/>
[2020-02-27 10:38:13.354] [7276] [info]          </channel-layouts>
[2020-02-27 10:38:13.354] [7276] [info]       </audio>
[2020-02-27 10:38:13.354] [7276] [info]       <controllers>
[2020-02-27 10:38:13.354] [7276] [info]          <tcp>
[2020-02-27 10:38:13.354] [7276] [info]             <port>5250</port>
[2020-02-27 10:38:13.354] [7276] [info]             <protocol>AMCP</protocol>
[2020-02-27 10:38:13.354] [7276] [info]          </tcp>
[2020-02-27 10:38:13.354] [7276] [info]       </controllers>
[2020-02-27 10:38:13.354] [7276] [info]       <amcp>
[2020-02-27 10:38:13.354] [7276] [info]          <media-server>
[2020-02-27 10:38:13.354] [7276] [info]             <host>localhost</host>
[2020-02-27 10:38:13.354] [7276] [info]             <port>8000</port>
[2020-02-27 10:38:13.354] [7276] [info]          </media-server>
[2020-02-27 10:38:13.354] [7276] [info]       </amcp>
[2020-02-27 10:38:13.354] [7276] [info]    </configuration>

[FLASH producer]
I noticed that as there is no [template-hosts] tag in the configuration file, the server crash, after multpily command Clear All (Clear 1), clips duration 6 seconds and next command CG ADD -> CG PLAY. If a tag is added, Caspar accepts the command, but then the message Failed appears, as in the logs. Is this a bug or are the clips used by my organization too short. In diag isn’t any consumer. Additional if I invoke CG 1-9 and in template code antother template should be invoke on layer 100 and 101, servwer ignore this and put this template to layer 9999.

Regards

Stable or not is an arbitrary label that does not reflect the overall stability of CasparCG, IMO we shouldn’t label releases as such.

404 means it didn’t find the template file - are they in C:/CG/CP4/Templates/?

Also you should simply convert these templates to HTML. I consider Flash EOL and that it should be deprecated in future versions of CCG as the maintenance most likely won’t be done unless someone wants to take over supporting the Flash module.

Yes templates are in this folder i replace signs in path / to \ and working, but if I not decalre DNS server adress, warrning (Failed to read DnsConfig) appear in console of course, but caspar server working very good, but if i declare DNS address, after five commands crash and console close automatically and error look that as below.

I convert to HTML this templates :slightly_smiling_face:

Regards

Failed to read dnsconfig is CEF (the HTML producer) trying to read the DNS config. Since the crash references flash.ocx I don’t think the two are related. Could you try uninstalling Flash to test that it doesn’t crash?

I’m uninstalling Flash, but with DNS error as the same (Caspar server stop working and console close), without DNS everything works.