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 processingprocessFrame(buffer)for every frame of the videostop()to stop processing and finalize the results
Note
Listen tostatus.highlights observable property to get the highlights found in the video.
-
start processing the video stream
You can start calling
processFrameafter this function is called. Observestatus.highlightsproperty to get the highlights found in the videoDeclaration
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
syncparameter set totrueor asynchronously in the background ifsyncisfalse. This method duplicates the givensampleBufferwhen processed asynchronously.Note
this method should be called only afterstartmethod was called otherwise it will not do anythingDeclaration
Swift
func processFrame(buffer sampleBuffer: CMSampleBuffer)Parameters
sampleBuffervideo 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
VideoStatusobject to get processing updates, highlights or use the existingstatuspropertyDeclaration
Swift
func setStatusObject(_ obj: VideoStatus)Parameters
objVideoStatusobject 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 }
VideoByFrameSessionProtocol Protocol Reference