H264Encoder

public class H264Encoder : NSObject

H.264/AVC用のエンコーダークラス。

  • エンコード時のキーフレーム間隔のデフォルト値( 2秒 )。

    Declaration

    Swift

    public static let DEFAULT_KEY_FRAME_INTERVAL_TIME: Int
  • このエンコーダーがエンコード時に付与するスタートコード( 0 0 0 1 )。

    Declaration

    Swift

    public static let START_CODE: [UInt8]
  • プロファイルを表す列挙型。

    See more

    Declaration

    Swift

    public enum Profile : CaseIterable
  • tag

    オブジェクトを識別するためのタグ。

    Declaration

    Swift

    public var tag: Int
  • このクラスが使用する Delegate。

    Declaration

    Swift

    public weak var delegate: H264EncoderDelegate?
  • 画像の幅。

    Declaration

    Swift

    public private(set) var videoWidth: Int { get }
  • 画像の高さ。

    Declaration

    Swift

    public private(set) var videoHeigh: Int { get }
  • フレームレート。

    Declaration

    Swift

    public private(set) var frameRate: Int { get }
  • リアルタイム処理フラグ。

    Declaration

    Swift

    public private(set) var isRealTime: Bool { get }
  • 画質。

    Declaration

    Swift

    public private(set) var encodeQuality: IntdashVideoEncodeQuality { get }
  • ビットレート。

    Declaration

    Swift

    public private(set) var bitRate: Int { get }
  • 固定ビットレートアルゴリズムの利用フラグ(H.264、HEVCの場合のみ有効)。

    iOS16、またはmacOS13以降から利用可能

    Declaration

    Swift

    public private(set) var useConstantBitRateAlgorithm: Bool { get }
  • プロファイル。

    Declaration

    Swift

    public private(set) var profile: Profile { get }
  • H264Encoder を生成します。

    Declaration

    Swift

    public init(frameRate: Int)

    Parameters

    frameRate

    フレームレート。

  • H264Encoder を生成します。

    Declaration

    Swift

    public init(frameRate: Int, encodeQuality: IntdashVideoEncodeQuality)

    Parameters

    frameRate

    フレームレート。

    encodeQuality

    画質。

  • H264Encoder を生成します。

    Declaration

    Swift

    public init(frameRate: Int, bitRate: Int)

    Parameters

    frameRate

    フレームレート。

    bitRate

    ビットレート。

  • H264Encoder を生成します。

    Declaration

    Swift

    public init(frameRate: Int, bitRate: Int, useConstantBitRateAlgorithm: Bool)

    Parameters

    frameRate

    フレームレート。

    bitRate

    ビットレート。

    useConstantBitRateAlgorithm

    ビットレート固定化アルゴリズムを利用するかどうか。

  • H264Encoder を生成します。

    Declaration

    Swift

    public init(frameRate: Int, isRealTime: Bool)

    Parameters

    frameRate

    フレームレート。

    isRealTime

    リアルタイム処理フラグ 。 エンコーダーをエンコード処理がリアルタイムに行われるように設定します。

  • H264Encoder を生成します。

    Declaration

    Swift

    public init(frameRate: Int, isRealTime: Bool, encodeQuality: IntdashVideoEncodeQuality)

    Parameters

    frameRate

    フレームレート。

    isRealTime

    リアルタイム処理フラグ 。 エンコーダーをエンコード処理がリアルタイムに行われるように設定します。

    encodeQuality

    画質。

  • H264Encoder を生成します。

    Declaration

    Swift

    public init(frameRate: Int, isRealTime: Bool, bitRate: Int)

    Parameters

    frameRate

    フレームレート。

    isRealTime

    リアルタイム処理フラグ 。 エンコーダーをエンコード処理がリアルタイムに行われるように設定します。

    bitRate

    ビットレート。

  • H264Encoder を生成します。

    Declaration

    Swift

    public init(frameRate: Int, isRealTime: Bool, bitRate: Int, useConstantBitRateAlgorithm: Bool)

    Parameters

    frameRate

    フレームレート。

    isRealTime

    リアルタイム処理フラグ。 エンコーダーをエンコード処理がリアルタイムに行われるように設定します。

    bitRate

    ビットレート。

    useConstantBitRateAlgorithm

    ビットレート固定化アルゴリズムを利用するかどうか。

  • H264Encoder を生成します。

    Declaration

    Swift

    public init(frameRate: Int, keyFrameIntervalTime: Int)

    Parameters

    frameRate

    フレームレート。

    keyFrameIntervalTime

    キーフレーム間隔。

  • H264Encoder を生成します。

    Declaration

    Swift

    public init(frameRate: Int, keyFrameIntervalTime: Int, encodeQuality: IntdashVideoEncodeQuality)

    Parameters

    frameRate

    フレームレート。

    keyFrameIntervalTime

    キーフレーム間隔。

    encodeQuality

    画質。

  • H264Encoder を生成します。

    Declaration

    Swift

    public init(frameRate: Int, keyFrameIntervalTime: Int, bitRate: Int)

    Parameters

    frameRate

    フレームレート。

    keyFrameIntervalTime

    キーフレーム間隔。

    bitRate

    ビットレート。

  • H264Encoder を生成します。

    Declaration

    Swift

    public init(frameRate: Int, keyFrameIntervalTime: Int, isRealTime: Bool)

    Parameters

    frameRate

    フレームレート。

    keyFrameIntervalTime

    キーフレーム間隔。

    isRealTime

    リアルタイム処理フラグ。 エンコーダーをエンコード処理がリアルタイムに行われるように設定します。

  • H264Encoder を生成します。

    Declaration

    Swift

    public init(frameRate: Int, keyFrameIntervalTime: Int, isRealTime: Bool, encodeQuality: IntdashVideoEncodeQuality)

    Parameters

    frameRate

    フレームレート。

    keyFrameIntervalTime

    キーフレーム間隔。

    isRealTime

    リアルタイム処理フラグ 。 エンコーダーをエンコード処理がリアルタイムに行われるように設定します。

    encodeQuality

    画質。

  • H264Encoder を生成します。

    Declaration

    Swift

    public init(frameRate: Int, keyFrameIntervalTime: Int, isRealTime: Bool, bitRate: Int)

    Parameters

    frameRate

    フレームレート。

    keyFrameIntervalTime

    キーフレーム間隔。

    isRealTime

    リアルタイム処理フラグ 。 エンコーダーをエンコード処理がリアルタイムに行われるように設定します。

    bitRate

    ビットレート。

  • H264Encoder を生成します。

    Declaration

    Swift

    public init(frameRate: Int, keyFrameIntervalTime: Int, isRealTime: Bool, bitRate: Int, useConstantBitRateAlgorithm: Bool)

    Parameters

    frameRate

    フレームレート。

    keyFrameIntervalTime

    キーフレーム間隔。

    isRealTime

    リアルタイム処理フラグ 。 エンコーダーをエンコード処理がリアルタイムに行われるように設定します。

    bitRate

    ビットレート。

    useConstantBitRateAlgorithm

    ビットレート固定化アルゴリズムを利用するかどうか。

  • エンコードしたい映像データを追加します。

    Declaration

    Swift

    public func appendSampleBuffer(sampleBuffer: CMSampleBuffer, timestamp: TimeInterval = -1)

    Parameters

    sampleBuffer

    画像サンプルバッファー

    timestamp

    タイムスタンプ

  • ビットレートを設定します。

    Declaration

    Swift

    public func set(bitRate: Int)

    Parameters

    bitRate

    ビットレート

  • 画質を設定します。

    Declaration

    Swift

    public func set(encodeQuality: IntdashVideoEncodeQuality)

    Parameters

    encodeQuality

    画質

  • プロファイルを設定します。

    Declaration

    Swift

    public func set(profile: Profile)

    Parameters

    profile

    プロファイル

  • 割り当てを解除します。

    Declaration

    Swift

    public func dispose()