72 lines
3.1 KiB
Makefile
72 lines
3.1 KiB
Makefile
# meetus — convenience wrapper around ctrl/batch.sh (adhoc tool, nothing
|
|
# standardized here; this just saves typing the batch flags).
|
|
#
|
|
# make batch IN="/mnt/win/trainings" # outputs next to sources
|
|
# make batch IN="..." AUDIO_LANG=es # set audio language
|
|
# make batch IN="..." OUT=output/run1 # collect outputs elsewhere
|
|
# make batch IN="..." EXTRA="--skip-cache-whisper" # one-off extra flags
|
|
# make dry IN="..." # list what would run
|
|
# make batch IN="..." EXT="mp4 mov" # limit extensions
|
|
# make batch IN="..." FLAGS="--embed-images" # replace the base flags
|
|
#
|
|
# IN is required. OUT defaults to IN (write in place); otherwise the input
|
|
# folder structure is mirrored under OUT.
|
|
|
|
IN ?=
|
|
# Default: write outputs next to the source files (run folders land in the same
|
|
# dir as each video/audio). Pass OUT=... to collect them elsewhere instead.
|
|
OUT ?= $(IN)
|
|
|
|
# The base combo used on every run. LANG/EXTRA below add to this without
|
|
# needing to retype it; override FLAGS only to change the base itself.
|
|
FLAGS ?= --embed-images --scene-detection --scene-threshold 10 --diarize --transcript-formats srt
|
|
|
|
# Per-run knobs (appended after FLAGS): language, plus any one-off extra flags
|
|
# (e.g. --skip-cache-whisper, --transcript-formats srt).
|
|
# NB: named AUDIO_LANG, not LANG — LANG is the shell locale env var.
|
|
# Defaults to English; override (e.g. AUDIO_LANG=es) for other languages.
|
|
AUDIO_LANG ?= en
|
|
EXTRA ?=
|
|
|
|
# Optional: restrict scanned extensions / pick the python interpreter.
|
|
EXT ?=
|
|
PYTHON ?=
|
|
export PYTHON
|
|
|
|
# Optional: process only a newline list of RELATIVE paths (re-rooted at IN),
|
|
# e.g. the doocus meeting export. Used to run meetus over just the meetings:
|
|
# make batch IN="/mnt/drive" OUT=docs-output LIST=docs-output/meetings.txt
|
|
LIST ?=
|
|
|
|
# doocus (tree indexing) knobs. DOCS_OUT defaults to docs-output; the whole input
|
|
# tree is replicated into index.json under it. DOC_EXTRA forwards one-off flags to
|
|
# process_tree.py (e.g. --render for pdf page thumbnails, --ocr for scanned pdfs).
|
|
DOCS_OUT ?= docs-output
|
|
DOC_EXTRA ?=
|
|
|
|
# Python interpreter for doocus (override PYTHON, else python3 — use `uv run make`).
|
|
PY := $(if $(PYTHON),$(PYTHON),python3)
|
|
|
|
.PHONY: batch dry docs docs-dry help
|
|
|
|
batch:
|
|
@ctrl/batch.sh -i "$(IN)" -o "$(OUT)" $(if $(EXT),-e "$(EXT)") $(if $(LIST),-l "$(LIST)") -- \
|
|
$(FLAGS) $(if $(AUDIO_LANG),--language $(AUDIO_LANG)) $(EXTRA)
|
|
|
|
dry:
|
|
@ctrl/batch.sh -i "$(IN)" -o "$(OUT)" $(if $(EXT),-e "$(EXT)") -n
|
|
|
|
# Document indexing (doocus): replicate the whole IN tree into DOCS_OUT/index.json,
|
|
# extracting text sidecars only for docx/pdf/pptx/xlsx.
|
|
# uv run make docs IN="/mnt/win/drive" # index the tree
|
|
# uv run make docs IN="..." DOC_EXTRA="--ocr" # + OCR scanned pdfs
|
|
# make docs-dry IN="..." # counts only, no writes
|
|
docs:
|
|
@$(PY) process_tree.py "$(IN)" --output "$(DOCS_OUT)" $(DOC_EXTRA)
|
|
|
|
docs-dry:
|
|
@$(PY) process_tree.py "$(IN)" --output "$(DOCS_OUT)" --dry-run
|
|
|
|
help:
|
|
@sed -n '3,14p' Makefile
|