GPUImage icon indicating copy to clipboard operation
GPUImage copied to clipboard

GPUImageMovieWriter fires auto-exposure/wb/focus

Open johnnyclem opened this issue 14 years ago • 7 comments

I have setup my [GPUImageVideoCamera inputCamera] to lock exposure, white balance and focus, which works fine. The issue is when i record with GPUImageMovieWriter, it will auto-expose, focus, white balance as soon as it starts recording. The real head-scratcher is that if i then stop recording and start recording again, it doesn't fire the auto-expose/focus/WB.

Any ideas on why this is happening, or possibly some ideas for a work-around?

johnnyclem avatar Apr 20 '12 05:04 johnnyclem

Nothing in the movie writer even touches the video input, so there shouldn't be anything in the recording portion that should cause this. Do you start the movie recording immediately after configuring and starting the camera, or does the camera run for a while before you initiate the recording?

If the former, this may just be the camera performing its initial auto-adjustments, and there may not be anything that can be done about that.

BradLarson avatar Apr 20 '12 18:04 BradLarson

I'm starting the video camera in viewdidappear and then when the record button is tapped I alloc/init the movie writer and attach it to the filter at the end of the filter chain then call [moviewriter startRecording]

I am at a loss as to why this happens because, as I said before, it's only happening the first time you record. If I record a second or third video, the issue doesn't present itself.

Could this be something to do with ARC possibly keeping avassetwriter around so that on the 2nd and 3rd calls for moviewriter to alloc/init it's perhaps retaining the object? I've also noticed that there's about a 1sec delay (on the iPhone 4s) between pressing record and the moviewriter starting, but this also only happens on the first record, subsequent records start writing instantly.

Sent from my iPhone

On Apr 20, 2012, at 11:48 AM, Brad Larson [email protected] wrote:

Nothing in the movie writer even touches the video input, so there shouldn't be anything in the recording portion that should cause this. Do you start the movie recording immediately after configuring and starting the camera, or does the camera run for a while before you initiate the recording?

If the former, this may just be the camera performing its initial auto-adjustments, and there may not be anything that can be done about that.


Reply to this email directly or view it on GitHub: https://github.com/BradLarson/GPUImage/issues/74#issuecomment-5250654

johnnyclem avatar Apr 20 '12 20:04 johnnyclem

I have the exact same issue. I've tried to allocate moviewriter and add to my chain as soon as my view appear. But when I start recording this "auto-adjust" and delay happens the first time.

ClovisMarsupial avatar Apr 20 '12 20:04 ClovisMarsupial

Finally solved this one. Looks like the auto-adjust was occuring whenever the audio target was set. I moved the adding of the audio target into my viewDidLoad and that solved that problem

johnnyclem avatar May 27 '12 21:05 johnnyclem

Hey Johnny, did you manage to get rid of the delay??

Also could you share the line of code where you said you added the audio target into your viewdidload method etc?

Im having the same two issues two.

Your help would be appreciated ... cheers

pavankataria avatar Jun 15 '12 06:06 pavankataria

Hi guys,

Sorry to post to an old issue, hope its ok to cross post, but I'm coming across an iOS6 issue that seems to be directly related to the auto focus work-around mentioned here (thanks for the original suggestion, its been working great for me up till now!).

I wondered if any of you had come across it (video freezes when setting the audio target for a 2nd recording)? I've posted details here: https://github.com/BradLarson/GPUImage/issues/512

Thanks Phil

phil-m avatar Oct 04 '12 21:10 phil-m

If the app is supported for different orientation, then viewDidLoad solution won't work. Do anybody figured out a way to fix this issue?

elango avatar Mar 07 '13 23:03 elango