Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 使用AVFoundation暂停/恢复视频录制_Iphone_Avfoundation_Video Capture - Fatal编程技术网

Iphone 使用AVFoundation暂停/恢复视频录制

Iphone 使用AVFoundation暂停/恢复视频录制,iphone,avfoundation,video-capture,Iphone,Avfoundation,Video Capture,我正在使用AVFoundation框架进行视频录制。我需要实现暂停录制的功能,用户也可以恢复录制。我找了很多,但没有找到任何材料 我想到的一个想法是调用以下方法暂停录制而不关闭会话: [outputfile stopRecording]; 关于恢复,我应该打电话: startRecordingToOutputFileURL:fileURL-recordingDelegate:self] 但执行此操作后,将永远不会调用以下委托方法: - (void)captureOutput:(AVCaptur

我正在使用AVFoundation框架进行视频录制。我需要实现暂停录制的功能,用户也可以恢复录制。我找了很多,但没有找到任何材料

我想到的一个想法是调用以下方法暂停录制而不关闭会话:

[outputfile stopRecording];
关于恢复,我应该打电话:

startRecordingToOutputFileURL:fileURL-recordingDelegate:self]

但执行此操作后,将永远不会调用以下委托方法:

- (void)captureOutput:(AVCaptureFileOutput *)captureOutput didFinishRecordingToOutputFileAtURL:(NSURL *)outputFileURL
      fromConnections:(NSArray *)connections error:(NSError *)error 

还有其他暂停/恢复视频录制的方法吗?

我是通过在用户按“暂停”时停止录制并将文件写入文档目录来实现的。当用户按下“Resume”时,我开始在新文件中录制。最后,我将所有这些合并到一个文件中。最后进行清理。

当用户按“暂停”并将文件写入文档目录时,我停止了录制。当用户按下“Resume”时,我开始在新文件中录制。最后,我将所有这些合并到一个文件中。最后进行清理。

您能发布示例代码吗?或者更详细地说明你的陈述“我将所有这些合并到一个文件中”。谢谢你发布示例代码?或者更详细地说明你的陈述“我将所有这些合并到一个文件中”。谢谢