Skip to content

Bug: SRT output is empty when using fast/auto mode with subtitle area selection #458

Description

@minh-vt

Severity: Critical (silent data loss — produces 0-byte SRT)

Description

When running in fast or auto mode with a subtitle area rectangle drawn on the video, the output .srt file is 0 bytes. The log output shows all frames processed but every result is dropped:

× Confidence: 99.7% Result: 好烫 Drop reason: Out of selection
× Confidence: 99.9% Result: 来看我的旷世神作 Drop reason: Out of selection

The OCR is working correctly (99-100% confidence), but the subtitle area filter rejects everything.

Root cause

The extract_frame_by_vsf method in backend/main.py crops frames to the subtitle area before sending them to the OCR worker. The OCR's extract_subtitles function then compares detection coordinates (relative to the cropped image, e.g., y=0..150) against the original full-frame subtitle area (e.g., ymin=562, ymax=713). The coordinate systems don't match, so the AABB intersection check always fails.

Reproduction

  1. Open any video with subtitles
  2. Draw a subtitle area rectangle on the preview
  3. Run in fast or auto mode (default)
  4. Output SRT is empty

Workaround

Set subtitle area to "Full Screen" (no rectangle), or use accurate mode.

Fix

In start_subtitle_ocr_async, don't pass sub_area for filtering when VSF is used — VSF already handles filtering by cropping. Pass None for VSF mode, keep the subtitle area for DET/FPS modes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions