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

后端 未结 1 1542
醉酒成梦
醉酒成梦 2021-02-05 05:25

Background

QTKit (QuickTime Kit) is a Mac framework from the 10.3 days that got some layer additions in 10.5 like for example QTMovieLayer. One of the nic

1条回答
  •  梦毁少年i
    2021-02-05 05:59

    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.

    0 讨论(0)
提交回复
热议问题