Some test text!

Loading...
Guides
Server component for ffmpeg commands

Server component for ffmpeg commands

WebViewer Video uses ffmpeg in the background to allow for redaction of video frames. In order to utilize ffmpeg, a server must be setup on the user side to allow for it. A sample server can be found here. We recommend hosting the server on AWS. The example code below shows how to integrate the server with your application:

import WebViewer from '@pdftron/webviewer';
import { initializeVideoViewer, renderControlsToDOM } from '@pdftron/webviewer-video';
WebViewer({
    path: '/webviewer/lib',
  },
  viewer.current,
).then(async instance => {
  // Extends WebViewer to allow loading HTML5 videos (.mp4, ogg, webm).
  const {
      UI,
      loadVideo,
  } = await initializeVideoViewer(
      instance,
      {
        license: '---- Insert commercial license key here after purchase ----',
        `---- Other settings ----`,
      }
  );
  // Load a video at a specific url. Can be a local or public link
  // If local it needs to be relative to lib/ui/index.html.
  // Or at the root. (eg '/video.mp4')
  // Dash file url
  const videoUrl = 'https://pdftron.s3.amazonaws.com/downloads/pl/video/video.mp4';
  loadVideo(videoUrl);

  UI.updateElement('redactVideoButton', {
    onClick: async () => {
      const { data: videoBuffer } = await axios.post('http://YOUR_SERVER_HERE/video/redact', {
        intervals: [
          {
            start: 0,
            end: 12.5,
          }
        ],
        url: 'https://pdftron.s3.amazonaws.com/downloads/pl/video/video.mp4',
      });

      videoInstance.loadVideo(videoBuffer);
    }
  });
});

Get the answers you need: Support

Upcoming Webinar: How Developers Add Office Viewing Without Downloading | June 9th at 11 am PT

PDFTron SDK

The Platform

NEW

© 2022 PDFTron Systems Inc. All rights reserved.

Privacy

Terms of Use