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.

final resultPath = "${widget.directoryPath}/editVideo_${timestamp}"

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
TruvideoVideoSdk.editVideo(
    inputPath: videoPath,
    outputPath: resultPath,
    onResult: (String? result) {
      print("Video edited successfully: $result");
    },
    onError: (String? message) {
      print("Video editing failed: $message");
    },
  );

Finalize :

After completing this steps the function should look like

void editVideo(String videoPath) {
  TruvideoVideoSdk.editVideo(
    inputPath: videoPath,
    outputPath: "${widget.directoryPath}/editVideo_${timestamp}",
    onResult: (String? result) {
      print("Video edited successfully: $result");
    },
    onError: (String? message) {
      print("Video editing failed: $message");
    },
  );
}

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

Last updated

Was this helpful?