Skip to content
HALOWERK

Tonwerk

caption contrast

Takes up to max_frames evenly spaced frames from the region (bottom third by default) at up to 1280 px width, finds text lines with Tesseract 5.3.4 (confidence at least min_confidence), and splits each line box into a text and a background class with Otsu's threshold on luma; the smaller class is the text. Text colour is the median of the inner text pixels (the darker or brighter half away from the threshold, to avoid anti-aliasing), background colour the median of the background pixels;.

POST https://ton.halowerk.com/v1/caption-contrast

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
video_base64stringNoThe video as base64 (MP4/MOV, WebM/MKV, AVI, MPEG-TS, MPEG-PS, FLV, Ogg or animated GIF; at most 10 MiB decoded; a data: URL prefix is accepted).
video_urlstringNoPublic http(s) URL of the the video (at most 10 MiB; private, local and reserved addresses are refused).
start_snumberNoStart of the analysed range in seconds.
duration_snumberNoLength of the analysed range in seconds (at most 600; default: to the end of the video).
regionstringNoPart of the picture searched for text.
max_framesintegerNoFrames analysed, evenly spaced over the range.
languagestringNoTesseract language data.
min_confidencenumberNoLowest mean word confidence of a text line.
large_textbooleanNoRate as large text (3:1 AA, 4.5:1 AAA) instead of normal text (4.5:1 AA, 7:1 AAA).
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "video_base64": {
      "type": "string",
      "minLength": 16,
      "maxLength": 14000000,
      "description": "The video as base64 (MP4/MOV, WebM/MKV, AVI, MPEG-TS, MPEG-PS, FLV, Ogg or animated GIF; at most 10 MiB decoded; a data: URL prefix is accepted)."
    },
    "video_url": {
      "type": "string",
      "format": "uri",
      "pattern": "^https?://",
      "maxLength": 2048,
      "description": "Public http(s) URL of the the video (at most 10 MiB; private, local and reserved addresses are refused)."
    },
    "start_s": {
      "type": "number",
      "minimum": 0,
      "maximum": 36000,
      "default": 0,
      "description": "Start of the analysed range in seconds."
    },
    "duration_s": {
      "type": "number",
      "exclusiveMinimum": 0,
      "maximum": 600,
      "description": "Length of the analysed range in seconds (at most 600; default: to the end of the video)."
    },
    "region": {
      "type": "string",
      "enum": [
        "bottom_third",
        "top_third",
        "full"
      ],
      "default": "bottom_third",
      "description": "Part of the picture searched for text."
    },
    "max_frames": {
      "type": "integer",
      "minimum": 1,
      "maximum": 8,
      "default": 4,
      "description": "Frames analysed, evenly spaced over the range."
    },
    "language": {
      "type": "string",
      "enum": [
        "eng",
        "deu",
        "deu+eng"
      ],
      "default": "eng",
      "description": "Tesseract language data."
    },
    "min_confidence": {
      "type": "number",
      "minimum": 0,
      "maximum": 100,
      "default": 60,
      "description": "Lowest mean word confidence of a text line."
    },
    "large_text": {
      "type": "boolean",
      "default": false,
      "description": "Rate as large text (3:1 AA, 4.5:1 AAA) instead of normal text (4.5:1 AA, 7:1 AAA)."
    }
  }
}

Open original schema

Published input example

{
  "video_base64": "R0lGODlh8ABAAPf/MVVVVVtbW2hoaHNzc3p6eoiIiJqamqmpqbKyssDAwM7OzuLi4vDw8Pj4+P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wD/ACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFMgAPACwAAAAA8ABAAINVVVVbW1toaGhzc3N6enqIiIiampqpqamysrLAwMDOzs7i4uLw8PD4+Pj///8A/wAI/wABCBxIsKDBgwgTKlzIsKHDhxAjSpxIsaLFixgzatzIsaPHjyBDihxJsqTJkyhTqlzJsqXLlzBjypxJs6bNmzhz6tzJs6fPn0CDCh1KtKjRo0iTKl3KtKnTp1CjSp1KtarVq1izat0qUcCBr18FFAT7tQDXpwPIHiCwsIBasRkJOJg71yzBBnQdIDjrtEBeBwYWIvg7QKPcvHYH4qW7ly9Tv3kDKxyct3Dcv4kFLp7b2LFSyHQlJ6RM1zLGw3QzA9is1/NS0HNFIyQ91/RF1HULsu7s+ihswIIJG8asOy/v3kV/yz5I24FtgwMMGDhggECAhLgdqN69cECB6QYKPP9HHlN58MoHAxxg8NdBAwTXDWbfbhyhevbtGSCASx6m+cnCFUQAfu3NxcB48xXH2EEFsFZgA8v1t9J/owU4EAEOFsgAfwIleFd9BRlQ4IgHSOgShbNZCEAABDrAgAHXDaBAXgoISNyHCxKE4V8KhGfAjDeaqNJvCqhl5AIqHvAXWwMFgGRqOgapGYgDPRlaQb8tIOSEI3bZnm0tJmAQbDVeKOVqVALwm5gGNafaliT95uWIpmUXIZpzNRAfAB4qlmYCKg40wF9swmmSnHN+OZCI6BlkpQNM8nkmdwO1qCVClhp6EqKJNgpAcwgYecCjovU5ZY4r8pgQkHRpeiihBcT/KuusBbBa20CAdppXiR1OSqUAhK76156uhoQicxbaqmtnpuLJmaDBIpQrXRwW+9GxbVo4bZ4NdOvtt90y6yuqwOZVqEHKEmutR9gW1JxpzVW7ULOUpkqjsHQ1sK5I7RL07qKBzjvus5XmxUBCme4LUr8D/SvQoJFBRO+fAUuapsIcMSyQwwK1WGaI4REgwJ4To6pmtAVtCynG1/51p79JuhxiXnqaiZiCBFd5JqN0fcxyxjID6OmKLTqQgHgFqMxrrzfjmHOHDh79nbINjPczRhp/GmiDnfpsMZROtzZzpw28eTXWQVc4NNRzKqBuyU8PxLWXDER69kZZc0xQAAgUVT3XAmbDLbZBfPvtwAIHqHt3RmmRZTeDbylEgHTUFSDvQF6RVa1aZhMUHXiWLy766KSXbvrpqKeu+uqst+7667DHLvvstNdu++2456777rz37rtjAQEAIfkEBTIA/wAs7wA/AAEAAQAACAQA/wUEADs=",
  "region": "full",
  "max_frames": 1
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub โ†’