Skip to content

Instantly share code, notes, and snippets.

View kakhaberikiknadze's full-sized avatar
👻

Kakhi kakhaberikiknadze

👻
View GitHub Profile
@kakhaberikiknadze
kakhaberikiknadze / composition.m
Created April 8, 2023 10:10 — forked from stuffmc/composition.m
AVComposition & AVVideoComposition
// For whatever reason (I guess because my code is wrong) the "composition" returns twice the same asset (one transformed, one not),
// although it should display 2 different videos... If anybody has a clue :(
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], AVURLAssetPreferPreciseDurationAndTimingKey, nil];
AVMutableComposition *composition = [AVMutableComposition composition];
CMTimeRange timeRange = CMTimeRangeMake(kCMTimeZero, CMTimeMakeWithSeconds(4, 1));
AVMutableVideoComposition *videoComposition = [AVMutableVideoComposition videoComposition];
// Track B