I have an AVComposition
containing multiple video and audio tracks. So far, it's pure programmatically, no GUI. I want the user to be able to push one track a couple of frames back or forth on will, by clicking a button. e.g: a button titled "-10 frames" will push a track 10 frames back, while "+10 frames" pushes it 10 frames forward. I can't find any way to actually move a track after it has been added using insertTimeRange:ofTrack:atTime:
.
I tried to remove it and re-adding it like this:
[secondAudioTrack removeTimeRange:CMTimeRangeMake(kCMTimeZero, kCMTimeIndefinite)];
[secondAudioTrack insertTimeRange:range ofTrack:[[secondAsset tracksWithMediaType:AVMediaTypeAudio] firstObject] atTime:newTime error:nil];
And it's not actually moving so far (I might've done something wrong though), but I feel like this is such a hacky way of doing it.. Anyone know of a proper way to give a new time to an already added track in an AVComposition
?