### RESUME Command Examples Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Examples of resuming playback on specific channels and layers. ```casparcg >> RESUME 1 >> RESUME 1-1 ``` -------------------------------- ### CLEAR Command Examples Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Examples demonstrating how to clear a specific layer or an entire video channel. ```casparcg >> CLEAR 1 >> CLEAR 1-3 ``` -------------------------------- ### LOAD Command Examples Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Examples of using the LOAD command to load a clip to the foreground on a specified channel and layer. ```casparcg >> LOAD 1 MY_FILE >> LOAD 1-1 MY_FILE ``` -------------------------------- ### CALL Command Examples Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Examples of calling producer methods like LOOP or SEEK on specific channels and layers. ```casparcg >> CALL 1 LOOP >> CALL 1-2 SEEK 25 ``` -------------------------------- ### PLAY Command Examples Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Examples of using the PLAY command to move a clip to foreground, with or without preparing it via LOADBG first. ```casparcg >> PLAY 1 MY_FILE PUSH 20 EASEINSINE >> PLAY 1-1 MY_FILE SLIDE 10 LEFT >> PLAY 1-0 MY_FILE ``` -------------------------------- ### PAUSE Command Examples Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Examples of pausing playback on specific channels and layers. ```casparcg >> PAUSE 1 >> PAUSE 1-1 ``` -------------------------------- ### Install Configuration for Default Build CMake Command Source: https://github.com/casparcg/server/blob/master/src/shell/CMakeLists.txt Installs the 'casparcg.config' and 'run.sh' files to the root destination for a default, portable build. ```cmake install(FILES casparcg.config run.sh DESTINATION ".") ``` -------------------------------- ### STOP Command Examples Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Examples of stopping playback and removing clips from specific channels and layers. ```casparcg >> STOP 1 >> STOP 1-1 ``` -------------------------------- ### Set Start Point in Milliseconds with PLAY Command Source: https://github.com/casparcg/server/wiki/FFMPEG-Producer Introduced in CasparCG Server 2.1, the START parameter sets the initial playback point in milliseconds, used for looping. Supported for video files only. ```bash PLAY 1-1 MOVIE START 100 LOOP ``` -------------------------------- ### PLAY Command Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Moves a clip from background to foreground and starts playing it. Can execute a prepared transition and load additional parameters. ```APIDOC ## PLAY [video_channel:int]{-[layer:int]|-0} {[clip:string]} {"additional parameters"} Moves `clip` from background to foreground and starts playing it. If a transition (see `LOADBG`) is prepared, it will be executed. If additional parameters (see `LOADBG`) are provided then the provided clip will first be loaded to the background. Examples: ``` >> PLAY 1 MY_FILE PUSH 20 EASEINSINE >> PLAY 1-1 MY_FILE SLIDE 10 LEFT >> PLAY 1-0 MY_FILE ``` Note: See `LOADBG` for additional details. ``` -------------------------------- ### LOADBG Command Examples Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Demonstrates various ways to use the LOADBG command with different parameters like transition, tween, loop, seek, length, auto, and filter. ```casparcg >> LOADBG 1-1 MY_FILE PUSH 20 easeinesine LOOP SEEK 200 LENGTH 400 AUTO FILTER hflip >> LOADBG 1 MY_FILE PUSH 20 EASEINSINE >> LOADBG 1-1 MY_FILE SLIDE 10 LEFT >> LOADBG 1-0 MY_FILE ``` -------------------------------- ### Set Start Point with CALL Command Source: https://github.com/casparcg/server/wiki/FFMPEG-Producer Dynamically set the start point of a file, used for looping, via the CALL command. Supported for video files only. ```bash CALL 1-1 START 100 ``` -------------------------------- ### Install CasparCG Target CMake Command Source: https://github.com/casparcg/server/blob/master/src/shell/CMakeLists.txt Installs the CasparCG target. This command is used to install the built executable and associated configuration files. ```cmake install(TARGETS casparcg) ``` -------------------------------- ### PLAY Command Syntax Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Moves a clip from background to foreground and starts playing it. Can also load a clip to the background if additional parameters are provided. ```casparcg PLAY [video_channel:int]{-[layer:int]|-0} {[clip:string]} {"additional parameters"} ``` -------------------------------- ### Install Dependencies for CasparCG on Linux Source: https://github.com/casparcg/server/blob/master/BUILDING.md Installs the necessary system dependencies for building CasparCG Server on Ubuntu LTS. This includes adding a PPA for CEF development libraries. ```bash sudo ./tools/linux/install-dependencies ``` ```bash sudo add-apt-repository ppa:casparcg/ppa ``` ```bash sudo apt-get install casparcg-cef-142-dev ``` -------------------------------- ### Get Help Information Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Shows online help for a specific command or lists all available commands. Use `HELP [command]` for detailed command information. ```casparcg HELP ``` ```casparcg ...Shows a list of commands. ``` ```casparcg HELP PLAY ``` ```casparcg ...Shows a detailed description of the PLAY command. ``` -------------------------------- ### Build CasparCG Server on Windows Source: https://github.com/casparcg/server/blob/master/BUILDING.md Execute the Windows build script after cloning the repository and installing necessary prerequisites like Visual Studio 2022 and 7-zip. This script compiles the server and prepares a distributable zip file. ```bash .\tools\windows\build.bat ``` -------------------------------- ### Install Configuration for System Package Manager CMake Command Source: https://github.com/casparcg/server/blob/master/src/shell/CMakeLists.txt Installs the 'casparcg.config' file to a system-specific destination for builds intended for package managers. ```cmake install(FILES casparcg.config DESTINATION "share/${CASPARCG_BINARY_NAME}") ``` -------------------------------- ### Configure and Build CasparCG Server with CMake on Linux Source: https://github.com/casparcg/server/blob/master/BUILDING.md This sequence configures the build using CMake, specifying the source directory. It then proceeds to build the server, potentially in parallel for faster compilation, and installs it to a staging directory. ```bash mkdir build && cd build ``` ```bash cmake ../src ``` ```bash cmake --build . --parallel ``` ```bash cmake --install . --prefix staging ``` -------------------------------- ### Optional Expression Example: Default Integer Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Example of an optional expression for 'layer' that defaults to '-0' if not provided. ```casparcg {[layer:int]|-0} >> -2 << -2 >> << -0 ``` -------------------------------- ### Get Server Version Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Returns the version of a specified component or the entire server. If no component is specified, it returns the server version. ```casparcg VERSION ``` ```casparcg << 201 VERSION OK << 2.1.0.f207a33 STABLE ``` ```casparcg VERSION SERVER ``` ```casparcg << 201 VERSION OK << 2.1.0.f207a33 STABLE ``` ```casparcg VERSION FLASH ``` ```casparcg << 201 VERSION OK << 11.8.800.94 ``` ```casparcg VERSION TEMPLATEHOST ``` ```casparcg << 201 VERSION OK << unknown ``` ```casparcg VERSION CEF ``` ```casparcg << 201 VERSION OK << 3.1750.1805 ``` -------------------------------- ### Required Value Example: Signed Integer Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Example of a required value for 'video_channel', specifying it must be a signed integer. ```casparcg [video_channel:int] >> 1 << 1 ``` -------------------------------- ### Required Value Example: Transition Types Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Example of a required value for the 'transition' parameter, accepting 'CUT', 'MIX', 'PUSH', or 'WIPE'. ```casparcg [transition:CUT,MIX,PUSH,WIPE] >> CUT << CUT ``` -------------------------------- ### Get Media File Information Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Returns information about a media file. If files with the same name exist in multiple directories, all are returned. ```casparcg CINF [filename:string] ``` -------------------------------- ### List All Consumers with HELP CONSUMER Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Use this command to get a list of all available consumers in the CasparCG system. No specific consumer name is required. ```casparcg HELP CONSUMER ``` -------------------------------- ### Get Help for a Specific Consumer with HELP CONSUMER Source: https://github.com/casparcg/server/wiki/AMCP-Protocol To get detailed information about a particular consumer, specify its name after the HELP CONSUMER command. Ensure the consumer name is accurate. ```casparcg HELP CONSUMER Decklink Consumer ``` -------------------------------- ### Start FFMPEG Consumer Recording Source: https://github.com/casparcg/server/wiki/FFMPEG-Consumer Use this command to initiate recording a CasparCG Server channel to a file. The file extension determines the container format. FFmpeg filter chains can be used to specify encoding parameters. ```casparcg ADD 1-1 FILE myfile.mov -codec:v libx264 -codec:a aac -filter:v scale=width=1280:height=720:out_matrix=bt709:out_range=full,format=yuv420p,fps=50 ``` -------------------------------- ### Get Producer Help Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Shows online help for a specific producer or lists all available producers. Use `HELP PRODUCER [producer]` for detailed producer information. ```casparcg HELP PRODUCER ``` ```casparcg ...Shows a list of producers. ``` ```casparcg HELP PRODUCER FFmpeg Producer ``` ```casparcg ...Shows a detailed description of the FFmpeg Producer. ``` -------------------------------- ### Get Server Detailed Information Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Gets detailed information about all channels on the server. Provides a comprehensive overview of the server's state. ```casparcg INFO SERVER ``` -------------------------------- ### Get System Information Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Retrieves system information including OS, CPU details, and library version numbers. Useful for diagnosing performance issues. ```casparcg INFO SYSTEM ``` -------------------------------- ### Get CG Template Info Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Retrieves information about a template on the specified CG layer. If no layer is specified, it returns information about the template host. ```bash CG [video_channel:int]{-[layer:int]|-9999} INFO {[cg_layer:int]} ``` -------------------------------- ### Get Configuration Information Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Retrieves the contents of the current CasparCG configuration file. This is helpful for verifying server settings. ```casparcg INFO CONFIG ``` -------------------------------- ### Seek to a Specific Frame with PLAY Command Source: https://github.com/casparcg/server/wiki/FFMPEG-Producer The SEEK parameter allows playback to start at a specific frame. This is currently supported for video files only. ```bash PLAY 1-1 MOVIE SEEK 100 LOOP ``` -------------------------------- ### Set Minimum CMake Version and Project Name Source: https://github.com/casparcg/server/blob/master/src/shell/CMakeLists.txt Specifies the minimum required CMake version and defines the project name. This is a standard starting point for any CMake project. ```cmake cmake_minimum_required (VERSION 3.28) project (shell) ``` -------------------------------- ### Get Chroma Key Settings Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Retrieves the current chroma key settings for a specified video layer. This is useful for debugging or verifying current configurations. ```bash >> MIXER 1-1 CHROMA 0 << 202 MIXER OK << 1 120 0.1 0 0 0.1 0 1 0 ``` -------------------------------- ### Get Channel/Layer Delay Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Get the current delay on a specified channel or layer. Useful for synchronizing playback. ```casparcg INFO [video_channel:int]{-[layer:int]} DELAY ``` -------------------------------- ### Get Template Information Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Gets information about a specified template. This is useful for debugging or understanding template properties. ```casparcg INFO TEMPLATE [template:string] ``` -------------------------------- ### HELP Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Displays online help for commands or lists all available commands. ```APIDOC ## HELP ### Description Shows online help for a specific command or a list of all available commands. ### Syntax ``` HELP {[command:string]} ``` ### Parameters * **command** (string) - Optional. The name of the command to get help for. ### Examples ``` >> HELP ``` Shows a list of commands. ``` >> HELP PLAY ``` Shows a detailed description of the `PLAY` command. ``` -------------------------------- ### Optional Expression Example: Default String Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Example of an optional expression for 'tween' that defaults to an empty string if not provided. ```casparcg {[tween:string]} >> easeinsine << easeinsine >> << ``` -------------------------------- ### Route Layer to Destination - PLAY Command Source: https://github.com/casparcg/server/wiki/Route-Producer Use this command to route a source layer from a specific channel to a destination channel and layer. The `route://` prefix is optional but recommended. ```bash PLAY [destinationchannel:int]{-[destinationlayer:int]} [route://][sourcechannel:int]{-[sourcelayer:int]} ``` -------------------------------- ### VERSION Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Returns the version of a specified component or the server itself. ```APIDOC ## VERSION ### Description Returns the version of a specified component. If no component is specified, it returns the server version. ### Syntax ``` VERSION {[component:string]} ``` ### Parameters * **component** (string) - Optional. The component to get the version for (e.g., SERVER, FLASH, TEMPLATEHOST, CEF). ### Examples ``` >> VERSION << 201 VERSION OK << 2.1.0.f207a33 STABLE >> VERSION SERVER << 201 VERSION OK << 2.1.0.f207a33 STABLE >> VERSION FLASH << 201 VERSION OK << 11.8.800.94 >> VERSION TEMPLATEHOST << 201 VERSION OK << unknown >> VERSION CEF << 201 VERSION OK << 3.1750.1805 ``` ``` -------------------------------- ### Get Channel Information Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Retrieves a list of available channels, their resolutions, and playback status. Can also get information about a specific channel or layer. ```casparcg INFO ``` ```casparcg << 200 INFO OK << 1 720p5000 PLAYING << 2 PAL PLAYING ``` ```casparcg INFO [video_channel:int]{-[layer:int]} ``` -------------------------------- ### Get AMCP Command Queues Information Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Gets detailed information about all AMCP Command Queues. Useful for monitoring command processing and potential bottlenecks. ```casparcg INFO QUEUES ``` -------------------------------- ### LOAD Command Syntax Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Loads a clip to the foreground and plays its first frame before pausing. Replaces any currently playing clip on the target foreground. ```casparcg LOAD [video_channel:int]{-[layer:int]|-0} [clip:string] {"additional parameters"} ``` -------------------------------- ### Basic PLAY Command Source: https://github.com/casparcg/server/wiki/FFMPEG-Producer The general format for playing a resource using the PLAY command. The resource can be a filename or a URI for devices like cameras. ```bash PLAY - ... ``` -------------------------------- ### Play Image with Default Settings Source: https://github.com/casparcg/server/wiki/Image-Producer Use this command to play an image file with default settings. Ensure the image dimensions match the video format for optimal results. ```casparcg PLAY 1 cred_1080 SPEED 6 ``` -------------------------------- ### CLS Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Lists media files in the media folder, optionally within a specified sub-directory. ```APIDOC ## CLS ### Description Lists media files in the media folder. If an optional sub-directory is specified, only media files in that sub-directory will be returned. Use the `INFO PATHS` command to get the path to the media folder. ### Syntax ``` CLS {[sub_directory:string]} ``` ### Parameters * **sub_directory** (string) - Optional. The sub-directory to list media files from. ``` -------------------------------- ### LOAD Command Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Loads a clip to the foreground and plays the first frame before pausing. Replaces any currently playing clip on the target foreground. ```APIDOC ## LOAD [video_channel:int]{-[layer:int]|-0} [clip:string] {"additional parameters"} Loads a `clip` to the foreground and plays the first frame before pausing. If any clip is playing on the target foreground then this clip will be replaced. Examples: ``` >> LOAD 1 MY_FILE >> LOAD 1-1 MY_FILE ``` Note: See `LOADBG` for additional details. ``` -------------------------------- ### Get OpenGL Information Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Retrieves information about the allocated and pooled OpenGL resources. Useful for monitoring graphics performance. ```casparcg GL INFO ``` -------------------------------- ### Prepare Template for Display Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Prepares a template for displaying on a specified channel and layer. It will play automatically if play-on-load is set to 1. Data can be inline XML or a dataset reference. ```casparcg CG 1 ADD 10 svtnews/info 1 ``` -------------------------------- ### Load Background and Play Image Source: https://github.com/casparcg/server/wiki/Image-Producer If motion blur performance is a concern, use LOADBG in advance to prepare the image, then PLAY it when needed. This ensures timely playback. ```casparcg LOADBG 1 cred_1080 SPEED 12 PREMULTIPLY BLUR 4 PROGRESSIVE PLAY 1 ``` -------------------------------- ### CG ADD Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Prepares a template for displaying on a specified channel and layer. The template can be played immediately if the play-on-load flag is set to 1. Data can be provided inline or as a reference to a stored dataset. ```APIDOC ## CG ADD ### Description Prepares a template for displaying. It won't show until you call `CG PLAY` (unless you supply the play-on-load flag, 1 for true). Data is either inline XML or a reference to a saved dataset. ### Syntax ``` CG [video_channel:int]{-[layer:int]|-9999} ADD [cg_layer:int] [template:string] [play-on-load:0,1] {[data]} ``` ### Examples ``` >> CG 1 ADD 10 svtnews/info 1 ``` ``` -------------------------------- ### MIXER COMMIT Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Commits all deferred mixer transforms on the specified channel, ensuring all animations start at the same exact frame. ```APIDOC ## MIXER COMMIT ### Description Commits all deferred mixer transforms on the specified channel. This ensures that all animations start at the same exact frame. ### Method MIXER [video_channel:int] COMMIT ### Example ``` >> MIXER 1-1 FILL 0 0 0.5 0.5 25 DEFER >> MIXER 1-2 FILL 0.5 0 0.5 0.5 25 DEFER >> MIXER 1 COMMIT ``` ``` -------------------------------- ### Basic Commands Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Documentation for fundamental CasparCG Server commands. ```APIDOC ## Basic Commands * LOADBG * LOAD * PLAY * PAUSE * RESUME * STOP * CLEAR * CALL * SWAP * ADD * REMOVE * PRINT * LOG LEVEL * LOG CATEGORY * SET * LOCK ``` -------------------------------- ### LOADBG Command Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Loads a producer in the background, preparing it for playout. Supports looping, transitions, seeking, length, filters, and auto-play. ```APIDOC ## LOADBG [channel:int]{-[layer:int]} [clip:string] {[loop:LOOP]} {[transition:CUT,MIX,PUSH,WIPE,SLIDE] [duration:int] {[tween:string]|linear} {[direction:LEFT,RIGHT]|RIGHT}|CUT 0} {SEEK [frame:int]} {LENGTH [frames:int]} {FILTER [filter:string]} {[auto:AUTO]} Loads a producer in the background and prepares it for playout. If no layer is specified the default layer index will be used. `clip` will be parsed by available registered producer factories. If a successfully match is found, the producer will be loaded into the background. If a file with the same name (extension excluded) but with the additional postfix `_a` is found this file will be used as key for the main clip. `loop` will cause the clip to loop. When playing and looping the clip will start at `frame`. When playing and loop the clip will end after `frames` number of frames. `auto` will cause the clip to automatically start when foreground clip has ended (without play). The clip is considered "started" after the optional transition has ended. Examples: ``` >> LOADBG 1-1 MY_FILE PUSH 20 easeinesine LOOP SEEK 200 LENGTH 400 AUTO FILTER hflip >> LOADBG 1 MY_FILE PUSH 20 EASEINSINE >> LOADBG 1-1 MY_FILE SLIDE 10 LEFT >> LOADBG 1-0 MY_FILE >> PLAY 1-1 MY_FILE >> LOADBG 1-1 EMPTY MIX 20 AUTO ``` ``` -------------------------------- ### Get Path Information Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Retrieves information about the paths used by CasparCG Server, such as media, templates, and logs. Essential for managing file locations. ```casparcg INFO PATHS ``` -------------------------------- ### CINF Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Returns information about a media file, including all its locations if duplicates exist. ```APIDOC ## CINF ### Description Returns information about a media file. If files with the same name exist in multiple directories, all locations are returned. ### Syntax ``` CINF [filename:string] ``` ### Parameters * **filename** (string) - The name of the media file. ``` -------------------------------- ### LOADBG Command Syntax Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Loads a producer in the background for playout. Supports optional layer, loop, transition, duration, tween, direction, seek, length, filter, and auto parameters. ```casparcg LOADBG [channel:int]{-[layer:int]} [clip:string] {[loop:LOOP]} {[transition:CUT,MIX,PUSH,WIPE,SLIDE] [duration:int] {[tween:string]|linear} {[direction:LEFT,RIGHT]|RIGHT}|CUT 0} {SEEK [frame:int]} {LENGTH [frames:int]} {FILTER [filter:string]} {[auto:AUTO]} ``` -------------------------------- ### ADD Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Adds a consumer to a specified video channel. Consumers can be predefined types or specified by configuration. An optional consumer index can be provided for easier removal later. ```APIDOC ## ADD ### Description Adds a consumer to the specified video channel. The string consumer will be parsed by the available consumer factories. If a successful match is found a consumer will be created and added to the video_channel. Different consumers require different parameters, some examples are below. Consumers can alternatively be specified by adding them to the CasparCG config file. Specifying `consumer_index` overrides the index that the consumer itself decides and can later be used with the `REMOVE` command to remove the consumer. ### Syntax ``` ADD [video_channel:int]{-[consumer_index:int]} [consumer:string] [parameters:string] ``` ### Examples ``` >> ADD 1 DECKLINK 1 >> ADD 1 BLUEFISH 2 >> ADD 1 SCREEN >> ADD 1 AUDIO >> ADD 1 IMAGE filename >> ADD 2 SYNCTO 1 >> ADD 1 FILE filename.mov >> ADD 1 FILE filename.mov SEPARATE_KEY >> ADD 1-700 FILE filename.mov SEPARATE_KEY >> REMOVE 1-700 ``` ### Streaming Consumer Example The streaming consumer is an implementation of the ffmpeg_consumer and supports many of the same arguments: ``` >> ADD 1 STREAM udp://localhost:5004 -vcodec libx264 -tune zerolatency -preset ultrafast -crf 25 -format mpegts -vf scale=240:180 ``` ``` -------------------------------- ### Set Channel Variable Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Changes the value of a channel variable. Examples show changing the video mode to PAL and the audio channel layout to smpte. ```casparcg SET 1 MODE PAL ``` ```casparcg SET 1 CHANNEL_LAYOUT smpte ``` -------------------------------- ### Enable/Disable Logging Category Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Enables or disables specific logging categories. Use '1' to enable and '0' to disable. Example shows enabling 'calltrace'. ```casparcg LOG CATEGORY calltrace 1 ``` ```casparcg LOG CATEGORY calltrace 0 ``` -------------------------------- ### List Template Files Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Lists template files in the templates folder. Optionally specify a sub-directory to filter results. Use 'INFO PATHS' to find the templates folder location. ```casparcg TLS {[sub_directory:string]} ``` -------------------------------- ### Route Source Channel - PLAY Command Source: https://github.com/casparcg/server/wiki/Route-Producer This command routes the entire source channel through to a specified destination channel and layer. The `route://` prefix is required here. ```bash PLAY [sourcechannel:int]{-[sourcelayer:int]} [route://[destinationchannel:int]] ``` -------------------------------- ### Get Current Layer Clipping Rectangle Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Retrieves the current clipping rectangle values for a specified layer. This command returns the active clipping parameters. ```casparcg MIXER 1-0 CLIP ``` -------------------------------- ### Get Current Layer Fill Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Retrieves the current fill and position values for a specified layer. This command returns the active scaling and positioning parameters. ```casparcg MIXER 1-0 FILL ``` -------------------------------- ### Remove Consumer from Video Channel Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Removes a consumer from a specified video channel. Can be identified by index or parameters. The example shows removing a consumer with a specific index. ```casparcg REMOVE 1 DECKLINK 1 ``` ```casparcg REMOVE 1 BLUEFISH 2 ``` ```casparcg REMOVE 1 SCREEN ``` ```casparcg REMOVE 1 AUDIO ``` ```casparcg REMOVE 1-300 ``` -------------------------------- ### CHANNEL_GRID Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Opens a new channel displaying a grid of all existing channels' contents. ```APIDOC ## CHANNEL_GRID ### Description Opens a new channel and displays a grid with the contents of all the existing channels. ### Syntax ``` CHANNEL_GRID ``` ### Requirements The element `true` must be present in `casparcg.config` for this command to function. ``` -------------------------------- ### Get Current Layer Anchor Point Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Retrieves the current anchor point values for a specified layer. This command returns the active anchor point coordinates. ```casparcg MIXER 1-10 ANCHOR ``` -------------------------------- ### PRINT Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Saves an RGBA PNG bitmap still image of the current contents of a specified channel to the media folder. ```APIDOC ## PRINT ### Description Saves an RGBA PNG bitmap still image of the contents of the specified channel in the media folder. ### Syntax ``` PRINT [video_channel:int] ``` ### Examples ``` >> PRINT 1 ``` ...will produce a PNG image with the current date and time as the filename for example 20130620T192220.png ``` -------------------------------- ### Play CG Template Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Plays and displays a template in the specified CG layer on a video channel. Use this to show a template on screen. ```bash CG 1 PLAY 0 ``` -------------------------------- ### Commit Deferred Mixer Transforms Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Commits all deferred mixer transforms on the specified channel, ensuring animations start simultaneously. This is useful after applying multiple DEFER commands. ```casparcg >> MIXER 1-1 FILL 0 0 0.5 0.5 25 DEFER >> MIXER 1-2 FILL 0.5 0 0.5 0.5 25 DEFER >> MIXER 1 COMMIT ``` -------------------------------- ### Enable Looping with PLAY Command Source: https://github.com/casparcg/server/wiki/FFMPEG-Producer Use the LOOP parameter with PLAY to make the media file loop automatically. This is useful for background or continuous playback. ```bash PLAY 1-1 MOVIE LOOP ``` -------------------------------- ### Configure Decklink Consumer Source: https://github.com/casparcg/server/wiki/Decklink-Consumer Add this node to your casparcg.config file to enable the Decklink consumer for video output. ```xml ``` -------------------------------- ### CasparCG Template to Server Log Flow Source: https://github.com/casparcg/server/wiki/Flash-Producer Demonstrates the data flow when a template writes data to the CasparCG log file using the TraceToLog function. This involves the template, TemplateHost, and the CasparCG Server. ```text Template TraceToLog function --CasparTemplateEvent --> TemplateHost --ExternalInterface--> Server --> CasparCG Server log ``` -------------------------------- ### Enable Chroma Keying Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Enables chroma keying on a specified video layer with detailed HSB/HSV color space parameters. Use this to key out specific colors like green or blue. ```bash >> MIXER 1-1 CHROMA 1 120 0.1 0 0 0.1 0.1 0.7 0 ``` -------------------------------- ### Adjust Layer Video Levels Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Adjusts the video levels of a layer by defining input and output ranges and gamma. If no arguments are given, the current levels are returned. Examples show stretching video and adjusting gamma. ```amcp >> MIXER 1-10 LEVELS 0.0627 0.922 1 0 1 25 easeinsine ``` ```amcp >> MIXER 1-10 LEVELS 0 1 1 0.0627 0.922 25 easeinsine ``` ```amcp >> MIXER 1-10 LEVELS 0 1 0.5 0 1 25 easeinsine ``` ```amcp >> MIXER 1-10 LEVELS ``` ```amcp << 201 MIXER OK << 0 1 0.5 0 1 ``` -------------------------------- ### Define Source and Header Files Source: https://github.com/casparcg/server/blob/master/src/shell/CMakeLists.txt Lists the source and header files for the CasparCG executable. This includes core files and platform-specific files. ```cmake set(SOURCES casparcg.config main.cpp server.cpp ) set(HEADERS platform_specific.h server.h ) ``` -------------------------------- ### Set Include Directories for CasparCG Source: https://github.com/casparcg/server/blob/master/src/shell/CMakeLists.txt Configures the include directories for the CasparCG executable. Includes the parent directory and Boost include paths. ```cmake target_include_directories(casparcg PRIVATE .. ${BOOST_INCLUDE_PATH} ) ``` -------------------------------- ### Generate Color on Specific Layer - AMCP Source: https://github.com/casparcg/server/wiki/Color-Producer To produce color on a specific layer within a channel, append the layer number to the channel using a hyphen. This example sets a full field white on layer 2 of channel 1. ```bash PLAY 1-2 #FFFFFF ``` -------------------------------- ### Open Channel Grid Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Opens a new channel displaying a grid of all existing channels' contents. Requires `true` in casparcg.config. ```casparcg CHANNEL_GRID ``` -------------------------------- ### CALL Command Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Calls a method on the specified producer with a provided parameter string. ```APIDOC ## CALL [video_channel:int]{-[layer:int]|-0} [param:string] Calls method on the specified producer with the provided param string. Examples: ``` >> CALL 1 LOOP >> CALL 1-2 SEEK 25 ``` ``` -------------------------------- ### List Font Files Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Lists all font files in the fonts folder. The output includes the font name and its path. Use 'INFO PATHS' to find the fonts folder location. ```casparcg FLS ``` -------------------------------- ### Create Layer Grid Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Creates a grid of video layers in ascending order of layer index. The resolution determines the grid dimensions (e.g., 2 for a 2x2 grid). ```casparcg >> MIXER 1 GRID 2 ``` -------------------------------- ### CALL Command Syntax Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Calls a method on a specified producer with a given parameter string. Used for advanced producer control. ```casparcg CALL [video_channel:int]{-[layer:int]|-0} [param:string] ``` -------------------------------- ### HELP PRODUCER Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Displays online help for producers or lists all available producers. ```APIDOC ## HELP PRODUCER ### Description Shows online help for a specific producer or a list of all producers. ### Syntax ``` HELP PRODUCER {[producer:string]} ``` ### Parameters * **producer** (string) - Optional. The name of the producer to get help for. ### Examples ``` >> HELP PRODUCER ``` Shows a list of producers. ``` >> HELP PRODUCER FFmpeg Producer ``` Shows a detailed description of the FFmpeg Producer. ``` -------------------------------- ### INFO Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Retrieves various types of information about the server, channels, templates, and system. ```APIDOC ## INFO ### Description Retrieves various types of information from the CasparCG Server. ### Commands * **INFO**: Retrieves a list of available channels. * **Syntax**: `INFO` * **Example Response**: ``` << 200 INFO OK << 1 720p5000 PLAYING << 2 PAL PLAYING ``` * **INFO [video_channel:int]{-[layer:int]}**: Gets information about a channel or a specific layer on a channel. If the layer is omitted, information about the whole channel is returned. * **Syntax**: `INFO [video_channel:int]{-[layer:int]}` * **INFO TEMPLATE [template:string]**: Gets information about the specified template. * **Syntax**: `INFO TEMPLATE [template:string]` * **INFO CONFIG**: Gets the contents of the configuration used. * **Syntax**: `INFO CONFIG` * **INFO PATHS**: Gets information about the paths used by the server. * **Syntax**: `INFO PATHS` * **INFO SYSTEM**: Gets system information like OS, CPU, and library version numbers. * **Syntax**: `INFO SYSTEM` * **INFO SERVER**: Gets detailed information about all channels. * **Syntax**: `INFO SERVER` * **INFO QUEUES**: Gets detailed information about all AMCP Command Queues. * **Syntax**: `INFO QUEUES` * **INFO THREADS**: Lists all known threads in the server. * **Syntax**: `INFO THREADS` * **INFO [video_channel:int]{-[layer:int]} DELAY**: Get the current delay on the specified channel or layer. * **Syntax**: `INFO [video_channel:int]{-[layer:int]} DELAY` ``` -------------------------------- ### List Media Files Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Lists media files in the media folder. Optionally specify a sub-directory to filter results. Use 'INFO PATHS' to find the media folder location. ```casparcg CLS {[sub_directory:string]} ``` -------------------------------- ### Configure Screen Consumer Source: https://github.com/casparcg/server/wiki/Screen-Consumer Add this node to your casparcg.config file to enable the Screen Consumer. Ensure the XML is correctly placed within the main configuration structure. ```xml ``` -------------------------------- ### Take Channel Snapshot as PNG Source: https://github.com/casparcg/server/wiki/Image-Consumer Use this command to capture a channel's current frame and save it as a PNG image. Do not include the file extension in the filename. ```CasparCG Command ADD IMAGE ``` -------------------------------- ### Image Scroll with Premultiply Source: https://github.com/casparcg/server/wiki/Image-Producer Premultiplies images with a straight alpha channel against black. This is necessary for correct rendering when images have alpha channels. ```casparcg PLAY 1-2 test_scroll PREMULTIPLY ``` -------------------------------- ### TLS Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Lists template files in the templates folder, optionally within a specified sub-directory. ```APIDOC ## TLS ### Description Lists template files in the templates folder. If an optional sub-directory is specified, only template files in that sub-directory will be returned. Use the `INFO PATHS` command to get the path to the templates folder. ### Syntax ``` TLS {[sub_directory:string]} ``` ### Parameters * **sub_directory** (string) - Optional. The sub-directory to list template files from. ``` -------------------------------- ### CasparCG Server to Template Data Flow Source: https://github.com/casparcg/server/wiki/Flash-Producer Illustrates the data flow for the SetData command from the CasparCG Server to a template. This involves the External Interface, TemplateHost, and ExternalCommandsBuffer. ```text Server --ExternalInterface--> TemplateHost --SetDataCommand instance --> ExternalCommandsBuffer --> template SetData function ``` -------------------------------- ### Deprecated Chroma Keying (Legacy) Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Uses deprecated syntax for enabling or disabling chroma keying with simpler color presets and parameters. Use with caution as it may be removed in future versions. ```bash >> MIXER 1-1 CHROMA green 0.10 0.20 1.0 25 easeinsine ``` ```bash >> MIXER 1-1 CHROMA none ``` -------------------------------- ### Configure HTML Module Project Source: https://github.com/casparcg/server/blob/master/src/modules/html/CMakeLists.txt Defines the HTML module project, specifying source files, initialization and uninitialization functions, and command-line interceptors. This is essential for building the HTML module as part of the CasparCG server. ```cmake cmake_minimum_required (VERSION 3.28) project (html) set(SOURCES producer/html_cg_proxy.cpp producer/html_cg_proxy.h producer/html_producer.cpp producer/html_producer.h html.cpp html.h util.h ) casparcg_add_module_project(html SOURCES ${SOURCES} INIT_FUNCTION "html::init" UNINIT_FUNCTION "html::uninit" CLI_INTERCEPTOR "html::intercept_command_line" ) target_link_libraries(html PRIVATE ffmpeg CEF::CEF) target_include_directories(html PRIVATE .. ${FFMPEG_INCLUDE_PATH} ) set_target_properties(html PROPERTIES FOLDER modules) source_group(sources\producer producer/*) source_group(sources ./*) ``` -------------------------------- ### List Thumbnails Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Lists available thumbnails. Optionally specify a sub-directory to filter the results. The output includes the thumbnail name, timestamp, and size. ```casparcg THUMBNAIL LIST ``` ```casparcg << 200 THUMBNAIL LIST OK << "AMB" 20130301T124409 1149 << "foo/bar" 20130523T234001 244 ``` -------------------------------- ### Thumbnail Commands Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Commands related to generating and managing thumbnails for media files. ```APIDOC ## Thumbnail Commands * THUMBNAIL LIST * THUMBNAIL RETRIEVE * THUMBNAIL GENERATE * THUMBNAIL GENERATE_ALL ``` -------------------------------- ### Copy Debug Runtime Dependencies (Single-Config MSVC) Source: https://github.com/casparcg/server/blob/master/src/shell/CMakeLists.txt Custom build command to copy debug runtime dependencies for single-configuration MSVC builds. This command is executed post-build. ```cmake get_filename_component(FOLDER_NAME "${FILE_TO_COPY}" NAME) add_custom_command( TARGET casparcg_copy_dependencies POST_BUILD COMMAND echo "Copy Debug ${FILE_TO_COPY}" && ${CMAKE_COMMAND} -E copy_directory "${FILE_TO_COPY}" "${OUTPUT_FOLDER}/${FOLDER_NAME}/" && ${CMAKE_COMMAND} -E copy_directory "${FILE_TO_COPY}" "${CMAKE_CURRENT_BINARY_DIR}/${FOLDER_NAME}/" ) endforeach(FILE_TO_COPY) endif () ``` -------------------------------- ### GL INFO Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Retrieves information about the allocated and pooled OpenGL resources. ```APIDOC ## GL INFO ### Description Retrieves information about the allocated and pooled OpenGL resources. ### Syntax ``` GL INFO ``` ``` -------------------------------- ### THUMBNAIL GENERATE_ALL Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Regenerates all thumbnails on the server. ```APIDOC ## THUMBNAIL GENERATE_ALL ### Description Regenerates all thumbnails. ### Syntax ``` THUMBNAIL GENERATE_ALL ``` ``` -------------------------------- ### FLS Source: https://github.com/casparcg/server/wiki/AMCP-Protocol Lists all font files in the fonts folder. ```APIDOC ## FLS ### Description Lists all font files in the fonts folder. Use the `INFO PATHS` command to get the path to the fonts folder. ### Syntax ``` FLS ``` ### Response Columns Columns are in order from left to right: Font name and font path. ```