video stuttering when recording with audio on iphone4 (& no filters applied)
Hi Brad/All,
I'm trying to track down some performance issues on older devices, & have found that on an iPhone4 (iOS 5.0.1) using the 640x480 camera preset theres a visible & consistent stutter/jitter in the video, seemingly every 1/2 a second or so, it shows on the preview, & the recorded video file. Don't seem to see it on newer devices.
Its noticeable on the SimpleVideoFilter demo app, with the filters removed, so its just the camera footage displayed on screen & recorded to file.
If the audio encoding target isn't set, I don't see the stutter.
With audio enabled, but the appendSampleBuffer: call commented out (at the end of the movie writers processAudioBuffer: method), I don't see the stutter (but obviously don't get any audio saved).
So this doesn't seem to be a direct issue with GPUImage, but maybe either a device limitation, or possibly something to do with which thread/queue the audio is being processed on maybe?
If it helps at all, with audio enabled (& the stutter), I'm getting about 20fps in the final output file (which wouldn't explain the occasional stutter), without audio I'm seeing about 25fps.
Has anyone come across this issue?
The only link referencing this (or similar) I've found so far is: http://stackoverflow.com/questions/11274652/performance-issues-when-using-avcapturevideodataoutput-and-avcaptureaudiodataout But I'm not sure if thats relevant to this, I'm still making my way through the code & trying to understand how the audio is handled.
Wondered if anyone had any ideas, or had come across this themselves?
Thanks Phil
I believe this could be improved by an adjustment of queue priorities to emphasize the video encoding over the audio recording, as described in issue #423. I'm not entirely sure the approach described in the last post there is safe, but something like that might potentially improve upon this stuttering.
Hi Brad,
Thanks very much for replying & pointing that out, I hadn't spotted it in my searches.
From your comments in that thread, some of those other changes do sound a little unstable, but I'll certainly have a play with the queue priorities, as that sounds potentially promising & safer to do, worth an experiment at least.
I'm starting to make my way through the audio usage & understand it a little better, at least enough to work out what apis to search up & read up on further. That post helps me know where to look next, much appreciated!
Will post back if I have any luck or not (probably after the weekend).
Thanks again Phil