I am trying to make an app for musicians involving video recording. In the app the user first chooses the tempo, time signature and number of bars then hits the "Record" button. When the button is hit, I start playing a metronome and show a countdown (4...3...2...1...) before starting the recording. The recording would last for the exact necessary time and not a frame shorter or longer. Given the end use of the video (making music), every slight delay has to be avoided.
My current solution uses AVCaptureMovieFileOutput()
and ffmpeg to analyze the audio, find the right start and end then trim the video. I'm wondering if there's a way to capture the right length to begin with using AVCaptureVideoDataOutput()
or maybe with a lower level solution like Core Audio.