Server.config tutorial

Hey everyone, I’m just getting started with CasperCG and I’m enjoying the experience so far, but I’m running into a few bumps since I’m not a programmer. I’ve read through a number of the postings about the config file set up but I haven’t come across a tutorial, or anything that really explains the file. I’m currently trying to set up for a decklink duo. I have had some success I was able to get key out. but only in NTSC 576i5994 which is not at all what I had put into the config. here is what I have for a config file.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <paths>
    <media-path>media/</media-path>
    <log-path>log/</log-path>
    <data-path>data/</data-path>
    <template-path>template/</template-path>
    <thumbnail-path>thumbnail/</thumbnail-path>
    <font-path>font/</font-path>
  </paths>
  <lock-clear-phrase>secret</lock-clear-phrase>
  <channels>
    <channel>
      <video-mode>NTSC</video-mode>
      <channel-layout>stereo</channel-layout>
      <consumers>
        <screen>
          <device>1</device>
          <windowed>true</windowed>
        </screen>
        <system-audio></system-audio>
	<decklink/>
      </consumers>
    </channel>
  </channels>
  <controllers>
    <tcp>
      <port>5250</port>
      <protocol>AMCP</protocol>
    </tcp>
    <tcp>
      <port>3250</port>
      <protocol>LOG</protocol>
    </tcp>
  </controllers>
</configuration>

I changed your post, toi make the config section readable. You can do that by selecting the text and clicking the buttom </>.

What you have in your config is one channel in NTSC:

<channel>
      <video-mode>NTSC</video-mode>

and a screen consumer. There is also a Decklink consumer added with defaults:
<decklink/>

So you get, what you asked for :):grinning:

The whole channel block (from <channel> to </channel>) should look like that:

<channel>
	<video-mode>1080i5994</video-mode>
	<straight-alpha-output>false</straight-alpha-output>
	<consumers>
		<decklink>
			<device>1</device>
			<embedded-audio>true</embedded-audio>
			<channel-layout>stereo</channel-layout>
			<latency>normal</latency>
			<keyer>external</keyer>
			<key-only>false</key-only>
			<buffer-depth>3</buffer-depth>
			<custom-allocator>true</custom-allocator>
		</decklink>            
	</consumers>
</channel>

What would make the whole config for two channels like so:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
	<paths>
		<media-path>media/</media-path>
		<log-path>log/</log-path>
		<data-path>data/</data-path>
		<template-path>template/</template-path>
		<thumbnail-path>thumbnail/</thumbnail-path>
		<font-path>font/</font-path>
	</paths>
	<lock-clear-phrase>secret</lock-clear-phrase>
	<channels>
		<channel>
			<video-mode>1080i5994</video-mode>
			<straight-alpha-output>false</straight-alpha-output>
			<consumers>
				<decklink>
					<device>1</device>
					<embedded-audio>true</embedded-audio>
					<channel-layout>stereo</channel-layout>
					<latency>normal</latency>
					<keyer>external</keyer>
					<key-only>false</key-only>
					<buffer-depth>3</buffer-depth>
					<custom-allocator>true</custom-allocator>
				</decklink>            
			</consumers>
		</channel>
		<channel>
			<video-mode>1080i5994</video-mode>
			<straight-alpha-output>false</straight-alpha-output>
			<consumers>
				<decklink>
					<device>2</device>
					<embedded-audio>true</embedded-audio>
					<channel-layout>stereo</channel-layout>
					<latency>normal</latency>
					<keyer>external</keyer>
					<key-only>false</key-only>
					<buffer-depth>3</buffer-depth>
					<custom-allocator>true</custom-allocator>
				</decklink>            
			</consumers>
		</channel>
	</channels>
	<controllers>
		<tcp>
			<port>5250</port>
			<protocol>AMCP</protocol>
		</tcp>
		<tcp>
			<port>3250</port>
			<protocol>LOG</protocol>
		</tcp>
	</controllers>
</configuration>

or something similar. Be sure to set the Decklink Duo 2 to output two fill & key pairs. You do that in the Decklink Control Panel Applet.

Okay thanks for showing me how to post the code. And thanks for the help so that first line
NTSC
Was overriding the settings below?
Okay one more thing the line for key -fill in this code below. I’m not sure what to do with the <device + 1> part, do I change that to the channel of the decklink that will be fill? This by the way is the config file from the original install of the server.

Thanks for the help with this

     <decklink>
            <device>2</device>
            <key-device>device + 1 [1..]</key-device>
            <embedded-audio>false [true|false]. 
            </embedded-audio>
            <channel-layout>stereo [mono|stereo|matrix|film|smpte|ebu_r123_8a|ebu_r123_8b|8ch|16ch]</channel-layout>
            <latency>normal [normal|low|default]</latency>
            <keyer>external [external|external_separate_device|internal|default]</keyer>
            <key-only>false [true|false]</key-only>
            <buffer-depth>3 [1..]</buffer-depth>
        </decklink>

Now I gave you a “pane-ready” config to use, have you tried it?

Not yet it’s still early in toronto, I just wanted to understand this config file a little bit better

So you need the pane for your baken and egg first, I understand :grinning:

:grinning: Okay so I was able to get it sort of working. the config you gave me wouldn’t load, but I was able to make some adjustments that did get it to work partially but i can only get the fill on ch3 of the card and no key so i keyed it over black to make it work for my video switcher. i was able to use the channel block you gave me to get it working. the full config you posted wouldn’t load. to me it looks like i have two channel configs, one is inside the config tag and the others are outside. which part is actually being used for the config? is it just the top portion inside the configuration tags?

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <paths>
<media-path>media/</media-path>
<log-path>log/</log-path>
<data-path>data/</data-path>
<template-path>template/</template-path>
<thumbnail-path>thumbnail/</thumbnail-path>
<font-path>font/</font-path>
  </paths>
  <lock-clear-phrase>secret</lock-clear-phrase>
  <channels>
<channel>
  <video-mode>1080i5994</video-mode>
  <channel-layout>stereo</channel-layout>
  <consumers>
    <screen>
      <device>1</device>
      <windowed>true</windowed>
    </screen>
    <system-audio></system-audio>
	<decklink/>
  </consumers>
</channel>
  </channels>
  <controllers>
<tcp>
  <port>5250</port>
  <protocol>AMCP</protocol>
</tcp>
<tcp>
  <port>3250</port>
  <protocol>LOG</protocol>
</tcp>
  </controllers>
</configuration>

<!--
<log-level>           info  [trace|debug|info|warning|error|fatal]</log-level>
<log-categories>      communication  [calltrace|communication|calltrace,communication]</log-categories>
<force-deinterlace>   false  [true|false]</force-deinterlace>
<channel-grid>        false [true|false]</channel-grid>
<mixer>
<blend-modes>          false [true|false]</blend-modes>
<mipmapping-default-on>false [true|false]</mipmapping-default-on>
<straight-alpha>       false [true|false]</straight-alpha>
</mixer>
<accelerator>auto [cpu|gpu|auto]</accelerator>
<template-hosts>
<template-host>
    <video-mode />
    <filename />
    <width />
    <height />
</template-host>
</template-hosts>
<flash>
<buffer-depth>auto [auto|1..]</buffer-depth>
</flash>
<html>
<remote-debugging-port>0 [0|1024-65535]</remote-debugging-port>
</html>
<thumbnails>
<generate-thumbnails>true [true|false]</generate-thumbnails>
<width>256</width>
<height>144</height>
<video-grid>2</video-grid>
<scan-interval-millis>5000</scan-interval-millis>
<generate-delay-millis>2000</generate-delay-millis>
<video-mode>1080p2997</video-mode>
<mipmap>true</mipmap>
</thumbnails>
<channels>
<channel>
    <video-mode> 1080i5994[PAL|NTSC|576p2500|720p2398|720p2400|720p2500|720p5000|720p2997|720p5994|720p3000|720p6000|1080p2398|1080p2400|1080i5000|1080i5994|1080i6000|1080p2500|1080p2997|1080p3000|1080p5000|1080p5994|1080p6000|1556p2398|1556p2400|1556p2500|dci1080p2398|dci1080p2400|dci1080p2500|2160p2398|2160p2400|2160p2500|2160p2997|2160p3000|2160p5000|2160p5994|2160p6000|dci2160p2398|dci2160p2400|dci2160p2500] </video-mode>
    <straight-alpha-output>false [true|false]</straight-alpha-output>
    <channel-layout>stereo [mono|stereo|matrix|film|smpte|ebu_r123_8a|ebu_r123_8b|8ch|16ch]</channel-layout>
    <consumers>
        <decklink>
		<device>1</device>
		<embedded-audio>true</embedded-audio>
		<channel-layout>stereo</channel-layout>
		<latency>normal</latency>
		<keyer>external</keyer>
		<key-only>false</key-only>
		<buffer-depth>3</buffer-depth>
		<custom-allocator>true</custom-allocator>
	    </decklink>     
	    <decklink>
		<device>2</device>
		<embedded-audio>true</embedded-audio>
		<channel-layout>stereo</channel-layout>
		<latency>normal</latency>
		<keyer>external</keyer>
		<key-only>false</key-only>
		<buffer-depth>3</buffer-depth>
		<custom-allocator>true</custom-allocator>
	    </decklink>     
        <bluefish>
            <device>[1..]</device>
		<sdi-stream>a[a|b|c|d] </sdi-stream>
            <embedded-audio>false [true|false]</embedded-audio>
            <channel-layout>stereo [mono|stereo|matrix|film|smpte|ebu_r123_8a|ebu_r123_8b|8ch|16ch]</channel-layout>
            <key-only>false [true|false]</key-only>
            <keyer>disabled [external|internal|disabled] (external only supported on channels a and c, using c requires 4 out connectors) ( internal only available on devices with a hardware keyer) </keyer>
            <internal-keyer-audio-source> videooutputchannel [videooutputchannel|sdivideoinput] ( only valid when using internal keyer option) </internal-keyer-audio-source>
        </bluefish>
        <system-audio>
            <channel-layout>stereo [mono|stereo|matrix]</channel-layout>
            <latency>200 [0..]</latency>
        </system-audio>
        <screen>
            <device>[0..]</device>
            <aspect-ratio>default [default|4:3|16:9]</aspect-ratio>
            <stretch>fill [none|fill|uniform|uniform_to_fill]</stretch>
            <windowed>true [true|false]</windowed>
            <key-only>false [true|false]</key-only>
            <auto-deinterlace>true [true|false]</auto-deinterlace>
            <vsync>false [true|false]</vsync>
            <interactive>true [true|false]</interactive>
            <borderless>false [true|false]</borderless>
        </screen>
        <newtek-ivga></newtek-ivga>
        <ffmpeg>
            <path>[file|url]</path>
            <args>[most ffmpeg arguments related to filtering and output codecs]</args>
            <separate-key>false [true|false]</separate-key>
            <mono-streams>false [true|false]</mono-streams>
        </ffmpeg>
        <syncto>
            <channel-id>1</channel-id>
        </syncto>
    </consumers>
</channel>
</channels>
<osc>
  <default-port>6250</default-port>
  <disable-send-to-amcp-clients>false [true|false]</disable-send-to-amcp-clients>
  <predefined-clients>
<predefined-client>
  <address>127.0.0.1</address>
  <port>5253</port>
</predefined-client>
  </predefined-clients>
</osc>
<audio>
	<channel-layouts>
		<channel-layout name="mono"        type="mono"        num-channels="1" channel-order="FC" />
		<channel-layout name="stereo"      type="stereo"      num-channels="2" channel-order="FL FR" />
		<channel-layout name="matrix"      type="matrix"      num-channels="2" channel-order="ML MR" />
		<channel-layout name="film"        type="5.1"         num-channels="6" channel-order="FL FC FR BL BR LFE" />
		<channel-layout name="smpte"       type="5.1"         num-channels="6" channel-order="FL FR FC LFE BL BR" />
		<channel-layout name="ebu_r123_8a" type="5.1+downmix" num-channels="8" channel-order="DL DR FL FR FC LFE BL BR" />
		<channel-layout name="ebu_r123_8b" type="5.1+downmix" num-channels="8" channel-order="FL FR FC LFE BL BR DL DR" />
		<channel-layout name="8ch"         type="8ch"         num-channels="8" />
		<channel-layout name="16ch"        type="16ch"        num-channels="16" />
	</channel-layouts>
	<mix-configs>
		<mix-config from-type="mono"          to-types="stereo, 5.1"  mix="FL = FC                                           | FR = FC" />
		<mix-config from-type="mono"          to-types="5.1+downmix"  mix="FL = FC                                           | FR = FC                                         | DL = FC | DR = FC" />
		<mix-config from-type="mono"          to-types="matrix"       mix="ML = FC                                           | MR = FC" />
		<mix-config from-type="stereo"        to-types="mono"         mix="FC &lt; FL + FR" />
		<mix-config from-type="stereo"        to-types="matrix"       mix="ML = FL                                           | MR = FR" />
		<mix-config from-type="stereo"        to-types="5.1"          mix="FL = FL                                           | FR = FR" />
		<mix-config from-type="stereo"        to-types="5.1+downmix"  mix="FL = FL                                           | FR = FR                                         | DL = FL | DR = FR" />
		<mix-config from-type="5.1"           to-types="mono"         mix="FC &lt; FL + FR + 0.707*FC + 0.707*BL + 0.707*BR" />
		<mix-config from-type="5.1"           to-types="stereo"       mix="FL &lt; FL + 0.707*FC + 0.707*BL                  | FR &lt; FR + 0.707*FC + 0.707*BR" />
		<mix-config from-type="5.1"           to-types="5.1+downmix"  mix="FL = FL                                           | FR = FR                                         | FC = FC | BL = BL | BR = BR | LFE = LFE | DL &lt; FL + 0.707*FC + 0.707*BL | DR &lt; FR + 0.707*FC + 0.707*BR" />
		<mix-config from-type="5.1"           to-types="matrix"       mix="ML = 0.3204*FL + 0.293*FC + -0.293*BL + -0.293*BR | MR = 0.3204*FR + 0.293*FC + 0.293*BL + 0.293*BR" />
		<mix-config from-type="5.1+stereomix" to-types="mono"         mix="FC &lt; DL + DR" />
		<mix-config from-type="5.1+stereomix" to-types="stereo"       mix="FL = DL                                           | FR = DR" />
		<mix-config from-type="5.1+stereomix" to-types="5.1"          mix="FL = FL                                           | FR = FR                                         | FC = FC | BL = BL | BR = BR | LFE = LFE" />
		<mix-config from-type="5.1+stereomix" to-types="matrix"       mix="ML = 0.3204*FL + 0.293*FC + -0.293*BL + -0.293*BR | MR = 0.3204*FR + 0.293*FC + 0.293*BL + 0.293*BR" />
	</mix-configs>
</audio>
-->
1 Like

Everything between <!-- and --> are comments and evaluated as if they were not there. So the big lower portion of the file is meant to show you, what the different settings are about.

Are you sure, that you configured your Decklink Duo 2 to output 2 times fill & key? As this needs to be done in Windows (as I wrote you already). Because then my config should work better. You see, I have no Duo 2 card here, so I can not test it nor post you y screenshot of the decklink configuration in control panel…

1 Like

Okay that makes sense, the only language I know even a bit of is Java and the co.ments are different that’s what was confusing me.
The card is configured correctly. I’m familiar with how black magic works I have a few of the cards. I’ll give it another try maybe I missed something when I copied it

Thank you for all the help

So I did change the config file back to what you suggested and it worked fine today so I must have made a mistake with it. Now I just need to get the mapping figures out for the decklink card, it currently set to sdi 1& sdi 2 but I can only get out put on the sdi 2 out and sdi 3 out. So I need to do some more trouble shooting with the card I think. But the software is working as it should now.

Thank you very much for the assistance I appreciate your time.

AFAIK if you set the Duo 2 to twice fill and key you should get two channels in Caspar and SDI 1 & 2 should be channel 1, SDI 3 & 4 channel 2. The uneven is fill and the even is key. Sometimes it helps to connect the card to a monitor, to make sure, that it’s not a vison mixer config that messes all up.

Thanks for the tip I’ll have to look I think the issue I’m having is definitely with the card setup so I’ll have to go through the setting and try what you suggested.