It is currently 28 Jun 2017, 13:22



casparcg-connection: Node.js Javascript library

CasparCG Server, Client and development

Moderators: Macey, Jonas Hummelstrand, didikunz

casparcg-connection: Node.js Javascript library

Postby Jesper Stærkær » 09 Sep 2016, 16:03

SuperFly.tv presents to the community its first Open Source library: casparcg-connection. The CasparCG project has been a corner stone to our company, and we want to contribute by giving back to the community, starting with this Node.js library.

We want to help developers build as good solutions as possible, spending most time inventing cool features, not solving the same basic tasks over and over again. A first step is helping Node.js developers connect and control the CasparCG Server in a stable and efficient way.

Github: https://github.com/SuperFlyTV/casparcg-connection
NPM: https://www.npmjs.com/package/casparcg-connection
API docs: https://superflytv.github.io/casparcg-connection/
Wiki (TBA): https://github.com/SuperFlyTV/casparcg-connection/wiki

Highlights
  • TypeScript source code with ES5 or ES6 targets.
  • npm distribution.
  • TypeDoc API documentation.
  • AMCP 2.1 Feature parity.
  • MIT license, can be used commercially.

TBA:
  • Parsing of response data to objects.
  • JSON/XML TemplateData.
  • Jasmine test for connection features.
  • Full Jasmine suite for live-testing all commands with various parameters against CasparCG. This helps detect breaking changes or bug in new CasparCG Server builds.
  • OSC Event parsing.
Jesper Stærkær
Independent Consultant at SuperFly.tv
User avatar
Jesper Stærkær
 
Posts: 853
Joined: 13 Apr 2010, 18:06
Location: Trondheim, Norway

Status 1

Postby Jesper Stærkær » 09 Sep 2016, 16:06

Finally! We’ve spent 10 months on this project, with this Open Source launch in mind all the time.
There’s still a tonne of stuff to implement and do.

IMPORTANT: We do NOT recommend using this library in real productions until Version 1.0. Things might change and break.

But please, try it! Clone it, fork it, test it, break it, criticise it, improve it, spread it. We need feedback, ideas and help.

My priority for development at the moment is:
  • Implement the last few AMCP commands.
  • Better handling of TemplateData and smarter paramters for some commands.
  • Proper handling of responses and parsing return data from Server.
  • More API documentation of critical objects.
  • Instructions, Descriptions and tutorials for the Wiki.
  • Tests for the connection features.
  • Tests for all commands.
  • OSC event parsing.

This library is inspired by the first Node.js library from respectthecode and the original AS3.0 library by Andras from SVT.


The entire SuperFly.tv team will be at IBC 2016 Saturday-Monday. See some of you guys there.
Jesper Stærkær
Independent Consultant at SuperFly.tv
User avatar
Jesper Stærkær
 
Posts: 853
Joined: 13 Apr 2010, 18:06
Location: Trondheim, Norway

Re: CasparCG-Connection: Node.js Javascript library

Postby Jonas Hummelstrand » 09 Sep 2016, 16:10

Looking forward to hearing what the community thinks about it!
Jonas Hummelstrand
Independent Consultant at SuperFly.tv
Former Community Manager for CasparCG

Problems? Guide to posting Bug reports & Feature requests
User avatar
Jonas Hummelstrand
 
Posts: 2538
Joined: 21 Apr 2009, 08:07
Location: Stockholm, Sweden

Re: CasparCG-Connection: Node.js Javascript library

Postby Armin Hafizovic » 09 Sep 2016, 16:54

Congratulation to all of you at SuperFly.tv! :)
Armin Hafizovic
CasparCG Client Lead developer at SVT
User avatar
Armin Hafizovic
 
Posts: 31
Joined: 06 Feb 2013, 10:22

Re: CasparCG-Connection: Node.js Javascript library

Postby emisiona » 09 Sep 2016, 18:43

This is so cool! Jasmine test and OSC event parsing, will be neat to have it!

I'm sure this will encourage a lot of people to build cross-platform clients based on nodejs/node webkit.

Will test it soon. THANKS GUYS!
User avatar
emisiona
 
Posts: 137
Joined: 27 Jun 2014, 09:45
Location: Barcelona

Re: CasparCG-Connection: Node.js Javascript library

Postby Jesper Stærkær » 09 Sep 2016, 18:55

We still have a long way to go ...
Jesper Stærkær
Independent Consultant at SuperFly.tv
User avatar
Jesper Stærkær
 
Posts: 853
Joined: 13 Apr 2010, 18:06
Location: Trondheim, Norway

Re: CasparCG-Connection: Node.js Javascript library

Postby itod » 10 Sep 2016, 22:05

Great work! Looking forward to try it!
itod
 
Posts: 105
Joined: 29 Oct 2011, 20:54

Status 2

Postby Jesper Stærkær » 15 Sep 2016, 12:51

A week has gone by, and it is time for some updates.

  • We see quite a lot of traffic, but not much of comments at the time. Please provide feedback to steer our development in the right direction.
  • I guess docs/how-tos is a pressing issue. It's a bit on hold as long as fundamental things still are changing.
  • The great Balte from the forum is developing OSC-implementation at full speed! It is super cool to have a contributor, and Balte does a killer implementation. Thanks.
  • At the moment I'm working on parsing response data and handling chained commands (using promises). It will be really powerful for querying state etc.
Jesper Stærkær
Independent Consultant at SuperFly.tv
User avatar
Jesper Stærkær
 
Posts: 853
Joined: 13 Apr 2010, 18:06
Location: Trondheim, Norway

Re: License changed

Postby Jesper Stærkær » 21 Dec 2016, 23:34

casparcg-connection has changed license from GPL-3.0 in version 0.12.1 to MIT in version 0.13.0

What
The project is still fully open-sourced, but we have changed from a Copyleft license to a Permissive license. In short: you can now use the project without any restrictions, even commercially and bundled together with closed-sourced projects.

Why
We strongly believe that a Permissive license is the best fit for this kind of library. It should be allowed to freely use this library in any kind of projects and environments. That freedom will help kickstart new CasparCG-based projects, and that's the ultimate end-goal. It makes sense to license CasparCG Server under GPL, as it is distributed and used as a standalone product by the end users. However, a library such as this project, needs to be able to tie into and co-exist in various environments, even closed-sourced ones. Therefore it needs to be licensed freely, and we think all will benefit from this.

How
- All code up until 0.12.1 is still GPL-3.0.
- All existing history, releases and distributions remain as they are.
- From 0.13.0 the Master branch and all following releases and distributions will be MIT.
Jesper Stærkær
Independent Consultant at SuperFly.tv
User avatar
Jesper Stærkær
 
Posts: 853
Joined: 13 Apr 2010, 18:06
Location: Trondheim, Norway

Status 3

Postby Jesper Stærkær » 21 Dec 2016, 23:43

Config parsing!

- Parse config from INFO CONFIG.
- Export the CasparCGConfig-object to XML
- Cross-convert between 2.0.7 and 2.1.0 configurations, with 100% compability and fallbacks.
- Create new CasparCG configurations with CasparCGConfig

State promises
- casparcg-connection can automatically (configurable) query the server on its version upon (re)connection, available on the public serverVersion property.
- A highlevel INFO PATHS-object will be lazy-cached and is exposed as a public promise.
- A highlevel INFO CONFIG-object will be lazy-cached and is exposed as a public promise.
Jesper Stærkær
Independent Consultant at SuperFly.tv
User avatar
Jesper Stærkær
 
Posts: 853
Joined: 13 Apr 2010, 18:06
Location: Trondheim, Norway

Channel format parsing

Postby Jesper Stærkær » 27 Jan 2017, 13:39

Channel format parsing

Sending an INFO command now returns channel format information like this

Code: Select all
[
    {
        "channel": 1,
        "channelRate": 50,
        "format": "1080i5000",
        "frameRate": 25,
        "interlaced": true
    },
    {
        "channel": 2,
        "channelRate": 50,
        "format": "pal",
        "frameRate": 25,
        "interlaced": true
    },
    {
        "channel": 3,
        "channelRate": 59.94005994005994,
        "format": "ntsc",
        "frameRate": 29.97002997002997,
        "interlaced": true
    },
    {
        "channel": 4,
        "channelRate": 59.94005994005994,
        "format": "1080i5994",
        "frameRate": 29.97002997002997,
        "interlaced": true
    },
    {
        "channel": 5,
        "channelRate": 29.97,
        "format": "1080p2997",
        "frameRate": 29.97,
        "interlaced": false
    },
    {
        "channel": 6,
        "channelRate": 50,
        "format": "1080p5000",
        "frameRate": 50,
        "interlaced": false
    },
    {
        "channel": 7,
        "channelRate": 25,
        "format": "1080p2500",
        "frameRate": 25,
        "interlaced": false
    },
    {
        "channel": 8,
        "channelRate": 23.98,
        "format": "1080p2398",
        "frameRate": 23.98,
        "interlaced": false
    }
]
Jesper Stærkær
Independent Consultant at SuperFly.tv
User avatar
Jesper Stærkær
 
Posts: 853
Joined: 13 Apr 2010, 18:06
Location: Trondheim, Norway

Re: CasparCG-Connection: Node.js Javascript library

Postby fredericbrandt » 03 Feb 2017, 11:12

Hi !
First thank you for sharing this library, it's really well made and very cool. But I have a little question, when using cgUpdate, it seems that i could pass an object as templateData, but when I pass an object as key values pairs, it just send plain JSON to CasparCG. I thought that the library would parse it to XML for CasparCG, but it doesn't. I'm probably missing something, like the fact that maybe it is the flash scene role to interpret the JSON, I don't know...
User avatar
fredericbrandt
 
Posts: 36
Joined: 12 Dec 2014, 16:57
Location: Paris

Re: CasparCG-Connection: Node.js Javascript library

Postby Jesper Stærkær » 03 Feb 2017, 12:41

Thank you, it's good to hear from users.
You are right, we should add some convertion to the CasparCG data syntax from JSON/JS-objects. I have created an issue for this now, you can follow it on Github: https://github.com/SuperFlyTV/casparcg- ... /issues/58
Jesper Stærkær
Independent Consultant at SuperFly.tv
User avatar
Jesper Stærkær
 
Posts: 853
Joined: 13 Apr 2010, 18:06
Location: Trondheim, Norway

Re: CasparCG-Connection: Node.js Javascript library

Postby fredericbrandt » 04 Feb 2017, 15:22

Great ! Thank you, I've subscribed to the issue.
User avatar
fredericbrandt
 
Posts: 36
Joined: 12 Dec 2014, 16:57
Location: Paris

Re: CasparCG-Connection: Node.js Javascript library

Postby Jesper Stærkær » 05 Feb 2017, 14:42

Version 0.15.1 adds support for playing Decklink inputs.
Jesper Stærkær
Independent Consultant at SuperFly.tv
User avatar
Jesper Stærkær
 
Posts: 853
Joined: 13 Apr 2010, 18:06
Location: Trondheim, Norway

Re: CasparCG-Connection: Node.js Javascript library

Postby Jesper Stærkær » 05 Feb 2017, 18:36

Version 0.16.0 add support for playing Html pages (full URLs, not HTML templates).
Jesper Stærkær
Independent Consultant at SuperFly.tv
User avatar
Jesper Stærkær
 
Posts: 853
Joined: 13 Apr 2010, 18:06
Location: Trondheim, Norway

Re: CasparCG-Connection: Node.js Javascript library

Postby Pimp Shanti » 07 Feb 2017, 17:05

This is brilliant, thank you for your efforts.

I was just considering the possibility of writing a cross-platform client in Node.js and, low and behold...
Pimp Shanti
 
Posts: 23
Joined: 17 Feb 2011, 07:41

Re: CasparCG-Connection: Node.js Javascript library

Postby Jesper Stærkær » 07 Feb 2017, 21:32

Electron is a good starting point!
Jesper Stærkær
Independent Consultant at SuperFly.tv
User avatar
Jesper Stærkær
 
Posts: 853
Joined: 13 Apr 2010, 18:06
Location: Trondheim, Norway

Re: CasparCG-Connection: Node.js Javascript library

Postby itod » 28 Feb 2017, 22:11

Jesper Stærkær wrote:Electron is a good starting point!


Jesper, what do you think about giving us one minimal working example of such universal Electron client? I've put such thing (in C#) on GitHub six months ago:
https://github.com/itodorovic/CasparCG-Client-Example
Something like that, nothing fancy, just a minimal working example with Electron using casparcg-connection, so we can be sure best practices are used, and we can all latter build on that.

It would be great if you find time to write that code.
itod
 
Posts: 105
Joined: 29 Oct 2011, 20:54

Re: CasparCG-Connection: Node.js Javascript library

Postby tbimages » 25 Mar 2017, 06:36

Jesper, thank you kindly for this awesome library. Even though I'm new to nodejs its a breeze to implement.

Are you still developing it further?
tbimages
 
Posts: 4
Joined: 13 Feb 2017, 16:36

Re: CasparCG-Connection: Node.js Javascript library

Postby Jesper Stærkær » 25 Mar 2017, 15:57

Yup, development is continuing, but it has be quiet for a few months. I have a lot of new features in the issue list to be implemented. Perhaps the most exciting the one regarding asynchronous queueing.

I also want to refactor and split the library in two. This will introduce breaking changes, and I am considering developing this new version as the "next" branch, releasing as 1.0, and aiming to include proper documentation this time...
Jesper Stærkær
Independent Consultant at SuperFly.tv
User avatar
Jesper Stærkær
 
Posts: 853
Joined: 13 Apr 2010, 18:06
Location: Trondheim, Norway

Re: CasparCG-Connection: Node.js Javascript library

Postby tbimages » 26 Mar 2017, 21:34

Thanks kindly for the feedback. Look forward to its growth.
tbimages
 
Posts: 4
Joined: 13 Feb 2017, 16:36

Re: casparcg-connection: Node.js Javascript library

Postby Jesper Stærkær » 06 Apr 2017, 10:22

This is the main thread for discussing and collaborating on the future of this library: https://github.com/SuperFlyTV/casparcg- ... /issues/74
Jesper Stærkær
Independent Consultant at SuperFly.tv
User avatar
Jesper Stærkær
 
Posts: 853
Joined: 13 Apr 2010, 18:06
Location: Trondheim, Norway


Return to Tech and Development

Who is online

Users browsing this forum: No registered users and 7 guests