2016-06-16 8 views

答えて

1

あなたがAVCaptureVideoDataOutputを使用している場合は、デリゲートのコールバック

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

に、あなたは、レコードの最初と最後sampleBuffer秒のプレゼンテーションタイムスタンプ注意することによって記録された期間を計算することができます

CMTime start = CMSampleBufferGetPresentationTimeStamp(sampleBufferFirst); 
CMTime end = CMSampleBufferGetPresentationTimeStamp(sampleBufferLast); 

CMTime recordedDuration = CMTimeSubtract(end, start); 
関連する問題