Tutorial · Tutorial · Node.js

Interpolate Video to 60fps in Node.js

A complete Node.js workflow for 24→60fps and 30→60fps interpolation: submit the job, wait for the callback, download the smooth result. No GPU, no CUDA, no Python.

Node.jsFrame interpolation60fps

Step 1 — Setup

Node.js
npm install mlslabs

// or plain fetch — Node 18+ works too
const MLSLABS_API = "https://api.mlslabs.io/v1";
const API_KEY = "YOUR_API_KEY";

Step 2 — Submit the interpolation job

Node.js
const resp = await fetch(`${MLSLABS_API}/frame-interpolation/jobs`, {
  method: "POST",
  headers: {
    "X-API-Key": API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    input: "s3://bucket/clip-24fps.mp4",
    output: "s3://bucket/out/",
    target_fps: 60,
    preset: "cinema",
  }),
});
const job = await resp.json();
console.log(job.job_id);

Step 3 — Poll until done

Node.js
async function waitForJob(jobId) {
  for (;;) {
    const r = await fetch(`${MLSLABS_API}/frame-interpolation/jobs/${jobId}`, {
      headers: { "X-API-Key": API_KEY },
    });
    const st = await r.json();
    if (st.status === "done") return st.output;
    if (st.status === "failed") throw new Error("job failed — credits auto-refunded");
    await new Promise((res) => setTimeout(res, 2000));
  }
}
const output = await waitForJob(job.job_id);
console.log("60fps file:", output.url);

Step 4 — Verify the output

Node.js
// ffprobe the result
// $ ffprobe -show_streams out-60fps.mp4 | grep -E "r_frame_rate|nb_frames"
// r_frame_rate=60/1  -> success

Production notes

  • Use webhooks instead of polling for long batches
  • Scene-change detection is automatic — no chapter splits needed
  • For film, keep the 24fps cadence unless the target is HFR
  • Batch: submit all jobs first, then wait on webhooks

FAQ

Common questions

Does it work on 30fps content?

Yes — target_fps=60 on 30fps input gives 2× interpolation. Custom ratios are supported for any source frame rate.

How fast is a typical clip?

Wall-clock depends on duration and resolution; a 3-minute 1080p clip typically completes in a few minutes of processing.

Can I keep audio in sync?

Yes — interpolation only adds frames; the audio track is copied with unchanged timing.