CMSampleBuffer

class CMSampleBuffer : _CFObject
  • Creates an offset CMSampleBuffer for the given time offset and duration.

  • Parameters:

    • sampleBuffer: Input sample buffer to copy and offset.
    • timeOffset: Time offset for the output sample buffer.
    • duration: Optional duration for the output sample buffer.
  • Returns

    Sample buffer with the desired time offset and duration, otherwise nil.

    Declaration

    Swift

    public class func createSampleBuffer(fromSampleBuffer sampleBuffer: CMSampleBuffer, withTimeOffset timeOffset: CMTime, duration: CMTime?) -> CMSampleBuffer?
  • Extracts the metadata dictionary from a CMSampleBuffer. (ie EXIF: Aperture, Brightness, Exposure, FocalLength, etc)

    Parameter

    Parameter sampleBuffer: sample buffer to be processed

    Returns

    metadata dictionary from the provided sample buffer

    Declaration

    Swift

    public func metadata() -> [String : Any]?
  • Appends the provided metadata dictionary key/value pairs.

    Parameter

    Parameter metadataAdditions: Metadata key/value pairs to be appended.

    Declaration

    Swift

    public func append(metadataAdditions: [String: Any])