Cabbage icon indicating copy to clipboard operation
Cabbage copied to clipboard

About the text overlay, edit, drag and drop, zoom.

Open junnnerr opened this issue 4 years ago • 1 comments

About the text overlay, edit, drag and drop, zoom in and out of the function, whether there is a demonstration code, or a way of thinking to achieve.

junnnerr avatar Apr 23 '21 08:04 junnnerr

There is Overlay Demo. Text should be rendered to an image and then added as overlay Everything should be implemented by yourself. And then applied to timeline.

For example: You can apply transformations to video like this:

trackItem.videoConfiguration.transform = <Your Transformation>

Or trim video:

let videoPlayableRange: ClosedRange<Double>

guard let exportSession = compositionGenerator.buildExportSession(outputURL: outputURL) else { return }
exportSession.timeRange = CMTimeRange(
            start: CMTime(
                seconds: videoDuration * videoPlayableRange.lowerBound,
                preferredTimescale: CMTimeScale(NSEC_PER_SEC)
            ),
            end: CMTime(
                seconds: videoDuration * videoPlayableRange.upperBound,
                preferredTimescale: CMTimeScale(NSEC_PER_SEC)
            )
        )
exportSession.exportAsynchronously {}

Alexey-Matjuk avatar Apr 23 '21 12:04 Alexey-Matjuk