agora-extension-pvc
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-beta • Public • Published

agora-rtc-plugin-pvc

agora-rtc-plugin-pvc is a extension of agora-rtc-ng-sdk, it provides perceptual video coding algorithm to remove visually insensitive information from video content. Applying PVC plugin before encoding will reduce the loss of details caused by encoder. When PVC is enabled, it is recommended to reduce the encoding bitrate by 15%.

installation

npm install agora-rtc-plugin-pvc

usage

agora-rtc-pvc only applies to LocalVideoTrack, and you should not .

import AgoraRTC from "agora-rtc-sdk-ng";
import PvcExtension, { IPvcProcessor } from "agora-extension-pvc"

let extension = new PvcExtension();
AgoraRTC.registerExtensions([extension]);
let processor: null | IPvcProcessor = null;

async function start() {
  // Create a local video track
  let videoTrack = await AgoraRTC.createCameraVideoTrack({
    encoderConfig: '480p'
  });

  // Play local video track
  videoTrack.play("player");

  if (!processor) {
    // Create and initialize pvc processor
    processor = extension.createProcessor();
    await processor.init();

    // Enable auto adjust if needed, this will close pvc automaticlly
    // when poor performance was detected.
    processor.enableAutoAdjust(videoTrack, 0, ()=>{
      console.log("PVC is disabled due to performance bottleneck");
    });

    // Enable pvc processor
    processor.enable();
  }

  // Insert pvc procecssor to processing pipline
  videoTrack.pipe(processor).pipe(videoTrack.processorDestination);
}

start();

Supported browsers

All browsers that support WebGL2, including:

  • Chrome latest version
  • Firefox latest version
  • Safari latest version

/agora-extension-pvc/

    Package Sidebar

    Install

    npm i agora-extension-pvc

    Weekly Downloads

    0

    Version

    1.0.0-beta

    License

    none

    Unpacked Size

    230 kB

    Total Files

    8

    Last publish

    Collaborators

    • agora.io