How to record video input from decklink or screen consumer?

Hi guys, I hope you are well. I have a question, how could I record and save a video of a consumer input as a decklink or screen with casparcg using casparcg connection.
I am using nodejs.

It is like this

//use  "casparcg-connection": "^5.1.0",
const { CasparCG, Options, AMCP } = require('casparcg-connection');
var myCaspar = new CasparCG("127.0.0.1", 5250)
myCaspar.queueMode = Options.QueueMode.SEQUENTIAL;

const sendCommand = str => {
    myCaspar.do(new AMCP.CustomCommand(str)).then((casparResponse) => {
        console.log(casparResponse.response.raw);

    }).catch((casparError) => console.log('Error:', casparError.response.raw));
}

sendCommand('play 1-1 decklink 1');
sendCommand('add 1 file xyz.mp4');

setTimeout(() => {
    sendCommand('remove 1 file xyz.mp4');
}, 10000);

Full sample project project

1 Like

Thanks u vimlesh :ok_hand:

1 Like