I want to use a GPUImageTransformFilter to crop a live video stream from GPUImageVideoCamera.
GPUImageTransformFilter *transformFilter = [[GPUImageTransformFilter alloc] init];
// Zoom is 4x
[transformFilter setAffineTransform:CGAffineTransformMakeScale(4, 4)];
// Is this needed. Say the zoom is 4 and the video stream size is 320 x 426. It that right?
[transformFilter forceProcessingAtSize:CGSizeMake(320*4, 426*4)];
[videoCameraDevice addTarget:transformFilter];
[transformFilter addTarget:liveTextureFilter]
[transformFilter prepareForImageCapture];
[videoCameraDevice resumeCameraCapture];
I have two problems:
1) The orientation of the video stream is rotated by 90 degrees.
2) The output in my GPUImageView flickers between the image without the transform (as if no transform was applied) and the 90-degree-rotated, transformed image at an approximate rate of 1/10th a second on an iPhone 5s.
Any ideas of what I am doing wrong and/or how would you approach cropping live video with a texture on top of the video stream that you do not want cropped?