我可以找到使用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
;这会产生一个合适长度的输出视频,但图像会出现乱码。有没有任何支持的方式这样做?
答案 0 :(得分:0)
您应该能够将GPUImageMovieWriter
添加为任何过滤器的目标。