casparcg

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 14 Imported by: 0

README ΒΆ

CasparCG AMCP Go Logo

CasparCG AMCP Go

A fast, idiomatic Go implementation of the CasparCG AMCP protocol.

Go Reference Go Report Card CasparCG AMCP Build Status Minimum Go Version


πŸ“– Overview

casparcg-amcp-go provides a clean, concurrent interface to communicate with CasparCG servers using Go. It abstracts away the raw socket communication, handling command parsing and response mapping so you can focus on building your broadcast logic.

Commands are built directly based on the official AMCP Protocol Documentation with a more strict approach to optional variables.

✨ Features

  • Fluent Builder API: Inspired by patterns like zerolog, commands are constructed through a chainable, context-aware builder.
  • Semantic AMCP Extensions: The standard AMCP command were expanded into a more descriptive API. This replaces undocumented server strings with human-readable methods.
  • Rich Error Handling: Includes a native CasparCGError struct that wraps raw server codes and messages into a structured format.
  • Explicit Parameter Safety: Eliminates fallbacks to defaults {[layer:int]|-0}, by enforcing strict definitions for optional variables.
  • DTOs: Commands return a structured DTO instead of raw data.

🧩 Examples

err := client.CG().Channel(1).Layer(1).CGLayer(1).Add(types.CGAdd{Template: "L3", PlayOnLoad: true, Data: jsonString})
if err != nil {
  var casparErr casparcg.CasparCGError
  if errors.As(err, &casparErr) {
    fmt.Printf("CasparCG error: %d - %s\n", casparErr.Code, casparErr.Message)
  }
  panic(err)
}

More examples can be found in the ./cmd/ directory to see how to use this package.
These are more starting points than full implementations.

πŸš€ Getting Started

Installation

Install the package via go get:

go get github.com/OverlayFox/casparcg-amcp-go

πŸ”¬ Tests

This package enforces a strict approach to stability via a automated testing suite:

  • Strict Code Standards: Enforces consistent code style using .golangci.yaml via multiple linters and formatters.
  • validates and tests every commit against all major Go versions via automated runners to ensure backward compatibility.
  • Integration Test verifies package against the latest builds of CasparCG Server 2.4 and 2.5. Not yet implemented.

🚧 Roadmap & Missing Features

As it stands right now, most of the commands have been implemented.
But there are some more abstract commands that have not made it into this package.

The main feature categories currently missing are:

  • Batching
  • Data Commands

Below is a specific list of AMCP commands still to be implemented:

Documentation ΒΆ

Index ΒΆ

Constants ΒΆ

This section is empty.

Variables ΒΆ

View Source
var (
	ErrValueOutOfRange = errors.New("value out of range")
	ErrLayerNotSet     = errors.New("layer is not set")
	ErrLayerSet        = errors.New("layer is set but expected to be unset")
)

Functions ΒΆ

This section is empty.

Types ΒΆ

type CGBuilder ΒΆ

type CGBuilder struct {
	// contains filtered or unexported fields
}

CGBuilder provides a fluent interface for building CG (template) commands.

func (*CGBuilder) Channel ΒΆ added in v0.2.0

func (c *CGBuilder) Channel(videoChannel int) *CGChannelBuilder

Channel selects the video channel to operate on and returns a CGChannelBuilder for that channel.

type CGCGLayerBuilder ΒΆ added in v0.2.0

type CGCGLayerBuilder struct {
	CGLayerBuilder

	CgLayer int
}

func (*CGCGLayerBuilder) Add ΒΆ added in v0.2.0

func (b *CGCGLayerBuilder) Add(params types.CGAdd) error

Add prepares a template for displaying.

func (*CGCGLayerBuilder) Clear ΒΆ added in v0.2.0

func (b *CGCGLayerBuilder) Clear() error

Clear removes all templates on the video layer.

func (*CGCGLayerBuilder) Info ΒΆ added in v0.2.0

func (b *CGCGLayerBuilder) Info(cgLayer *int) error

Info retrieves information about the template on the specified layer.

TODO: Implement response object of INFO command

func (*CGCGLayerBuilder) Invoke ΒΆ added in v0.2.0

func (b *CGCGLayerBuilder) Invoke(method string) error

Invoke invokes the given method on the template.

method - string: the name of the method to invoke on the template.

func (*CGCGLayerBuilder) Next ΒΆ added in v0.2.0

func (b *CGCGLayerBuilder) Next() error

Next triggers a "continue" in the template.

func (*CGCGLayerBuilder) Play ΒΆ added in v0.2.0

func (b *CGCGLayerBuilder) Play() error

Play plays and displays the template in the specified layer.

func (*CGCGLayerBuilder) Remove ΒΆ added in v0.2.0

func (b *CGCGLayerBuilder) Remove() error

Remove removes the template from the specified layer.

func (*CGCGLayerBuilder) Stop ΒΆ added in v0.2.0

func (b *CGCGLayerBuilder) Stop() error

Stop stops the template in the specified layer.

func (*CGCGLayerBuilder) Update ΒΆ added in v0.2.0

func (b *CGCGLayerBuilder) Update(data string) error

Update sends new data to the template on specified layer.

data - string: data to pass to the template. This can be a JSON or XML inline string.

type CGChannelBuilder ΒΆ added in v0.2.0

type CGChannelBuilder struct {
	CGBuilder
	// contains filtered or unexported fields
}

func (*CGChannelBuilder) Layer ΒΆ added in v0.2.0

func (cb *CGChannelBuilder) Layer(layer int) *CGLayerBuilder

Layer selects the layer to operate on and returns a CGLayerBuilder for that layer.

type CGLayerBuilder ΒΆ added in v0.2.0

type CGLayerBuilder struct {
	CGChannelBuilder
	// contains filtered or unexported fields
}

func (*CGLayerBuilder) CGLayer ΒΆ added in v0.2.0

func (cb *CGLayerBuilder) CGLayer(cgLayer int) *CGCGLayerBuilder

CGLayer selects the CG layer to operate on and returns a CGCGLayerBuilder for that CG layer.

func (*CGLayerBuilder) Info ΒΆ added in v0.2.0

func (b *CGLayerBuilder) Info(cgLayer *int) error

Info retrieves information about the template on the specified layer.

TODO: Implement response object of INFO command

type CasparCGError ΒΆ added in v0.1.0

type CasparCGError struct {
	Code    int
	Message string
}

func (CasparCGError) Error ΒΆ added in v0.1.0

func (e CasparCGError) Error() string

type ChromaBuilder ΒΆ added in v0.2.0

type ChromaBuilder struct {
	// contains filtered or unexported fields
}

ChromaBuilder provides a fluent interface for chroma key operations.

func (*ChromaBuilder) Disable ΒΆ added in v0.2.0

func (c *ChromaBuilder) Disable() error

Disable disables chroma keying.

func (*ChromaBuilder) Enable ΒΆ added in v0.2.0

func (c *ChromaBuilder) Enable() error

Enable enables chroma keying with the configured parameters.

type Client ΒΆ

type Client struct {
	// contains filtered or unexported fields
}

Client represents a connection to a CasparCG server.

func NewClient ΒΆ

func NewClient(host string, port int) *Client

NewClient creates a new CasparCG client.

func (*Client) Bye ΒΆ added in v0.2.0

func (c *Client) Bye() error

Bye closes the connection.

func (*Client) CG ΒΆ

func (c *Client) CG() *CGBuilder

CG creates a new CG command builder for the specified channel and layer.

func (*Client) Close ΒΆ

func (c *Client) Close() error

Close closes the connection to the CasparCG server.

func (*Client) Connect ΒΆ

func (c *Client) Connect(ctx context.Context) error

Connect establishes a connection to the CasparCG server.

func (*Client) Diag ΒΆ added in v0.2.0

func (c *Client) Diag() error

Diag opens the diagnostic window.

func (*Client) Help ΒΆ added in v0.2.0

func (c *Client) Help() *ClientHelpCommand

Help shows online help for a specific command or a list of all commands.

func (*Client) Kill ΒΆ added in v0.2.0

func (c *Client) Kill() error

Kill kills the server.

func (*Client) Layer ΒΆ

func (c *Client) Layer() *LayerBuilder

Layer creates a new layer command builder for the specified channel and layer.

func (*Client) LogLevel ΒΆ added in v0.2.0

func (c *Client) LogLevel(level types.LogLevel) error

LogLevel sets the log level.

func (*Client) Mixer ΒΆ added in v0.2.0

func (c *Client) Mixer() *MixerBuilder

Mixer creates a new MixerBuilder for the specified video channel and layer.

func (*Client) Ping ΒΆ added in v0.2.0

func (c *Client) Ping(token *string) (string, error)

Ping sends a ping command.

func (*Client) Query ΒΆ added in v0.2.0

func (c *Client) Query() *QueryBuilder

Query creates a new query command builder for the specified channel and layer.

func (*Client) Restart ΒΆ added in v0.2.0

func (c *Client) Restart() error

Restart restarts the server.

func (*Client) Send ΒΆ

func (c *Client) Send(command interface{ String() string }) ([]string, error)

Send sends a command to the CasparCG server and returns the response.

type ClientHelpCommand ΒΆ added in v0.2.0

type ClientHelpCommand struct {
	// contains filtered or unexported fields
}

func (*ClientHelpCommand) Consumer ΒΆ added in v0.2.0

func (b *ClientHelpCommand) Consumer(consumer *string) ([]string, error)

Consumer shows a detailed description of the specified consumer, or a list of all consumers if no consumer is specified.

func (*ClientHelpCommand) Generic ΒΆ added in v0.2.0

func (b *ClientHelpCommand) Generic(command *string) ([]string, error)

Generic shows a detailed description of the specified command, or a list of all commands if no command is specified.

func (*ClientHelpCommand) Producer ΒΆ added in v0.2.0

func (b *ClientHelpCommand) Producer(producer *string) ([]string, error)

Producer shows a detailed description of the specified producer, or a list of all producers if no producer is specified.

type LayerBuilder ΒΆ

type LayerBuilder struct {
	// contains filtered or unexported fields
}

LayerBuilder provides a fluent interface for building layer-based commands.

func (*LayerBuilder) Channel ΒΆ added in v0.2.0

func (c *LayerBuilder) Channel(videoChannel int) *LayerChannelBuilder

type LayerChannelBuilder ΒΆ added in v0.2.0

type LayerChannelBuilder struct {
	LayerBuilder
	// contains filtered or unexported fields
}

func (*LayerChannelBuilder) Add ΒΆ added in v0.2.0

func (b *LayerChannelBuilder) Add(params types.LayerAdd) error

func (*LayerChannelBuilder) Clear ΒΆ added in v0.2.0

func (b *LayerChannelBuilder) Clear() error

Clear clears all layers in the channel.

func (*LayerChannelBuilder) Info ΒΆ added in v0.2.0

func (*LayerChannelBuilder) Layer ΒΆ added in v0.2.0

func (c *LayerChannelBuilder) Layer(layer int) *LayerLayerBuilder

func (*LayerChannelBuilder) Lock ΒΆ added in v0.2.0

Lock locks a channel for exclusive access.

func (*LayerChannelBuilder) Print ΒΆ added in v0.2.0

func (b *LayerChannelBuilder) Print() error

func (*LayerChannelBuilder) Remove ΒΆ added in v0.2.0

Remove removes an existing consumer from video_channel.

func (*LayerChannelBuilder) Set ΒΆ added in v0.2.0

func (*LayerChannelBuilder) Swap ΒΆ added in v0.2.0

func (b *LayerChannelBuilder) Swap(channel2 int, transforms bool) error

Swap swaps channels.

type LayerCommandChannelInfo ΒΆ added in v0.2.0

type LayerCommandChannelInfo struct {
	LayerChannelBuilder
}

func (*LayerCommandChannelInfo) Delay deprecated added in v0.2.0

Delay get the current delay on the specified channel.

Deprecated: This command does not return what it states as of CasparCG 2.5.0 https://github.com/CasparCG/server/issues/1151

func (*LayerCommandChannelInfo) Generic ΒΆ added in v0.2.0

Generic gets information about the channel.

type LayerCommandLayerInfo ΒΆ added in v0.2.0

type LayerCommandLayerInfo struct {
	LayerLayerBuilder
}

func (*LayerCommandLayerInfo) Delay deprecated added in v0.2.0

Delay get the current delay on the specified channel.

Deprecated: This command does not return what it states as of CasparCG 2.5.0 https://github.com/CasparCG/server/issues/1151

func (*LayerCommandLayerInfo) Generic ΒΆ added in v0.2.0

Generic gets information about the channel.

type LayerCommandLock ΒΆ added in v0.2.0

type LayerCommandLock struct {
	LayerChannelBuilder
}

func (*LayerCommandLock) Acquire ΒΆ added in v0.2.0

func (b *LayerCommandLock) Acquire(passphrase string) error

Acquire acquires the lock with the given passphrase.

func (*LayerCommandLock) Clear ΒΆ added in v0.2.0

func (b *LayerCommandLock) Clear() error

Clear clears the lock

This is for emergency use only and should be used with caution.

func (*LayerCommandLock) Release ΒΆ added in v0.2.0

func (b *LayerCommandLock) Release(passphrase string) error

Release releases the lock with the given passphrase.

type LayerCommandRemove ΒΆ added in v0.2.0

type LayerCommandRemove struct {
	LayerChannelBuilder
}

func (*LayerCommandRemove) ConsumerIDX ΒΆ added in v0.2.0

func (b *LayerCommandRemove) ConsumerIDX(idx int) error

ConsumerIDX removes the consumer via its id.

func (*LayerCommandRemove) Params ΒΆ added in v0.2.0

func (b *LayerCommandRemove) Params(params []string) error

Params removes the consumer that matches the given parameters.

type LayerCommandSet ΒΆ added in v0.2.0

type LayerCommandSet struct {
	LayerChannelBuilder
}

func (*LayerCommandSet) ChannelLayout ΒΆ added in v0.2.0

func (b *LayerCommandSet) ChannelLayout(value types.AudioChannelLayout) error

func (*LayerCommandSet) Mode ΒΆ added in v0.2.0

func (b *LayerCommandSet) Mode(value types.VideoMode) error

type LayerLayerBuilder ΒΆ added in v0.2.0

type LayerLayerBuilder struct {
	LayerChannelBuilder
	// contains filtered or unexported fields
}

func (*LayerLayerBuilder) Call ΒΆ added in v0.2.0

func (b *LayerLayerBuilder) Call(params []string) error

Call calls a function on the layer.

TODO: Implement all possible parameter for CALL command

func (*LayerLayerBuilder) Clear ΒΆ added in v0.2.0

func (b *LayerLayerBuilder) Clear() error

Clear clears the layer.

func (*LayerLayerBuilder) Info ΒΆ added in v0.2.0

func (*LayerLayerBuilder) Load ΒΆ added in v0.2.0

func (b *LayerLayerBuilder) Load(params types.LayerLoad) error

Load loads a clip to the layer.

func (*LayerLayerBuilder) Pause ΒΆ added in v0.2.0

func (b *LayerLayerBuilder) Pause() error

Pause pauses playback on the layer.

func (*LayerLayerBuilder) Play ΒΆ added in v0.2.0

func (b *LayerLayerBuilder) Play(params types.LayerPlay) error

Play plays content on the layer.

func (*LayerLayerBuilder) Resume ΒΆ added in v0.2.0

func (b *LayerLayerBuilder) Resume() error

Resume resumes playback on the layer.

func (*LayerLayerBuilder) Stop ΒΆ added in v0.2.0

func (b *LayerLayerBuilder) Stop() error

Stop stops playback on the layer.

func (*LayerLayerBuilder) Swap ΒΆ added in v0.2.0

func (b *LayerLayerBuilder) Swap(channel2 int, layer2 int, transforms bool) error

Swap swaps layers between channels.

type MixerBuilder ΒΆ added in v0.2.0

type MixerBuilder struct {
	// contains filtered or unexported fields
}

MixerBuilder provides a fluent interface for mixer operations on a specific video channel and layer.

func (*MixerBuilder) Channel ΒΆ added in v0.2.0

func (c *MixerBuilder) Channel(videoChannel int) *MixerChannelBuilder

Channel selects the video channel to operate on and returns a MixerChannelBuilder for that channel.

func (*MixerBuilder) Fade ΒΆ added in v0.2.0

func (b *MixerBuilder) Fade(fade *types.Fade) *MixerBuilder

Fade sets a fade transition to be applied to the next setter operation. The fade is automatically cleared after being used, so it only applies to one operation. Returns the builder for method chaining.

type MixerChannelBuilder ΒΆ added in v0.2.0

type MixerChannelBuilder struct {
	MixerBuilder
	// contains filtered or unexported fields
}

func (*MixerChannelBuilder) Clear ΒΆ added in v0.2.0

func (b *MixerChannelBuilder) Clear() error

Clear clears all transformations on a channel or layer.

func (*MixerChannelBuilder) Commit ΒΆ added in v0.2.0

func (b *MixerChannelBuilder) Commit() error

Commit commits all deferred mixer transforms on the specified channel. This ensures that all animations start at the same exact frame.

func (*MixerChannelBuilder) GetGrid ΒΆ added in v0.2.0

func (b *MixerChannelBuilder) GetGrid() (int, error)

GetGrid retrieves the current grid settings for the video channel.

func (*MixerChannelBuilder) GetMasterVolume ΒΆ added in v0.2.0

func (b *MixerChannelBuilder) GetMasterVolume() (float32, error)

GetMasterVolume retrieves the current master audio volume for the video channel.

1.0 = original volume, 0.5 = half volume, 2.0 = double volume. Higher and lower values allowed.

func (*MixerChannelBuilder) GetStraightAlphaOutput ΒΆ added in v0.2.0

func (b *MixerChannelBuilder) GetStraightAlphaOutput() (bool, error)

GetStraightAlphaOutput retrieves the current straight alpha output state for the channel.

func (*MixerChannelBuilder) Layer ΒΆ added in v0.2.0

func (cb *MixerChannelBuilder) Layer(layer int) *MixerLayerBuilder

Layer selects the layer to operate on and returns a MixerLayerBuilder for that layer.

func (*MixerChannelBuilder) SetGrid ΒΆ added in v0.2.0

func (b *MixerChannelBuilder) SetGrid(resolution int) error

SetGrid creates a grid of video layer in ascending order of the layer index, i.e. if resolution equals 2 then a 2x2 grid of layers will be created starting from layer 1.

resolution: int - The number of cells in the grid. (e.g: 2 = 2x2 grid, 3 = 3x3 grid, etc.)

Use Fade() before calling this method to apply a smooth transition.

func (*MixerChannelBuilder) SetMasterVolume ΒΆ added in v0.2.0

func (b *MixerChannelBuilder) SetMasterVolume(volume float32) error

SetMasterVolume sets the master audio volume for the video channel.

volume: float32 - The new master volume, 1.0 = original volume, 0.5 = half volume, 2.0 = double volume. Higher and lower values allowed.

func (*MixerChannelBuilder) SetStraightAlphaOutput ΒΆ added in v0.2.0

func (b *MixerChannelBuilder) SetStraightAlphaOutput(enable bool) error

SetStraightAlphaOutput enables or disables straight alpha output for the channel.

This only works per video channel, not per layer.

type MixerLayerBuilder ΒΆ added in v0.2.0

type MixerLayerBuilder struct {
	MixerChannelBuilder
	// contains filtered or unexported fields
}

func (*MixerLayerBuilder) Clear ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) Clear() error

Clear clears all transformations on a channel or layer.

func (*MixerLayerBuilder) GetAnchor ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) GetAnchor() (responses.MixerAnchor, error)

GetAnchor retrieves the current anchor point settings for the layer.

func (*MixerLayerBuilder) GetBlendMode ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) GetBlendMode() (types.BlendMode, error)

GetBlendMode retrieves the current blend mode for the layer.

func (*MixerLayerBuilder) GetBrightness ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) GetBrightness() (float32, error)

GetBrightness retrieves the current brightness value for the layer.

func (*MixerLayerBuilder) GetChroma ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) GetChroma() (responses.MixerChroma, error)

GetChroma retrieves the current chroma key settings for the layer.

func (*MixerLayerBuilder) GetClip ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) GetClip() (responses.MixerClip, error)

GetClip retrieves the current clip (position and scale) settings for the layer.

func (*MixerLayerBuilder) GetContrast ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) GetContrast() (float32, error)

GetContrast retrieves the current contrast value for the layer.

func (*MixerLayerBuilder) GetCrop ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) GetCrop() (responses.MixerCrop, error)

GetCrop retrieves the current crop settings for the layer.

func (*MixerLayerBuilder) GetFill ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) GetFill() (responses.MixerFill, error)

GetFill retrieves the current fill (position and scale) settings for the layer.

func (*MixerLayerBuilder) GetInvert ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) GetInvert() (bool, error)

GetInvert retrieves the current invert state for the layer.

func (*MixerLayerBuilder) GetKeyer ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) GetKeyer() (bool, error)

GetKeyer retrieves the current keyer state for the layer.

func (*MixerLayerBuilder) GetLevels ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) GetLevels() (types.MixerLevels, error)

GetLevels retrieves the current levels settings for the layer.

func (*MixerLayerBuilder) GetMipMap ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) GetMipMap() (bool, error)

GetMipMap retrieves the current mipmap state for the layer.

func (*MixerLayerBuilder) GetOpacity ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) GetOpacity() (float32, error)

GetOpacity retrieves the current opacity value for the layer (0.0 to 1.0).

func (*MixerLayerBuilder) GetPerspective ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) GetPerspective() (responses.MixerPerspective, error)

GetPerspective retrieves the current perspective settings for the layer.

func (*MixerLayerBuilder) GetRotation ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) GetRotation() (float32, error)

GetRotation retrieves the current rotation angle for the layer in degrees.

0 = no rotation, 90 = 90 degrees clockwise, -90 = 90 degrees counterclockwise. Higher and lower values allowed.

func (*MixerLayerBuilder) GetSaturation ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) GetSaturation() (float32, error)

GetSaturation retrieves the current saturation value for the layer.

func (*MixerLayerBuilder) GetVolume ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) GetVolume() (float32, error)

GetVolume retrieves the current audio volume for the layer.

1.0 = original volume, 0.5 = half volume, 2.0 = double volume. Higher and lower values allowed.

func (*MixerLayerBuilder) SetAnchor ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) SetAnchor(params responses.MixerAnchor) error

SetAnchor changes the anchor point of the specified layer.

Use Fade() before calling this method to apply a smooth transition.

func (*MixerLayerBuilder) SetBlendMode ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) SetBlendMode(mode types.BlendMode) error

SetBlendMode sets the blend mode for the layer.

func (*MixerLayerBuilder) SetBrightness ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) SetBrightness(brightness float32) error

SetBrightness sets the brightness value for the layer.

brightness: float32 - The new brightness value, 0.5 = original brightness, 0.0 = completely dark, 1.0 = double brightness.

Use Fade() before calling this method to apply a smooth transition.

func (*MixerLayerBuilder) SetChroma ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) SetChroma(params responses.MixerChroma) *ChromaBuilder

SetChroma configures chroma key parameters and returns a ChromaBuilder.

Use .Enable() or .Disable() to apply the settings.

Use Fade() before calling this method to apply a smooth transition.

func (*MixerLayerBuilder) SetClip ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) SetClip(params responses.MixerClip) error

SetClip defines the rectangular viewport where a layer is rendered thru on the screen without being affected by MIXER FILL, MIXER ROTATION and MIXER PERSPECTIVE.

Use Fade() before calling this method to apply a smooth transition.

func (*MixerLayerBuilder) SetContrast ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) SetContrast(contrast float32) error

SetContrast sets the contrast value for the layer.

contrast: float32 - The new contrast value, 0.5 = original contrast, 0.0 = completely gray, 1.0 = double contrast.

Use Fade() before calling this method to apply a smooth transition.

func (*MixerLayerBuilder) SetCrop ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) SetCrop(params types.MixerCrop) error

SetCrop sets the crop values for the layer.

Use Fade() before calling this method to apply a smooth transition.

func (*MixerLayerBuilder) SetFill ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) SetFill(params types.MixerParamsFill) error

SetFill scales and positions the video stream on the specified layer. The positioning and scaling is performed around the anchor point set by MIXER ANCHOR.

Use Fade() before calling this method to apply a smooth transition.

func (*MixerLayerBuilder) SetInvert ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) SetInvert(state bool) error

SetInvert enables or disables color inversion for the layer.

func (*MixerLayerBuilder) SetKeyer ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) SetKeyer(show bool) error

SetKeyer enables or disables the keyer effect. When enabled, layer n+1's alpha is replaced with the R (red) channel of layer n, and the RGB channels of layer n are hidden. If show is true, the specified layer will not be rendered; instead it will be used as the key for the layer above.

func (*MixerLayerBuilder) SetLevels ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) SetLevels(params types.MixerLevels) error

SetLevels adjusts the input/output levels and gamma for the layer.

Use Fade() before calling this method to apply a smooth transition.

func (*MixerLayerBuilder) SetMipMap ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) SetMipMap(enable bool) error

SetMipMap enables or disables mipmapping for the layer.

func (*MixerLayerBuilder) SetOpacity ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) SetOpacity(opacity float32) error

SetOpacity sets the opacity value for the layer.

opacity: float32 - The new opacity value, 0.0 = completely transparent, 1.0 = fully opaque.

Use Fade() before calling this method to apply a smooth transition.

func (*MixerLayerBuilder) SetPerspective ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) SetPerspective(params types.MixerPerspective) error

SetPerspective sets the perspective transformation for the layer.

Use Fade() before calling this method to apply a smooth transition.

func (*MixerLayerBuilder) SetRotation ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) SetRotation(rotation float32) error

SetRotation sets the rotation angle for the layer in degrees.

rotation: float32 - The new rotation angle, 0 = no rotation, 90 = 90 degrees clockwise, -90 = 90 degrees counterclockwise. Higher and lower values allowed.

Use Fade() before calling this method to apply a smooth transition.

func (*MixerLayerBuilder) SetSaturation ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) SetSaturation(saturation float32) error

SetSaturation sets the saturation value for the layer.

saturation: float32 - The new saturation value, 0.5 = original saturation, 0.0 = completely desaturated (gray), 1.0 = double saturation.

Use Fade() before calling this method to apply a smooth transition.

func (*MixerLayerBuilder) SetVolume ΒΆ added in v0.2.0

func (b *MixerLayerBuilder) SetVolume(volume float32) error

SetVolume sets the audio volume for the layer.

volume: float32 - The new volume, 1.0 = original volume, 0.5 = half volume, 2.0 = double volume. Higher and lower values allowed.

Use Fade() before calling this method to apply a smooth transition.

type QueryBuilder ΒΆ added in v0.2.0

type QueryBuilder struct {
	// contains filtered or unexported fields
}

func (*QueryBuilder) CINF ΒΆ added in v0.2.0

func (b *QueryBuilder) CINF(filename string) (responses.CINF, error)

CINF returns information about a media file.

func (*QueryBuilder) CLS ΒΆ added in v0.2.0

func (b *QueryBuilder) CLS(subDirectory *string) ([]responses.CINF, error)

CLS lists media files in the media folder.

Use the command INFO PATHS to get the path to the media folder.

If the optional sub_directory is specified only the media files in that sub directory will be returned.

func (*QueryBuilder) FLS ΒΆ added in v0.2.0

func (b *QueryBuilder) FLS() ([]string, error)

FLS lists all fonts

TODO: implement DTO for FLS response

func (*QueryBuilder) GLGC ΒΆ added in v0.2.0

func (b *QueryBuilder) GLGC() error

GLGC releases all the pooled OpenGL resources.

⚠️ WARNING: May cause a pause on all video channels.

func (*QueryBuilder) Info ΒΆ added in v0.2.0

func (b *QueryBuilder) Info() *QueryInfoCommand

func (*QueryBuilder) TLS ΒΆ added in v0.2.0

func (b *QueryBuilder) TLS(directory *string) ([]string, error)

TLS lists template files.

Use the command INFO PATHS to get the path to the templates folder.

If the optional sub_directory is specified only the template files in that sub directory will be returned.

func (*QueryBuilder) Version ΒΆ added in v0.2.0

func (b *QueryBuilder) Version() *QueryVersionCommand

Version returns the version of specified component.

type QueryInfoCommand ΒΆ added in v0.2.0

type QueryInfoCommand struct {
	QueryBuilder
}

func (*QueryInfoCommand) Config ΒΆ added in v0.2.0

Config gets the contents of the configuration used.

func (*QueryInfoCommand) GL ΒΆ added in v0.2.0

GL retrieves information about the allocated and pooled OpenGL resources.

func (*QueryInfoCommand) Generic ΒΆ added in v0.2.0

Generic retrieves a list of the available channels.

func (*QueryInfoCommand) Paths ΒΆ added in v0.2.0

func (b *QueryInfoCommand) Paths() (responses.Paths, error)

Paths gets information about the paths used.

func (*QueryInfoCommand) Queues deprecated added in v0.2.0

Queues gets detailed information about all AMCP Command Queues.

Deprecated: This command does not return what it states as of CasparCG 2.5.0 https://github.com/CasparCG/server/issues/1151

func (*QueryInfoCommand) Server ΒΆ added in v0.2.0

Server gets detailed information about all channels.

func (*QueryInfoCommand) System deprecated added in v0.2.0

System gets system information like OS, CPU and library version numbers.

Deprecated: This command does not return what it states as of CasparCG 2.5.0 https://github.com/CasparCG/server/issues/1151

func (*QueryInfoCommand) Template deprecated added in v0.2.0

func (b *QueryInfoCommand) Template(template string) (responses.QueryChannelInfo, error)

Template gets information about the specified template.

Deprecated: This command does not return what it states as of CasparCG 2.5.0 https://github.com/CasparCG/server/issues/1151

func (*QueryInfoCommand) Threads deprecated added in v0.2.0

Threads gets detailed information about all threads.

Deprecated: This command does not return what it states as of CasparCG 2.5.0 https://github.com/CasparCG/server/issues/1151

type QueryVersionCommand ΒΆ added in v0.2.0

type QueryVersionCommand struct {
	QueryBuilder
}

func (*QueryVersionCommand) CEF ΒΆ added in v0.2.0

func (b *QueryVersionCommand) CEF() (string, error)

func (*QueryVersionCommand) Flash ΒΆ added in v0.2.0

func (b *QueryVersionCommand) Flash() (string, error)

func (*QueryVersionCommand) Generic ΒΆ added in v0.2.0

func (b *QueryVersionCommand) Generic() (string, error)

func (*QueryVersionCommand) Server ΒΆ added in v0.2.0

func (b *QueryVersionCommand) Server() (string, error)

func (*QueryVersionCommand) TemplateHost ΒΆ added in v0.2.0

func (b *QueryVersionCommand) TemplateHost() (string, error)

Directories ΒΆ

Path Synopsis
cmd
getInfo command
playTemplate command
playVideo command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL