Question

I have video in .mp4 format and I would like to get last frame of this video then blur it and put into UIImageView. My problem is that I dont know how to get last frame of video. How can I do this in iOS?

Was it helpful?

Solution

Use AVAssetImageGenerator.

https://developer.apple.com/librarY/mac/documentation/AVFoundation/Reference/AVAssetImageGenerator_Class/Reference/Reference.html#//apple_ref/occ/cl/AVAssetImageGenerator

I haven't personally used it, but it looks pretty straight forward if you've used AVFoundation before. Looks like you just initialize it with an asset and then you can generate a CGImage at a specific time using copyCGImageAtTime:actualTime:error:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top