Я использую следующий код для захвата видео и сохранения его в папке документов моего приложения:
AVCaptureDeviceInput *captureInput = [AVCaptureDeviceInput deviceInputWithDevice:[AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo] error:NULL];
m_captureFileOutput = [[AVCaptureMovieFileOutput alloc] init];
captureSession = [[AVCaptureSession alloc] init];
[captureSession addInput:captureInput];
[captureSession addOutput:m_captureFileOutput];
[captureSession beginConfiguration];
[captureSession setSessionPreset:AVCaptureSessionPresetHigh];
[captureSession commitConfiguration];
[captureSession startRunning];
...some function that starts the recording process...
[m_captureFileOutput startRecordingToOutputFileURL:url recordingDelegate:self];
...some function that ends the recording process...
[m_captureFileOutput stopRecording];
Суть в том, что моя цель - записывать до 9 часов видео одновременно. Практически, возможно ли записать видео такого размера, используя этот метод? Кодирует ли AVCaptureMovieFileOutput
и сохраняет ли оно видео на диск в режиме реального времени при получении кадров с камеры, или все видео буферизуется в ОЗУ перед обработкой после вызова [m_captureFileOutput stopRecording];
?
Если такой подход не подходит для записи видео такой длительности, что может быть разумной альтернативой?
Спасибо,
Джеймс