VideoKit icon indicating copy to clipboard operation
VideoKit copied to clipboard

Video composition must have a positive frameDuration

Open EvgeniyMac opened this issue 2 years ago • 2 comments

Not working, i get this error - Thread 1: "*** -[AVAssetExportSession setVideoComposition:] video composition must have a positive frameDuration"

EvgeniyMac avatar Mar 31 '23 08:03 EvgeniyMac

please provide your code

juliangerhards avatar Apr 03 '23 11:04 juliangerhards

you will have to do like following to resolve this issue.

        if let limitFPS = config.limitFPS {
            videoComposition.frameDuration = CMTime(value: 1, timescale: limitFPS)
        } else {
            let rate = try await videoTrack.load(.nominalFrameRate)
            videoComposition.frameDuration = CMTimeMake(value: 1, timescale: Int32(rate))
        }

Rashesh-Bosamiya avatar Jul 02 '23 15:07 Rashesh-Bosamiya