Vixen
02b45cc4
csharp
public readonly record struct VideoRational

An exact frame rate, as the ratio it actually is.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

A rational rather than a , because the rates that matter are not representable: NTSC is 30000/1001, which is 29.97002997… and never 29.97. A player that rounds it drifts by a frame every thirty-three seconds, which over a two-hour film is two hundred frames — audio and video visibly apart.

Zero denominator means "the container did not say", which is ordinary: WebM stores a per-block timestamp and is under no obligation to state a rate at all. Timing comes from the timestamps; this is for the things that want a nominal rate, such as a UI that shows one.

Fields and properties (9)

  • public int Numerator

    Frames.

  • public int Denominator

    Per this many seconds' worth of ticks.

  • public static VideoRational Cinema24

    Film.

  • public static VideoRational Ntsc30

    NTSC, exactly. Not 29.97.

  • public static VideoRational Pal50

    PAL, and what most game capture is.

  • public static VideoRational Unknown

    The rate nothing stated.

  • public bool IsKnown

    Whether it describes a rate at all.

  • public double Hz

    The rate as a number, for display and for budgets. Zero if unknown.

  • public TimeSpan FrameDuration

    How long one frame lasts, or zero if the rate is unknown.

Methods (1)

  • public VideoRational(int Numerator, int Denominator)

    An exact frame rate, as the ratio it actually is.

Used by (10)

  • VideoGameVideoPlayback
  • StepDecoderVixen.Video.Tests
  • VideoClipVixen.Video
  • VideoFormatVixen.Video
  • VideoPlayerVixen.Video
  • VideoTrackInfoVixen.Video
  • WebMVideoStreamDecoderVixen.Video
  • WebMVideoStreamDecoderTestsVixen.Video.Tests
  • VideoImporterVixen.Editor.Assets
  • VideoImporterTestsVixen.Editor.Assets.Tests