GPUImageMovieWriter在assetWriterPixelBufferInput上崩溃

时间:2012-11-02 13:52:29

标签: ios crash gpuimage

更新:我现在知道我正在向已经解除分配的实例发送消息,我想我已经正确设置了我的项目,但是开始怀疑这个......

我已经阅读了brad的文档,并将我的项目设置为无弧,这可能与情况有关。我添加了链接器标志-fobjc-arc,并将目标GPUImage和我的目标添加到ios 4.3。

任何一个有同样问题的人发现了他/她做错了什么????

我几天来一直在寻找答案,但我无法解决它并且已经没有想法了。

每当我尝试使用GPUImageMovieWriter我的应用程序崩溃(EXC_BADACCESS)录制电影时:

CVPixelBufferPoolCreatePixelBuffer (NULL, [assetWriterPixelBufferInput pixelBufferPool], &renderTarget);

完整代码:

    NSString *pathToMovie = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/file.mov"];
    unlink([pathToMovie UTF8String]); // If a file already exists, AVAssetWriter won't let you record new frames, so delete the old movie
    NSURL *movieURL = [NSURL fileURLWithPath:pathToMovie];



    GPUImageSepiaFilter *sepiaFilter = [[GPUImageSepiaFilter alloc] init];
    [videoCamera addTarget:sepiaFilter];


    movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:movieURL size:CGSizeMake(640.0, 480.0)];
    movieWriter.encodingLiveVideo = YES;

    [sepiaFilter addTarget:movieWriter];


    movieWriter.shouldPassthroughAudio = YES;
    videoCamera.audioEncodingTarget = movieWriter;

    [movieWriter startRecording];

Ant的帮助或指针欢迎!

0 个答案:

没有答案