Post

Replies

Boosts

Views

Activity

AVAssetWriter with non-constant frame rate
I'm trying to export a series of JPG images into a H264 movie (ideally it would be a motion JPEG movie, but unfortunately out AVAssetWriterdoes not support this codec). The images originate from a professional surveillance camera with VFR (variable frame rate), hence I compute the CMTimebased on the time they have been captured, which results in a non-constant frame rate.When I do this, the AVAssetWriter always fails to render the movie:Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSLocalizedFailureReason=An unknown error occurred (-16364), NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x604000245a90 {Error Domain=NSOSStatusErrorDomain Code=-16364 "(null)"}}When I change the CMTime instances to be e.g.CMMakeTime( frameIndex * 150, 600 )it works, albeit resulting in a slightly wrong output.Any idea how I could fix this? Is AVAssetWriter supposed to support that scenario?
3
0
3.9k
Nov ’17