How to use the beamcoder.filterer function in beamcoder

To help you get started, we’ve selected a few beamcoder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Streampunk / casparcl / scratch / elecular_clunker2.js View on Github external
const enableDeinterlace = true;
  const platformIndex = 1;
  const deviceIndex = 0;
  const context = new addon.clContext({
    platformIndex: platformIndex,
    deviceIndex: deviceIndex,
    overlapping: true
  });
  const platformInfo = await context.getPlatformInfo();
  console.log(platformInfo.vendor, platformInfo.devices[deviceIndex].type);

  let demuxer = await beamcoder.demuxer('../../media/dpp/AS11_DPP_HD_EXAMPLE_1.mxf');
  await demuxer.seek({ time: 40 });
  const stream = demuxer.streams[0];
  let decoder = beamcoder.decoder({ name: stream.codecpar.name });
  let filterer = await beamcoder.filterer({
    filterType: 'video',
    inputParams: [{
      width: stream.codecpar.width,
      height: stream.codecpar.height,
      pixelFormat: stream.codecpar.format,
      timeBase: stream.time_base,
      pixelAspect: stream.codecpar.sample_aspect_ratio
    }],
    outputParams: [{
      pixelFormat: stream.codecpar.format
    }],
    filterSpec: 'yadif=mode=1:parity=-1:deint=0'
  })

	const bgColSpecRead = '709';
  const ovColSpecRead = 'sRGB';