VideoByFrameSessionProtocol

public protocol VideoByFrameSessionProtocol : VideoSessionProtocol

Protocol for a video session that can be processed frame by frame

This is a low level highlight processing session that can be used to process video frames one by one. You should obtain the video frame in any way you want and call processFrame method to process it. Sequence of calls to process the video:

  • start() to start processing
  • processFrame(buffer) for every frame of the video
  • stop() to stop processing and finalize the results

Note

Listen to status.highlights observable property to get the highlights found in the video.
  • start processing the video stream

    You can start calling processFrame after this function is called. Observe status.highlights property to get the highlights found in the video

    Declaration

    Swift

    func start()
  • process one video frame

    Call this method on every frame of the video stream. This method can process every frame synchronously in the same thread if the session is initialized with sync parameter set to true or asynchronously in the background if sync is false. This method duplicates the given sampleBuffer when processed asynchronously.

    Note

    this method should be called only after start method was called otherwise it will not do anything

    Declaration

    Swift

    func processFrame(buffer sampleBuffer: CMSampleBuffer)

    Parameters

    sampleBuffer

    video frame to process

  • stop video processing, finalize the results

    should be called when the video stream ends to finalize the highlight results and free the resources

    Declaration

    Swift

    func stop()
  • Set VideoStatus object to get processing updates, highlights or use the existing status property

    Declaration

    Swift

    func setStatusObject(_ obj: VideoStatus)

    Parameters

    obj

    VideoStatus object to be updated

  • current status of the video processing

    Gives observable properties for the processing status, number of highlights found and the list of highlights

    Declaration

    Swift

    var status: VideoStatus { get }