CMSampleBuffer

extension CMSampleBuffer
  • Creates an offset CMSampleBuffer for the given time offset and duration.

    Declaration

    Swift

    public class func createSampleBuffer(fromSampleBuffer sampleBuffer: CMSampleBuffer, withTimeOffset timeOffset: CMTime, duration: CMTime?) -> CMSampleBuffer?

    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.

    Return Value

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

  • Extracts the metadata dictionary from a CMSampleBuffer. (ie EXIF: Aperture, Brightness, Exposure, FocalLength, etc)

    Declaration

    Swift

    public func metadata() -> [String : Any]?

    Parameters

    sampleBuffer

    sample buffer to be processed

    Return Value

    metadata dictionary from the provided sample buffer

  • Appends the provided metadata dictionary key/value pairs.

    Declaration

    Swift

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

    Parameters

    metadataAdditions

    Metadata key/value pairs to be appended.