Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPUImageMovieWriter pauses capture and startWriting can crash #1228

Open
crayfellow opened this issue Oct 2, 2013 · 1 comment
Open

GPUImageMovieWriter pauses capture and startWriting can crash #1228

crayfellow opened this issue Oct 2, 2013 · 1 comment

Comments

@crayfellow
Copy link

We are setting up a recording of filtered capture like this:

    recorder = [[GPUImageMovieWriter alloc]
          initWithMovieURL:tempVideoURL
          size:dimensions
          fileType:(NSString *)kUTTypeMPEG4
          outputSettings:videoCompressionSettings];
    [recorder setHasAudioTrack:YES];

    [camera setAudioEncodingTarget:recorder];
    [outputFilter addTarget:recorder];
    [recorder startRecording];

While this starts recording, and when recording is finished, it introduces a noticeable freeze delay into the capture being previewed in a GPUImageView (another outputFilter target).

When recording is completed we'd like to be able to do subsequent recordings, but it appears GPUImageMovieWriter needs to be completely rebuilt every time in order to prevent it from trying to reuse AVAssetWriters (the crash would be "Cannot call method when status is 2").

However, when the recorder is cleared out on completion of recording like this:

        [outputFilter removeTarget:recorder];
        [camera setAudioEncodingTarget:nil];
        recorder = nil;

Subsequent recordings simply crash with "Cannot call method when status is 3", indicating the AVAssetWriter has failed.

So two questions:

  • Is there a way to avoid the frozen capture upon start and stop recording?
  • Is it possible to reuse GPUImageMovieWriter instances?

Thanks!

@hexuallyactive
Copy link

"While this starts recording, and when recording is finished, it introduces a noticeable freeze delay into the capture being previewed in a GPUImageView (another outputFilter target)."

I notice the the freeze delay in GPUImageView also...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants