开发者

How to conver the video recorder file to Binary data on 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 开发者_如何学Pythonof video. What can i use?


You need to set the sample buffer delegate on the AVCaptureVideoDataOutput object of your AVCaptureSession. 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.

  [captureOutput setSampleBufferDelegate:self queue:dispatch_get_main_queue()];

Then the you need to implement the following method

- (void)captureOutput:(AVCaptureOutput *)captureOutput 
didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer 
       fromConnection:(AVCaptureConnection *)connection 

This will be called by your AVCaptureVideoDataOutput object and the binary data of the video will be in sampleBuffer.

Note sampleBuffer will only contain a slice of the data.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜