Presents frames to the compression session and invokes the output callback when compression is complete.
- iOS 9.0+
- macOS 10.11+
- Mac Catalyst 13.0+Beta
- tvOS 10.2+
The compression session.
A Core Video image buffer (
CVImage) containing a video frame to be compressed. The buffer must have a nonzero reference count.
The presentation timestamp for this frame, to be attached to the sample buffer. Each presentation timestamp passed to a session must be greater than the previous one.
The presentation duration for this frame, to be attached to the sample buffer. If you do not have duration information, pass
Key/value pairs specifying additional properties for encoding this frame. Note that some session properties may also be changed between frames. Such changes affect subsequently encoded frames.
A pointer to a
VTEncodeto receive information about the encode operation.
kbit may be set if the encode is (or was) running asynchronously.
VTEncode Info _Asynchronous
kbit may be set if the frame was dropped (synchronously).
VTEncode Info _Frame Dropped
NULLif you do not want to receive this information.
The block to be called when encoding the frame is completed. This block may be called asynchronously, on a different thread from the one that calls
Session Encode Frame With Output Handler
Encoded frames may or may not be output before the function returns. The client should not modify the pixel data after making this call. The session and/or encoder retains the image buffer as long as necessary.