Video Editing

The Video Module SDK delivers a suite of robust video editing tools. These tools facilitate the seamless integration of comprehensive video editing functionalities into your applications, including:

  • Video Editing: Modify and enhance video content with precision.

  • Concatenation: Easily join multiple video files.

  • Merging: Combine video files into a single output.

  • Encoding: Convert video files to different formats efficiently.

  • Noise Cancellation: Enhance audio quality by removing unwanted background noise.

These features empower developers to create versatile video applications tailored to diverse needs.

Prerequisites

  • Ensure you have integrated the TruVideo Core SDK into your project and completed with the authentication process

  • Camera module will provide MediaItem or simply provide filepath to upload (optional)

Edit a video

To edit a video, follow these steps:

Step 1 : Get Result File path where to place the save video

This function returns the result path using the provided file name as input.

const resultPathResponse = await getResultPath(`${Date.now()}-editVideo`);

Step 2 : Call video Edit

After obtaining the result path, invoke the editVideo function to edit

// result path will be available from step 1
// media item will be get from camera module or pass string file path
const { result } = await editVideo(filePath, resultPathResponse.result);

Finalize :

After completing this steps the function should look like

import { editVideo, getResultPath } from '@trunpm/truvideo-capacitor-video-sdk';


const videoEditing = async () => {
    try {
        // get result path to where to save 
        const resultPathResponse = await getResultPath(`${Date.now()}-editVideo`);
        // camera module will provide the media item or use string file path
        const { result } = await editVideo(filePath, resultPathResponse.result);
        // handle result 
        console.log('Video edited successfully:', result);
    } catch (error) {
        // handle error
        console.error('Error editing video:', error);
    }
}

For a detailed overview of the features available, please visit the video module.

Last updated

Was this helpful?