PHPackages                             cosmonova-rnd/caspar-cg - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. cosmonova-rnd/caspar-cg

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cosmonova-rnd/caspar-cg
=======================

CasparCG PHP Library

v2.0.1(9mo ago)81853[2 issues](https://github.com/CosmonovaRnD/CasparCG/issues)MITPHPPHP &gt;=7.0

Since Nov 16Pushed 9mo ago3 watchersCompare

[ Source](https://github.com/CosmonovaRnD/CasparCG)[ Packagist](https://packagist.org/packages/cosmonova-rnd/caspar-cg)[ RSS](/packages/cosmonova-rnd-caspar-cg/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)DependenciesVersions (5)Used By (0)

CasparCG PHP Library
====================

[](#casparcg-php-library)

Is an implementation of CasparCG 2.0 AMCP Protocol and OSC Protocol

Requirements
------------

[](#requirements)

- CasparCG v2.0.7|v2.3.0
- PHP 7.0

Installation
------------

[](#installation)

Install using Composer

> php composer.phar require cosmonova-rnd/caspar-cg

Usage
-----

[](#usage)

#### AMCP

[](#amcp)

The easiest way to use AMCP protocol is to send handwritten command through Caspar CG connection

```
$client = new \CosmonovaRnD\CasparCG\Client();

$response = $client->send('play 1-1 test');

if($response->success()) {
    echo 'OK';
} else {
    echo 'Failed';
}
```

But you can use one of existing command builders.

For example, we want to send play content 'test' on channel 1 and layer 10 in loop

```
$client = new \CosmonovaRnD\CasparCG\Client();

$playCmdBuilder = new \CosmonovaRnD\CasparCG\Command\Basic\Builder\PlayBuilder();
$playCmdBuilder->channel(1);
$playCmdBuilder->layer(10);
$playCmdBuilder->clip('test');
$playCmdBuilder->loop();

$response = $client->send($playCmdBuilder->build());

if($response->success()) {
    echo 'OK';
} else {
    echo 'Failed';
}
```

#### OSC

[](#osc)

OSC works over the UDP protocol.

I'll try to show how to catch messages in small simple example

```
$server = new \CosmonovaRnD\CasparCG\Server('127.0.0.1', 6250);
$server->start();

$parser     = new \CosmonovaRnD\CasparCG\OSC\Parser();

// You can use simple built-in event manager to handle messages
$eventManager = new \CosmonovaRnD\CasparCG\EventManager();

$listener = new MyTestFrameMsgListener(); // Must implement \CosmonovaRnD\CasparCG\ListenerInterface

// Listen all \CosmonovaRnD\CasparCG\OSC\Message\Producer\FFmpeg\Frame messages
$eventManager->listen(\CosmonovaRnD\CasparCG\OSC\Message\Producer\FFmpeg\Frame::class, $listener);

while (false !== $msg = $server->read()) {
    $rawMsg = $parser->parse($msg);

    if ($rawMsg instanceof Bundle) {
        foreach ($rawMsg->getMessages() as $bundleMsg) {
            \CosmonovaRnD\CasparCG\OSC\Message\Producer\FFmpeg\Frame::create($bundleMsg, $eventManager);
        }
    } else {
        \CosmonovaRnD\CasparCG\OSC\Message\Producer\FFmpeg\Frame::create($rawMsg, $eventManager);
    }
}

$server->stop();
```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance53

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~942 days

Total

4

Last Release

274d ago

Major Versions

v0.3.1 → v1.0.02018-02-22

v1.0.0 → v2.0.02021-08-31

PHP version history (2 changes)v0.3.1PHP ^7.0

v2.0.0PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f8e54a75fa87d5f2a023bdc7e9c6f451353086f2e310eb249197a9aae4c6c905?d=identicon)[Besedin86](/maintainers/Besedin86)

---

Top Contributors

[![BesedinSasha](https://avatars.githubusercontent.com/u/2121842?v=4)](https://github.com/BesedinSasha "BesedinSasha (1 commits)")[![Thiritin](https://avatars.githubusercontent.com/u/6755282?v=4)](https://github.com/Thiritin "Thiritin (1 commits)")

---

Tags

amcpcasparcgoscplayout

### Embed Badge

![Health badge](/badges/cosmonova-rnd-caspar-cg/health.svg)

```
[![Health](https://phpackages.com/badges/cosmonova-rnd-caspar-cg/health.svg)](https://phpackages.com/packages/cosmonova-rnd-caspar-cg)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
