Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Automating Invoice Data Extraction with PipeWire and Tesseract on My Home Server

Описание и применение

Автоматизация извлечения данных из скриншотов счетов с помощью PipeWire, ffmpeg, Tesseract и Node.js на домашнем сервере.

Задача

Digitize vendor invoice screenshots into searchable data without expensive software.

Результат

Invoices are automatically captured, OCRed, and stored, eliminating manual transcription.

Рабочий процесс

  • Install Ubuntu 22.04 LTS on home server
  • Ensure PipeWire and pipewire-tools are installed
  • Install Tesseract 5 and language data
  • Install Node.js 20 and MySQL 8
  • Use pw-record with ffmpeg to capture a 800×600 region at (100,200) for 1 second and output a single PNG
  • Create Node.js module ocr.js that spawns pw-record and ffmpeg, collects PNG buffer
  • Spawn tesseract via child_process, pipe PNG buffer to stdin, capture OCR output
  • Insert OCR text into MySQL table for admin panel use

Доказательства

PipeWire replaces the old X11 xwd workflow and works under Wayland out of the box.

Источник

The command above produces a series of PNG frames on stdout. For my use‑case I only need the first frame, so I add -vframes 1:

Источник

I keep the OCR step in a separate Node.js module so I can call it from my API or a cron job.

Источник

  • Дата записи: 2026-11-02T14:14:09.869Z