使用GPUImageMovieWriter在静止图像上录制更改过滤器的视频?

时间:2013-05-30 20:28:12

标签: ios gpuimage

我可以找到使用GPUImageMovieWriter的唯一文档涉及从视频源写入,但我需要拍摄静态图像并通过随时间变化GPUImageFilter的参数来生成视频

我尝试过链接GPUImagePicture -> GPUImageFilter -> GPUImageTextureOutput并像这样实施newFrameReadyFromTextureOutput:代理:

-(void)newFrameReadyFromTextureOutput:(GPUImageTextureOutput *)callbackTextureOutput {
    NSLog(@"new frame ready delegate method");
    [writer setInputTexture:callbackTextureOutput.texture atIndex:0];
    [writer newFrameReadyAtTime:CMTimeMakeWithSeconds(time, 1) atIndex:0];
    [...]

然后调整参数并再次调用-processImage;这会产生一个合适长度的输出视频,但图像会出现乱码。有没有任何支持的方式这样做?

1 个答案:

答案 0 :(得分:0)

您应该能够将GPUImageMovieWriter添加为任何过滤器的目标。