source
source(
path: String,
#{
cache?: String,
fps?: Rational,
vfr?: String,
format?: String,
track?: Int,
threads?: Int,
}
)
Creates a clip from an FFMS2-backed video source.
Relative source paths and relative cache paths resolve against the script
directory when one is known. If the source file does not report a usable frame
rate, you must supply fps. Variable-timestamp sources are normalized to CFR by
default, and vfr: "passthrough" is reserved but unsupported. When you do not
set cache, PixelFlow derives a default .ffms2.pfidx path automatically.
Examples
output = source("input.mkv")
output = source(
"input.mkv",
#{
cache: "custom.ffms2.pfidx",
fps: 24000/1001,
format: "yuv420p10",
track: 0,
threads: 4,
vfr: "normalize",
},
)
Input
A source file path plus optional FFMS2 indexing and decode options.
Output
A CFR clip decoded from the selected video track in the requested pixel format.
Options
cache(String) – Override the cache file path used for the FFMS2 index.fps(Rational) – Override the source frame rate when the file does not provide a usable one.vfr(String, default: implicit CFR normalization) – Select VFR handling; only"normalize"is accepted explicitly.format(String, default:"yuv420p8") – Select the output pixel format from the FFMS2source()pixel format subset.track(Int) – Select a specific zero-based video track; when omitted, PixelFlow uses the first indexed video track.threads(Int, default:1) – Set FFMS2 decode threads;0is clamped to1.