AVAssetWriter is to be used in conjunction with AVAssetWriterInputPixelBufferAdaptor, a good example of how this can be achieved can be found here.
Then, upon 'AVCaptureAudioDataOutputSampleBufferDelegate' invocation, the raw audio buffer can be propagated out for further processing ( in parallel to having the data written to the disk ).
AVCaptureSession, multiple AVCaptureAudioDataOutputs
-
15-01-2022 - |
Question
Enviroment
- iphone
- arm7/sdk6.0
- xcode 4.5
Use-case
- Based on the AVCam sample
- Capture A/V into a file using AVCaptureMovieFileOutput
- Add an additional AVCaptureAudioDataOutput to intercept the audio being written to the file while recording
How-to
- Add Video input to the Capture session
- Add Audio input to the Capture session
- Add File Output to the Capture session
- Add Audio Output to the Capture session
- Configure
- Start recording
The problem
It seems the audio output is mutual exclusive, thus, either I get data being written to the disk, OR, I get AVCaptureAudioDataOutput capture delegate being called, when AVCaptureMovieFileOutput is added ( order doesn't matter ), AVCaptureAudioDataOutput delegate is not called.
- How can this be solved? how can I get 'AVCaptureAudioDataOutput' triggering it's delegate/selector while, at the same time 'AVCaptureMovieFileOutput' is used to write data to the disk?
- Can this be done in any way other way than using a lower level API such as eg. AVAssetWriter et al ?
Any help will be appreciated!
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow