AVStream

public final class AVStream

Stream structure.

  • Stream index in AVFormatContext.

    Declaration

    Swift

    public var index: Int { get }
  • id

    Format-specific stream ID.

    • encoding: Set by the user, replaced by libavformat if left unset.
    • decoding: Set by libavformat.

    Declaration

    Swift

    public var id: Int32 { get set }
  • This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.

    • encoding: May be set by the caller before AVFormatContext.writeHeader(options:) to provide a hint to the muxer about the desired timebase. In AVFormatContext.writeHeader(options:), the muxer will overwrite this field with the timebase that will actually be used for the timestamps written into the file (which may or may not be related to the user-provided one, depending on the format).
    • decoding: Set by libavformat.

    Declaration

    Swift

    public var timebase: AVRational { get set }
  • pts of the first frame of the stream in presentation order, in stream timebase.

    Declaration

    Swift

    public var startTime: Int64 { get }
  • Undocumented

    Declaration

    Swift

    public var duration: Int64 { get }
  • Number of frames in this stream if known or 0.

    Declaration

    Swift

    public var frameCount: Int { get }
  • Selects which packets can be discarded at will and do not need to be demuxed.

    Declaration

    Swift

    public var discard: AVDiscard { get set }
  • sample aspect ratio (0 if unknown)

    • encoding: Set by user.
    • decoding: Set by libavformat.

    Declaration

    Swift

    public var sampleAspectRatio: AVRational { get }
  • The metadata of the stream.

    Declaration

    Swift

    public var metadata: [String : String] { get set }
  • Average framerate.

    Declaration

    Swift

    public var averageFramerate: AVRational { get set }
  • Real base framerate of the stream. This is the lowest framerate with which all timestamps can be represented accurately (it is the least common multiple of all framerates in the stream). Note, this value is just a guess! For example, if the timebase is 1/90000 and all frames have either approximately 3600 or 1800 timer ticks, then realFramerate will be 50/1.

    Declaration

    Swift

    public var realFramerate: AVRational { get }
  • Codec parameters associated with this stream.

    Declaration

    Swift

    public var codecParameters: AVCodecParameters { get }
  • The media type of the stream.

    Declaration

    Swift

    public var mediaType: AVMediaType { get }