GPUImage multiple video inputs with offset x and y

908 views Asked by At

I am trying to create an application with multiple videos playing at the same time. The application uses different frames on which to record. The problem is stitching those videos together using GPUImage library. I have gone through http://indieambitions.com/idevblogaday/mixing-videos-gpuimage/ and found that it is possible to blend in two videos together into one using the blend filter. My problem is that I want one video on top right and other on bottom left both playing at the same time. I would also want to store the resulting video for sharing. I have tried to look at other resources like AVMutableComposition for writing it down but I will have to apply filters to them later. So I was thinking of having a custom filter made with multiple video sources that gives out the final video. This question is for @Brad Larson specifically if he can give us some direction as to how to do it.I have also attached an image of the output that I wanted out of a filter/solution.enter image description here

1

There are 1 answers

0
Nirav Bhatt On

From your output it doesn't seem you want mixing two videos. These are two separate video streams, and can be simply displayed using two different UIViews.

The video in your link is blended together using a specific filter called GPUImageColorDodgeBlendFilter. If you read that article thoroughly it talks about other GPU filters too, and the process does not differ much once you know which filter you should be using. Once you know it, it's just playing with certain values (or none at all in case of color dodge filter).

Read this if you want to become aware of blending modes and filters. GPUImage applies same and more filters but with more efficiency due to its use of OpenGL shaders.