SCCameraKitAVWriterOutput
Objective-C
@interface SCCameraKitAVWriterOutput : NSObject
Swift
class AVWriterOutput : NSObject
AVWriterOutput is a CameraKit provided wrapper for AVAssetWriter. You are still responsible for the configuration of the writer.
-
Date and time of first video buffer recorded (ie. start recording time)
Declaration
Objective-C
@property (nonatomic, strong, readonly, nullable) NSDate *startDate;
Swift
var startDate: Date? { get }
-
Create an AVWriterOutput
Declaration
Objective-C
- (nonnull instancetype) initWithAVAssetWriter:(nonnull AVAssetWriter *)assetWriter pixelBufferInput: (nonnull AVAssetWriterInputPixelBufferAdaptor *)pixelBufferInput audioInput:(nullable AVAssetWriterInput *)audioInput;
Swift
init(avAssetWriter assetWriter: AVAssetWriter, pixelBufferInput: AVAssetWriterInputPixelBufferAdaptor, audioInput: AVAssetWriterInput?)
Parameters
assetWriter
the configured AVAssetWRiter
pixelBufferInput
the configured AVAssetWriterInputPixelBufferAdaptor to write video to.
audioInput
the configured AVAssetWriterInput to write audio to. May be nullable if the video does not contain audio. @note: audioInput is currently unused. This will change in a future build.
-
Unavailable
Use designated init or convenience init to pass in required writer and inputs
Declaration
Objective-C
+ (nonnull instancetype)new;
-
Unavailable
Undocumented
Declaration
Objective-C
- (instancetype)init NS_UNAVAILABLE;
-
Call this after you start recording on the AVAssetWriter. This will indicate that the output should start recording data it receives from CameraKit.
Note
DO NOT callstartSession
on the asset writer, this output class will do so when it receives the first video frame. This is to ensure that there are no empty frames from the time the session is started and the first video buffer is writtenDeclaration
Objective-C
- (void)startRecording;
Swift
func startRecording()
-
Call this before you stop recording on the AVAssetWriter. This will cause the output to stop recording data from CameraKit.
Note
DO NOT callendSession
on the asset writer, this output class will do so with the timestamp of the last video frame This is to ensure that there are no empty frames from the time the last video buffer is written to the end of the sessionDeclaration
Objective-C
- (void)stopRecording;
Swift
func stopRecording()