Nodes/Framerate Converter/Calc Conversion
ComfyUI Node

Calc Conversion

Calc Conversion — the math behind the framerate change, out in the open

By LaserDog80·Created 4 months ago·Updated 4 months ago· 0
Calc Conversion
    • conversion_params
    • summary
    source_fps24.000
    target_fps25.000
    methodspeed_change
    input_duration0.000
    input_frame_count0

    Converting 24 fps footage to 25 fps isn't just a one-line FFmpeg command - there's a decision hiding in it. Do you speed the whole clip up slightly (which changes the duration and pitch), or do you drop and duplicate frames to keep the runtime? Those are different operations with different consequences, and Calc Conversion is the node in the Framerate Converter pack (Trope Tools, TropeMedia) that works out the numbers for whichever approach you pick.

    It's a pure-math node: no FFmpeg, no filesystem, nothing to install beyond the pack itself. Feed it a source framerate, a target framerate, and a method, and it hands back a CONV_PARAMS bundle that Build Command uses to assemble the actual FFmpeg command. The top-level Convert Framerate node runs this calculation internally, so unless you're building a custom pipeline you might never touch it directly - but it's the brain of the whole pack.

    Inputs

    • source_fps and target_fps - floats, defaults 24 and 25, sensible 1–240 range. These usually come from Extract Media Info rather than being typed by hand.
    • method - the same four-way dropdown as the flagship node: speed_change, frame_drop, frame_blend, minterpolate. The math differs by method.
    • input_duration and input_frame_count - optional, feed from the probe. They let it predict the output duration and frame count, which is useful for sanity-checking.

    What it computes

    The core numbers: speed_factor = target ÷ source (how much faster/slower the clip will play), and pts_factor = source ÷ target (the PTS scaling applied to the video). For speed_change it also reports the expected percentage change in duration - 24→25 is about a −4% runtime change, which is the trade-off you're accepting for "keeps every frame, looks smooth."

    It does the math as fractions where it matters and gives you a summary string explaining it all:

    Method: speed_change
    Source FPS: 24.000 -> Target FPS: 25.000
    Speed factor: 1.041667x
    Duration change: -4.00%
    Expected output duration: 115.20s
    

    The conversion_params output is what matters for the graph; the summary is for your eyes, and it's genuinely nice for checking your mental model of what "24 to 25" actually does to a 2-minute clip.

    Install and usage

    Same pack install: ComfyUI Manager → Trope Tools - Framerate Converter, or git clone https://github.com/LaserDog80/ComfyUI-FramerateConverter into custom_nodes/ and restart. Zero extra dependencies.

    The honest framing: if the default speed_change method serves your use case, you don't need this node - the composite one does it all. Calc Conversion earns its place when you want the parameters visible, or when you're scripting the pipeline and want the duration change predicted before you commit to an encode. It's a small node that turns a fuzzy intuition ("changing fps changes how fast it plays, right?") into concrete numbers you can trust.

    CategoryTrope Tools/Framerate Converter/Configure

    Inputs (5)

    NameTypeDefaultDescription
    source_fpsFLOAT24.0001–240
    target_fpsFLOAT25.0001–240
    methodCOMBOspeed_change4 options: speed_change, frame_drop, frame_blend, minterpolate
    input_durationoptFLOAT0.0000–86400
    input_frame_countoptINT00–99999999

    Outputs (2)

    NameTypeDescription
    conversion_paramsCONV_PARAMS
    summarySTRING