> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trelent.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Video processing config

> Tune frame sampling, sensitivity, and LLM usage for videos

`config.video` controls how the pipeline samples frames, and detects meaningful changes. Increased sensitivity will capture more images, and a lower sensitivity will capture less images.

<Note>
  Default fields are: `screenshot_interval_seconds` is `1`, `sensitivity` is `0.1`, `openai_model` is `gpt-4.1`, `whisper_model` is `whisper-1`. You only need to send fields you want to override.
</Note>

<CodeGroup>
  ```ts TypeScript theme={null}
  import type { JobInput } from "@trelent/data-ingestion";

  const job: JobInput = {
    connector: { type: "url", urls: ["https://signed.example.com/webinar.mp4"] },
    output: { type: "s3-signed-url" },
    config: {
      video: {
        screenshot_interval_seconds: 0.5,
        sensitivity: 0.15,
        openai_model: "gpt-4o-mini",
      },
    },
  };
  ```

  ```python Python theme={null}
  from trelent_data_ingestion_sdk.models import JobInput, UrlConnector, S3SignedUrlOutput, ProcessConfig, ProcessVideoConfig

  job = JobInput(
      connector=UrlConnector(urls=["https://signed.example.com/webinar.mp4"]),
      output=S3SignedUrlOutput(),
      config=ProcessConfig(
          video=ProcessVideoConfig(
              screenshot_interval_seconds=0.5,
              sensitivity=0.15,
              openai_model="gpt-4o-mini",
          ),
      ),
  )
  ```
</CodeGroup>

### Field reference

<ParamField path="config.video.screenshot_interval_seconds" type="number" default="1">
  Number of seconds between sampled frames. Lower values capture more context for fast-moving scenes; higher values save cost for static footage.
</ParamField>

<ParamField path="config.video.sensitivity" type="number" default="0.1">
  Normalized threshold for detecting visual changes. Raise it capture subtle transitions; lower it to ignore small changes.
</ParamField>

<ParamField path="config.video.openai_model" type="string" default="gpt-4.1">
  LLM used for visual reasoning and summarization. Pick a lighter model (for example, `gpt-4o-mini`) when you need lower latency.
</ParamField>

<ParamField path="config.video.whisper_model" type="string" default="whisper-1">
  Model used for audio transcription. Swap this if you require multilingual or domain-specific tuning. Model must support verbose\_json output format.
</ParamField>

<AccordionGroup>
  <Accordion title="Advanced SSIM tuning">
    Fine-tune how the system judges frame similarity. The `sensitivity` field will generate default values for these fields, however if you want more granular control you can override them manually.

    <ParamField path="config.video.tile" type="integer | null" default="null">
      Tile size for block-based comparisons. Leave `null` to use the default value tuned for general content.
    </ParamField>

    <ParamField path="config.video.mad_thresh" type="number | null" default="null">
      Mean absolute deviation threshold. Lower numbers capture subtle noise at the expense of more detections.
    </ParamField>

    <ParamField path="config.video.local_ssim_drop" type="number | null" default="null">
      Triggers when the local SSIM (structural similarity index) drops below the specified value. Helpful for scene-change detection.
    </ParamField>

    <ParamField path="config.video.max_bad_frac" type="number | null" default="null">
      Fraction of tiles that can cross the SSIM threshold before the frame counts as “changed.” Lower fractions make detection stricter.
    </ParamField>
  </Accordion>
</AccordionGroup>
