GPUImage icon indicating copy to clipboard operation
GPUImage copied to clipboard

GPUImageMovieWriter never calls its completion block or delegate

Open duanefields opened this issue 14 years ago • 5 comments

When capturing live video to a file, in the method of the example app SimpleVideoFilter, the -(void)endProcessing method of GPUimageMovieWriter is never called after you finish writing the video. Therefore neither the completion block or the delegate of GPUimageMovieWriter gets called. You can see this behavior in the SimpleVideoFilter app itself.

duanefields avatar Jul 26 '12 21:07 duanefields

Hi Duane,

I recently came across this issue as well, & started to test how to possibly fix it. I've got a rough initial commit here: https://github.com/phil-m/GPUImage/commit/f54ccc2113abd530e95e9507c3f6c0234277c886

That seems to get the complete delegate callback firing as expected (not tested the block, but I think that should work as well). But it needs more work to handle errors & other asset writer status situations, & there may be a better place to trigger this code from.

If Brad or someone with more knowledge of the lib could take a look & advise, it'd be much appreciated.

Thanks Phil

phil-m avatar Jul 27 '12 19:07 phil-m

Yeah, this is a bug that I was going to work on this weekend. I think I might know how to fix it.

BradLarson avatar Jul 27 '12 20:07 BradLarson

I believe this is now fixed with the patch that Steve submitted.

BradLarson avatar Aug 09 '12 18:08 BradLarson

Excellent, thanks Brad/Steve. The patch does seem to get the callbacks firing correctly when a recording is finished (as long as you remember to remove the movie writer target from the filter it was added to)

phil-m avatar Aug 13 '12 15:08 phil-m

@BradLarson completion block for movie writer is never called and that's why video file size shows 0 byte of sometime corrupt file saved.

GufranAnsari avatar Jun 17 '14 11:06 GufranAnsari