How is your experience with the OutSystems Community?
FFmpeg Media Compressor

FFmpeg Media Compressor (ODC)

Stable version 1.0.0 (Compatible with ODC)
Uploaded on 26 Jun by Mihai Melencu
FFmpeg Media Compressor

FFmpeg Media Compressor (ODC)

Documentation
1.0.0

Overview


The component performs video compression on the client side using FFmpeg compiled to WebAssembly.

The main goal is to allow an OutSystems application to:

  1. Select a video using an Upload widget.
  2. Compress the selected video in the browser.
  3. Return the compressed video as Base64.
  4. Convert the Base64 result to Binary Data if needed.
  5. Download, save, upload, or process the compressed file.


CompressVideo


The main reusable action exposed by the component.

Input

CompressInput

The action receives:

  • Upload widget ID or selector.
  • Target video bitrate.
  • Target audio bitrate.
  • Output FPS.
  • Maximum width.

Output

VideoCompressionResult

The action returns:

  • Success status.
  • Message.
  • Original file size.
  • Compressed file size.
  • Compression ratio.
  • Output file name.
  • Compressed file as Base64.
  • MIME type.


LoadFFMPEGScript


The component includes a helper flow/block:

FFMPEG > LoadFFMPEGScript

This block runs logic on OnReady to prepare the JavaScript bridge.

The OnReady JavaScript node should:

  1. Validate that ODCVideoCompression is loaded.
  2. Configure the FFmpeg resource URLs.
  3. Install the upload widget bridge.

____________


The default output format is: video/mp4

____________

How to Use the Component

  1. Add the component dependency to your app.
  2. Place an OutSystems Upload widget on the screen.
  3. Add the LoadFFMPEGScript block to the screen/block where compression is needed.
  4. Call CompressVideo from a button/client action.
  5. Pass a CompressInput structure.
  6. Read the VideoCompressionResult.
  7. If IsSuccess = True, convert CompressedFileBase64 to Binary Data.
  8. Use the Binary Data for download, upload, storage, or API calls.