GPUImage icon indicating copy to clipboard operation
GPUImage copied to clipboard

Freeze on iPhone 3GS when settings audioEncodingTarget = movieWriter

Open rizzow opened this issue 13 years ago • 6 comments

Hi,

in the latest versions of the framework, the framework hangs on iPhone 3GS when setting

videoCamera.audioEncodingTarget = movieWriter;

This is true in both the SimpleVideoFilter example app and in our own application. We traced it to block on

    [_captureSession commitConfiguration];

in - (void)setAudioEncodingTarget:(GPUImageMovieWriter *)newValue; in GPUImageVideoCamera.m. There are some mentions on the internet of this happening when setting the torch mode, but we don't do this.

We tested this on iPhone 3GS (iOS 6), iPhone 4 & iPhone 5. The latter two don't exhibit the problem.

rizzow avatar Apr 25 '13 07:04 rizzow

Could this be related to commit a944ac814cc9b78a57b6750867baf0c0263693d4 where setting the audio config was enclosed in a

runSynchronouslyOnVideoProcessingQueue(^{ ... });

?

rizzow avatar Apr 25 '13 07:04 rizzow

The same for me.

Block iPhone 3GS when set the audioEncodingTarget to a GPUImageMovieWriter. In the example too. In fact, in - (void)setAudioEncodingTarget:(GPUImageMovieWriter *)newValue; when is setting the [_captureSession addOutput:audioOutput]; and do the Commit all is completely blocked.

jasaiher avatar Apr 26 '13 07:04 jasaiher

We traced this to bug to have been introduced between these commits:

OK: January 10 - 94d86bfe662b4da8dc81027152970b710202db43  FAIL: January 15 - 1743b73ab9f7d9340c2ea794dab6b71f765118b6

As tested with SimpleVideoFilter on an iPhone 3GS 6.1.3

rizzow avatar Apr 26 '13 09:04 rizzow

In GPUImageVideoCamera.m method: (id)initWithSessionPreset:(NSString *)sessionPreset cameraPosition:(AVCaptureDevicePosition)cameraPosition;

Commenting: //if (captureAsYUV && [GPUImageOpenGLESContext supportsFastTextureUpload])

and uncommenting: if (captureAsYUV && [GPUImageOpenGLESContext deviceSupportsRedTextures])

Works on 3GS.

So maybe selecting supportsFastTextureUpload or deviceSupportsRedTextures if we have 3GS or not...

jasaiher avatar Apr 26 '13 11:04 jasaiher

We'll submit a pull request for this bug.

rizzow avatar May 02 '13 13:05 rizzow

@rizzow - If it's just changing the commenting as jasaiher suggested above, I'll reject it, because that breaks a bunch of other stuff. I haven't had the time to test this on my 3GS, but it sounds like there's an issue with taking in YUV frames. The 3GS should handle those just like all the other devices, but that's what I'd start looking into. I won't have the time to look at this for a while, though.

BradLarson avatar May 02 '13 14:05 BradLarson