VideoCodecSettings
public struct VideoCodecSettings : Codable, Sendable
The VideoCodecSettings class specifying video compression settings.
-
The number of frame rate for 30fps.
Declaration
Swift
public static let frameInterval30: Double
-
The number of frame rate for 10fps.
Declaration
Swift
public static let frameInterval10: Double
-
The number of frame rate for 5fps.
Declaration
Swift
public static let frameInterval05: Double
-
The number of frame rate for 1fps.
Declaration
Swift
public static let frameInterval01: Double
-
The defulat value.
Declaration
Swift
public static let `default`: VideoCodecSettings
-
A bitRate mode that affectes how to encode the video source.
See moreDeclaration
Swift
public enum BitRateMode : String, Codable, Sendable
-
The scaling mode.
Seealso
https://developer.apple.com/documentation/videotoolbox/kvtpixeltransferpropertykey_scalingmodeDeclaration
Swift
public enum ScalingMode : String, Codable, Sendable
-
Specifies the video size of encoding video.
Declaration
Swift
public var videoSize: CGSize
-
Specifies the bitrate.
Declaration
Swift
public var bitRate: Int
-
Specifies the H264 profileLevel.
Declaration
Swift
public var profileLevel: String { get set }
-
Specifies the scalingMode.
Declaration
Swift
public var scalingMode: ScalingMode
-
Specifies the bitRateMode.
Declaration
Swift
public var bitRateMode: BitRateMode
-
Specifies the keyframeInterval.
Declaration
Swift
public var maxKeyFrameIntervalDuration: Int32
-
Specifies the allowFrameRecording.
Declaration
Swift
public var allowFrameReordering: Bool?
-
Specifies the dataRateLimits
Declaration
Swift
public var dataRateLimits: [Double]?
-
Specifies the HardwareEncoder is enabled(TRUE), or not(FALSE) for macOS.
Declaration
Swift
public var isHardwareEncoderEnabled: Bool
-
Specifies the video frame interval.
Declaration
Swift
public var frameInterval: Double
-
init(videoSize:
bitRate: profileLevel: scalingMode: bitRateMode: maxKeyFrameIntervalDuration: allowFrameReordering: dataRateLimits: isHardwareEncoderEnabled: ) Creates a new VideoCodecSettings instance.
Declaration
Swift
public init( videoSize: CGSize = .init(width: 854, height: 480), bitRate: Int = 640 * 1000, profileLevel: String = kVTProfileLevel_H264_Baseline_3_1 as String, scalingMode: ScalingMode = .trim, bitRateMode: BitRateMode = .average, maxKeyFrameIntervalDuration: Int32 = 2, // swiftlint:disable discouraged_optional_boolean allowFrameReordering: Bool? = nil, // swiftlint:enable discouraged_optional_boolean dataRateLimits: [Double]? = [0.0, 0.0], isHardwareEncoderEnabled: Bool = true )