Weird Artifact and CIFilter to the Rescue

Today I ran into an issue with a weird artifact on a video that has a filter.

If you notice the edges you can see weird pixels. The hypothesis is it is some kind of over exposure or white black colors. So what is the answer.

 

So using CIColorClamp we remove the black and white pixels and look at the result.

 

 

I hope this post and the power of combining other filters is helpful.

Is it worth preprocessing videos before export?

Currently I am trying to optimize the export process of Story Swag for the new video feature that will be coming out any time. Users will have the ability to add videos instead of simply photos into the slide show export. Right now I am doing the last checks and attempts to optimize the experience before we release. Either way this decision to optimize has trade offs. If we preprocess user videos in the background, we are using what could be excessive battery and cpu resources. By preprocessing we are saving around 35% on the export time.

My plan at the moment is to use an OperationQueue and limit the number of videos that can be processed in the background to two. This might need testing across weaker devices to make sure they can handle it. Once this update ships, I plan on sharing things I have learned and some code examples. It has been one heck of a journey through AVFoundation.