GPUImageVideoCamera with two targets

2 replies [Last post]
Fedo1975
User offline. Last seen 8 years 48 weeks ago. Offline
Joined: 06/15/2012
Posts:

Hello,

I add two filters on a GPUImageVideoCamera then I mix the two filters with AlphaBlendFilter.

It works, but there is a lag between the two filters if I move the camera.

[videocamera addTarget: Filter1];
[videocamera addTarget: Filter2];

[Filter1 addTarget: AlphaBlendFilter];
[Filter2 addTarget: AlphaBlendFilter];

[AlphaBlendFilter addTarget: self.view];

How can I do for the two filters work with the same source image (GPUImageVideoCamera)?

Thank you for your help!

Mike

Brad Larson
Brad Larson's picture
User offline. Last seen 4 years 22 weeks ago. Offline
Joined: 05/14/2008
Posts:

You're seeing double updating due to two filters feeding into a single blend. To prevent this, set the targetToIgnoreForUpdates property on the videocamera input to Filter1. This will cause the blend to only be executed when both Filter1 and Filter2 have been processed.

Fedo1975
User offline. Last seen 8 years 48 weeks ago. Offline
Joined: 06/15/2012
Posts:

It works now! :-)

Thanks a lot

Mike

Syndicate content