Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

convert_format

convert_format(
  input: Clip,
  #{
    format: String,
    range?: String,
    matrix?: String,
    transfer?: String,
    primaries?: String,
    chroma_siting?: String,
    source_range?: String,
    source_matrix?: String,
    source_transfer?: String,
    source_primaries?: String,
    source_chroma_siting?: String,
  }
)

Changes a clip’s pixel format without changing its resolution or timing.

The input must be one fixed-format planar Gray, YUV, or planar RGB clip. convert_format can change family and subsampling, but it cannot change bit depth or sample storage type; use convert_bit_depth first when needed. Cross-family conversions depend on correct source color metadata or explicit source_* overrides, and some target or source metadata axes are only valid for certain families. Planar RGB to YUV or Gray conversion also requires a target matrix.

Examples

output = source("input.mkv").std.convert_format(#{ format: "yuv444p10" })
output = source("input.mkv").std.convert_format(#{
    format: "rgbp10",
    source_matrix: "bt709",
    source_transfer: "bt1886",
    source_primaries: "bt709",
})

Input

One fixed-format planar Gray, YUV, or planar RGB clip.

Output

A clip with the requested pixel format, the same resolution and timing, and metadata preserved or normalized for the output family.

Options

  • format (String) – Select the target pixel format. See Pixel format strings.
  • range (String) – Override the target output range.
  • matrix (String) – Override the target output matrix. See Matrix coefficients strings.
  • transfer (String) – Override the target output transfer characteristic. See Transfer characteristic strings.
  • primaries (String) – Override the target output color primaries. See Color primaries strings.
  • chroma_siting (String) – Override the target output chroma siting.
  • source_range (String) – Override the source range metadata used during conversion.
  • source_matrix (String) – Override the source matrix metadata used during conversion. See Matrix coefficients strings.
  • source_transfer (String) – Override the source transfer metadata used during conversion. See Transfer characteristic strings.
  • source_primaries (String) – Override the source primaries metadata used during conversion. See Color primaries strings.
  • source_chroma_siting (String) – Override the source chroma siting metadata used during conversion.