iOS 6, finishWriting should not be called on the main thread, completionBlock called twice
Hi, I noticed a couple of small issues while using SimpleVideoFileFilter on iOS 6:
2012-09-26 13:46:28.399 SimpleVideoFileFilter[7836:11f03] WARNING: -finishWriting should not be called on the main thread. 2012-09-26 13:46:28.483 SimpleVideoFileFilter[7836:13803] finished!!!!!! 2012-09-26 13:46:28.484 SimpleVideoFileFilter[7836:13803] finished!!!!!!
The warning probably doesn't matter, just figured I'd bring it to your attention. Also, the block set with setCompletionBlock seems to be called twice. (eg: NSLog("finished!!!!!!")) Right now I'm checking a "count" integer to only act on the first call, but this seems dirty. Is there a better way to check (once) that writing has indeed completely finished?
Thanks!
same here, is there any more info on this? anyone?
I have solved the "-finishWriting should not be called on the main thread" warning with this solution:
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul); dispatch_async(queue, ^{ [self.movieWriter finishRecording]; self.movieWriter = nil; });
Just invoking the "finishRecording" not on the main thread. I do not know if it is the good solution, but it works for me.
Does that fix work in the simulator? I'm calling finishRecording on a background thread, but doesn't work in the 6.0 simulator
@2energycell I tried that, but that didn't fix it for me (on iOS6)
I have same warning.
Does anyone has problem that after recording, the sound of just recorded video starts to reproduce for about 2-3 seconds?
running into similar issues. trying to find out how to access if the recording is finished. the property "encodingLiveVideo" seems to stay true whether recording or not. my use case is that i want the recording to stop either on user hitting the stop button or after X seconds.
I just tried on GPUImageMovieWriter (latest version) with this and works ok so far:
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^
{
[assetWriter finishWriting];
});
I went for this, because it freezes the app for a second when flushing the file.
I have the same problem as well, do we have a solution to the issue yet? Currently running IOS 6 and it is part of the video processing.