Video Editing

The Video Module SDK delivers a suite of robust video editing tools, enabling seamless integration of powerful editing functionalities into your applications.

Key Features

  • Video Editing – Trim and enhance video content.

  • Concatenation – Join multiple video files smoothly.

  • Merging – Combine video files into a single output.

  • Encoding – Efficiently convert videos to other formats.

  • Noise Cancellation – Improve audio clarity by removing background noise.

These features empower developers to build feature-rich, custom video experiences.


Prerequisites

Before editing video content, ensure the following:

  • TruVideo Core SDK is integrated.

  • Authentication is completed.

  • You have access to a valid video file path.


Editing a Video

Step 1: Initialize the Preset

Use the TruvideoSdkVideoEditorPreset to define your input and output video files:

let preset = TruvideoSdkVideoEditorPreset(
    videoURL: video,
    outputURL: output
)

Step 2: Present the Editor View

Use the preset to launch the video editor UI within your app:

UIViewControllerInstance.presentTruvideoSdkVideoEditorView(
    input: viewModel.videoEditorInput,
    onComplete: { result in
        // Access the edited video result
        viewModel.processVideoEditorResult(result.editedVideoURL)
    }
)

Final Implementation

Here’s how the complete function should look in your app:

import TruvideoSdkVideo

func edit(video: URL, output: URL) {
    // Step 1: Create editor preset
    let preset = TruvideoSdkVideoEditorPreset(
        videoURL: video,
        outputURL: output
    )
    
    // Step 2: Launch editor and handle result
    UIViewControllerInstance.presentTruvideoSdkVideoEditorView(
        input: viewModel.videoEditorInput,
        onComplete: { result in
            // Process the final edited video
            viewModel.processVideoEditorResult(result.editedVideoURL)
        }
    )
}

Final Result -

Learn More

For advanced options like concatenation, encoding, or noise cancellation, refer to the Video Module Reference.

Last updated

Was this helpful?