GPUImage icon indicating copy to clipboard operation
GPUImage copied to clipboard

Post processing of already taken video

Open balabs opened this issue 13 years ago • 2 comments

In my application I need to use video effects that have to be applied on post production of video, after user selects filter he wants.

The problem is next: since I use GPUImage framework, I used code given in SimpleVideoFileFilter. In completion block that has two lines of code, which removes target from filter and finishes recording

[code] [movieWriter setCompletionBlock:^{ [filter removeTarget:movieWriter]; [movieWriter finishRecording]; }]; [/code]

it throws me the exception Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '*** -[AVAssetWriterInput markAsFinished] Cannot call method when status is 2' *** First throw call stack:

This happens also in sample application SimpleVideoFileFilter that, as I mentioned, comes with framework, and in my app since I used similar code.

I tried to figure out why this happens and it seems like code in completion block gets called twice so what I did was to set a flag where I check if completion block is called once and second time completion block execution is skipped, then the code works fine.

But I think there must be a more elegant solution for this.

Anyone with same problems?

Best regards

PS @BradLarson no matter how many bugs we have to fix, thanks a lot for this framework.

balabs avatar Mar 06 '13 15:03 balabs

I am running into this same issue, did you find a more elegant solution?

gordonturner avatar Jun 18 '13 12:06 gordonturner

Not any

Still using flag that checks if once we already entered cmpletion block, if yes next time I skip that execution

balabs avatar Jun 19 '13 09:06 balabs