iOS alternative to QTMovieLayer that has non-nil `contents`?

匆匆过客 提交于 2019-12-03 01:20:15

For getting video/audio data buffer from capture session or player session,

  • Create AVCaptureVideoDataOutput / AVCaptureAudioDataOutput object.
  • Confirm one of your to AVCaptureVideoDataOutputSampleBufferDelegate.
  • Add AVCaptureVideoDataOutput to your Capture/Player session.
  • Implement protocol methods. You will receive the CMSampleBufferRef object containing video/audio frames as the media is being captured/played in the captureOutput... method of AVCaptureVideoDataOutputSampleBufferDelegate.

CMSampleBufferRef object contains media frame data, timestamp information and the format description of media. You can then display this frame by converting it into CGImageRef and display it on any view.

You can also specify the desired frame compression format (or uncompressed frame format) in AVCaptureVideoDataOutput.videoSettings property.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!