Deepak Sharma
Deepak Sharma

Reputation: 6537

AVPlayerItem editing

I want to understand how a video editing app like iMovie on iOS handles changing the AVMutableComposition assigned to AVPlayerItem on the fly ? Example, user trims a video on the timeline, adds/modifies a text layer, adds a transition, etc. One way is to recreate a new AVMutableComposition object, create a new playerItem with this asset, and replace the currentItem of AVPlayer. I am not sure if this is the best approach and don't think iMovie app uses this approach, because there is a refresh on the player layer visible to user whenever you do this. Any ideas folks ?

Upvotes: 1

Views: 585

Answers (1)

hemkaran_raghav
hemkaran_raghav

Reputation: 1366

I think it creates another AVMutableComposition object or update the same AVMutabaleComposition, but there is a need to create new AVPlayerItem with updated AVMutableComposition every time and replace the currentItem of AVPlayer. What can be a better way.? I dont think there is a better way to do this.

Upvotes: 0

Related Questions