Skip to content

Subtitle Fps Convert API

POST https://api.findutils.com/api/tools/subtitle-fps-convert/execute

Rescale every cue in a SubRip (.srt) or WebVTT (.vtt) caption file from one frame rate to another, so a track that slowly drifts out of sync after a frame-rate conversion lines up again. Each timestamp is multiplied by source_fps divided by target_fps: going from 23.976 to 25 makes the file play about 4 percent shorter, and the mismatch that was a second at the ten-minute mark becomes several seconds by the end. This is the drift a fixed offset cannot fix, because the error grows with time rather than staying constant. The output keeps the input format, cue text, order and WebVTT cue settings. Use subtitle_shift instead when the whole track is early or late by a constant amount.

Request body

application/json
  • input

    string required

    Caption file contents, either SubRip or WebVTT.

  • source_fps

    number required

    The frame rate the caption timings were written for, e.g. 23.976. Between 1 and 1000.

  • target_fps

    number required

    The frame rate of the video the captions must match, e.g. 25. Between 1 and 1000, and different from source_fps.

Example arguments

Verified
{
  "input": "1\n00:00:10,000 --> 00:00:12,000\nTen seconds in.\n\n2\n01:00:00,000 --> 01:00:02,000\nAn hour in, where the drift shows.\n",
  "source_fps": 23.976,
  "target_fps": 25
}