Post processing of already taken video
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.
I am running into this same issue, did you find a more elegant solution?
Not any
Still using flag that checks if once we already entered cmpletion block, if yes next time I skip that execution