How to install the Pintura Video Editor extension
The video editor extension isn't included in the Pintura image editor product package, it's available as an upgrade on the pricing page
Please note that client-side video encoding is useful for encoding short videos, it's advised to use server side encoding for content longer than a couple minutes.
The Redact, Frame, and Fill util are currently not supported when using the video extension.
To install the Pintura Video Editor extension we need to load its styles, its locale, and the trim util.
We can either download the Pintura Video extension from the customer portal, or we can install it from the private pqina npm.
npm install @pqina/pintura-video
The Pintura Video extension package contains the Trim plugin and a collection of video encoders to enable exporting video.
To load the Trim plugin we need to import the setPlugins
function and add the plugin locale object.
import {
setPlugins,
openDefaultEditor,
plugin_trim_locale_en_gb,
} from '@pqina/pintura';
import '@pqina/pintura/pintura.css';
// Import trim plugin and locale
import { plugin_trim } from '@pqina/pintura-video';
// Import Pintura video styles, these styles are needed to render the trim plugin
// Please note that how styles are imported differs per framework
import '@pqina/pintura-video/pinturavideo.css';
// Load the Trim plugin
setPlugins(plugin_trim);
openDefaultEditor({
src: './my-video.mp4',
// Example trim settings
imageTrim: [[0.5, 0.7]],
// Add the Trim plugin locale object
locale: {
...plugin_trim_locale_en_gb,
},
});
Please make sure to load the pinturavideo.css
file, see above. How to load CSS will differ per framework.
To write the output video we need to set an encoder, the exports page shows the available video encoders and how to use them.