# Fix Subtitle Timing and Drift

**Use case:** 

Fix subtitle delay or gradual timing drift in SRT, VTT, ASS, or SSA files. Paste your subtitle text, choose a simple offset or two-point resync, and export corrected subtitles.

## Input

```json
{
  "subtitleText": "1\n00:00:02,000 --> 00:00:05,000\nWelcome to this subtitle timing example.\n\n2\n00:00:15,000 --> 00:00:18,000\nThis subtitle gradually moves out of sync.\n\n3\n00:00:30,000 --> 00:00:34,000\nWe can correct both delay and timing drift.\n\n4\n00:00:55,000 --> 00:00:59,000\nThe corrected file will stay aligned to the video.",
  "pastedFileName": "pasted-subtitles.srt",
  "outputFormats": [
    "srt"
  ],
  "subtitleUrls": [],
  "offsetMs": 0,
  "sourceFps": "",
  "targetFps": "",
  "useAnchorSync": true,
  "anchorObservedA": "00:00:02,000",
  "anchorDesiredA": "00:00:03,000",
  "anchorObservedB": "00:00:55,000",
  "anchorDesiredB": "00:01:00,000",
  "dropNegativeCues": false,
  "keepLineBreaksInTxt": false
}
```

## Output

```json
{
  "file": {
    "label": "File"
  },
  "detectedFormat": {
    "label": "Detected format"
  },
  "cueCount": {
    "label": "Cues"
  },
  "retiming": {
    "label": "Retiming applied"
  },
  "clampedCues": {
    "label": "Clamped"
  },
  "droppedCues": {
    "label": "Dropped"
  },
  "outputs": {
    "label": "Files written"
  },
  "error": {
    "label": "Error"
  }
}
```

## About this Actor

This example demonstrates how to use [Subtitle Converter & Resync — SRT/VTT/ASS](https://apify.com/lumaxys/subtitle-converter-and-resync.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/lumaxys/subtitle-converter-and-resync.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
This Task's input is already configured above — use it as-is rather than inventing a new one.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/lumaxys/subtitle-converter-and-resync.md

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).
