AVPlayerItem editing

570 views Asked by At

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 ?

1

There are 1 answers

1
hemkaran_raghav On

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.