如何在 iPhone 上将录像机文件转换为二进制数据
我将在录制视频时对其进行分析。 我有分析功能来分析视频。 但它需要视频的二进制数据。 我可以用什么?
I'm going to analyze the video while it is recording.
I have analyzing function to analyze the video.
But it needs the binary data of video.
What can i use?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要在
AVCaptureSession
的AVCaptureVideoDataOutput
对象上设置示例缓冲区委托。确保您设置的示例缓冲区委托采用以下协议:AVCaptureVideoDataOutputSampleBufferDelegate
。下面是如何设置示例缓冲区委托的示例,假设您调用它的对象采用我提到的协议。然后,您需要实现以下方法,
该方法将由您的 AVCaptureVideoDataOutput 对象调用,视频的二进制数据将位于sampleBuffer 中。
注意
sampleBuffer
将仅包含数据的一部分。You need to set the sample buffer delegate on the
AVCaptureVideoDataOutput
object of yourAVCaptureSession
. Make sure what ever you set as the sample buffer delegate adopts the following protocol,AVCaptureVideoDataOutputSampleBufferDelegate
. Below is an example of how you would set the sample buffer delegate assuming the object you called it from adopts the protocol I mentioned.Then the you need to implement the following method
This will be called by your
AVCaptureVideoDataOutput
object and the binary data of the video will be insampleBuffer
.Note
sampleBuffer
will only contain a slice of the data.