# Manipulating video with videoFrameWasCaptured

**URL:** <https://community.wowza.com/t/manipulating-video-with-videoframewascaptured/51758>\
**Category:** Wowza GoCoder SDK\
**Created:** [August 7, 2018, 11:06pm UTC](https://community.wowza.com/t/manipulating-video-with-videoframewascaptured/51758 "2018-08-07T23:06:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_Wiklund](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@Martin\_Wiklund](https://community.wowza.com/u/Martin_Wiklund)\
**Post date:** [August 7, 2018, 11:06pm UTC](https://community.wowza.com/t/manipulating-video-with-videoframewascaptured/51758/1 "2018-08-07T23:06:53Z")

</div>

I’m trying to figure out how to manipulate the video feed using WZVideoSink, but I can’t get it to work. I’m using this example for guidance:

[https://stackoverflow.com/questions/51187549/stream-video-with-bitmap-as-overlay/51609700#51609700](https://stackoverflow.com/questions/51187549/stream-video-with-bitmap-as-overlay/51609700#51609700)

I’ve also tried copy-pasting the code in the WowzaGoCoderSDKSampleApp project (code below) but there is no filter on the recorded video. The method is hit for each frame as intended. Am I missing something obvious?

```auto
- (void) videoFrameWasCaptured:(nonnull CVImageBufferRef)imageBuffer framePresentationTime:(CMTime)framePresentationTime frameDuration:(CMTime)frameDuration {

    if (self.goCoder.isStreaming) {

        if (self.blackAndWhiteVideoEffect) {

            // convert frame to b/w using CoreImage tonal filter

            CIImage *frameImage = [[CIImage alloc] initWithCVImageBuffer:imageBuffer];

            CIFilter *grayFilter = [CIFilter filterWithName:@"CIPhotoEffectTonal"];

            [grayFilter setValue:frameImage forKeyPath:@"inputImage"];

            frameImage = [grayFilter outputImage];

            CIContext * context = [CIContext contextWithOptions:nil];

            [context render:frameImage toCVPixelBuffer:imageBuffer];

        }

    }

}<br>

```

---

<div class="post-metadata">

**Author:** ![Martin\_Wiklund](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@Martin\_Wiklund](https://community.wowza.com/u/Martin_Wiklund)\
**Post date:** [August 16, 2018, 12:25pm UTC](https://community.wowza.com/t/manipulating-video-with-videoframewascaptured/51758/2 "2018-08-16T12:25:01Z")

</div>

The issue was that I’d registered the videoSink after I set the camera view when configuring the wowzaGoCoder object.
