Work in progress

The Advanced Media Control Protocol (AMCP) is the core communication method used by CasparCG to control media playback, graphics, and other functionalities. Mastering AMCP commands can significantly enhance your ability to manage and automate tasks in CasparCG. In this comprehensive guide, we'll cover all the different AMCP commands, providing you with the knowledge to leverage the full potential of CasparCG.


What is AMCP?

AMCP is a text-based protocol that allows clients to send commands to the CasparCG Server. These commands control various aspects of media and graphics playout, enabling precise and dynamic broadcast operations.

Basic Media Commands:

PLAY:

PLAY [channel]-[layer] [clipname] [loop] [transition] [transition_duration] [auto]

Example: PLAY 1-1 example.mp4

Description: Plays a specified media clip on a given channel and layer.

STOP:

STOP [channel]-[layer]

Example: STOP 1-1

Description: Stops playback on the specified channel and layer.

LOAD:

LOAD [channel]-[layer] [clipname]

Example: LOAD 1-1 example.mp4

Description: Loads a media clip into the specified channel and layer without playing it.

LOADBG:

LOADBG [channel]-[layer] [clipname] [loop] [transition] [transition_duration] [auto]

Example: LOADBG 1-1 example.mp4 AUTO

Description: Loads a media clip into the background, ready to be played when the current clip finishes.

Graphics Commands:

CG ADD:

CG [channel]-[layer] ADD [cg-layer] [template] [play-on-load] [data]

Example: CG 1-1 ADD 0 example_template 1 "data"

Description: Adds a graphic template to the specified channel and layer.

CG PLAY:

CG [channel]-[layer] PLAY [cg-layer]

Example: CG 1-1 PLAY 0

Description: Plays the specified graphic template layer.

CG STOP:

CG [channel]-[layer] STOP [cg-layer]

Example: CG 1-1 STOP 0

Description: Stops the specified graphic template layer.

CG UPDATE:

CG [channel]-[layer] UPDATE [cg-layer] [data]

Example: CG 1-1 UPDATE 0 "data"

Description: Updates the specified graphic template with new data.

CG REMOVE:

CG [channel]-[layer] REMOVE [cg-layer]

Example: CG 1-1 REMOVE 0

Description: Removes the specified graphic template layer.

Mixer Commands:

MIXER FILL:

MIXER [channel]-[layer] FILL [x] [y] [x-scale] [y-scale] [transition] [transition_duration]

Example: MIXER 1-1 FILL 0 0 0.5 0.5

Description: Adjusts the fill (position and scale) of the specified layer.

MIXER OPACITY:

MIXER [channel]-[layer] OPACITY [value] [transition] [transition_duration]

Example: MIXER 1-1 OPACITY 0.5

Description: Sets the opacity of the specified layer.

MIXER BRIGHTNESS:

MIXER [channel]-[layer] BRIGHTNESS [value] [transition] [transition_duration]

Example: MIXER 1-1 BRIGHTNESS 1.2

Description: Adjusts the brightness of the specified layer.

MIXER CONTRAST:

MIXER [channel]-[layer] CONTRAST [value] [transition] [transition_duration]

Example: MIXER 1-1 CONTRAST 1.5

Description: Adjusts the contrast of the specified layer.

MIXER SATURATION:

MIXER [channel]-[layer] SATURATION [value] [transition] [transition_duration]

Example: MIXER 1-1 SATURATION 1.3

Description: Adjusts the saturation of the specified layer.

MIXER ROTATION:

MIXER [channel]-[layer] ROTATION [value] [transition] [transition_duration]

Example: MIXER 1-1 ROTATION 45

Description: Rotates the specified layer by the given angle.

Channel and Layer Management:

CLEAR:

CLEAR [channel]

Example: CLEAR 1

Description: Clears all layers on the specified channel.

CALL:

CALL [channel]-[layer]

Example: CALL 1-1

Description: Retrieves the state of the specified channel and layer.

SWAP:

SWAP [channel]-[layer1] [layer2]

Example: SWAP 1-1 1-2

Description: Swaps the content of two layers on the specified channel.

Server Commands:

INFO:

INFO

Description: Retrieves information about the server, including version, channels, and current status.

DIAG:

DIAG

Description: Runs a diagnostic on the server and returns the results.

GL INFO:

GL INFO

Description: Retrieves information about the OpenGL status on the server.

Template Commands:

TEMPLATE LIST:

TEMPLATE LIST

Description: Lists all available templates on the server.

TEMPLATE INFO:

TEMPLATE INFO [template]

Example: TEMPLATE INFO example_template

Description: Retrieves information about the specified template.

Data Commands:

DATA STORE:

DATA STORE [key] [value]

Example: DATA STORE example_key "example_value"

Description: Stores a key-value pair in the server's data store.

DATA RETRIEVE:

DATA RETRIEVE [key]

Example: DATA RETRIEVE example_key

Description: Retrieves the value for the specified key from the server's data store.

DATA LIST:

DATA LIST

Description: Lists all key-value pairs in the server's data store.

DATA REMOVE:

DATA REMOVE [key]

Example: DATA REMOVE example_key

Description: Removes the specified key-value pair from the server's data store.

Conclusion:

Understanding and utilizing AMCP commands is essential for maximizing the potential of CasparCG. These commands provide granular control over media playback, graphics, and server functions, enabling you to create dynamic and professional broadcasts. With this comprehensive guide, you are now equipped to master CasparCG and elevate your broadcasting capabilities. Stay tuned for more in-depth tutorials and tips on leveraging CasparCG for your production needs.