opencontext-video
The OpenContext media processing worker. It ingests uploaded videos, still images, image sets, and PDFs, then runs the media-to-context pipeline: extracting audio and frames, rendering PDF pages, transcribing speech when present, applying vision and OCR, aligning results on a shared timeline, and producing evidence-linked developer context.
The worker polls the OpenContext API, processes jobs through resumable stages, and stores timestamped transcript, visual, and OCR evidence in the result payload. Text claims carry stable evidence IDs and certainty labels in both Markdown and JSON exports.
Install
pip install opencontext-video
For local speech recognition:
pip install "opencontext-video[local]"
The local extra pins PyAV below 19 because Faster Whisper 1.2.1 still passes
the removed metadata_errors argument to av.open(). Remove the pin after
Faster Whisper publishes a release compatible with PyAV 19+.
CLI
Analyze a local video without running the web app or database:
opencontext analyze video.mp4 --out context.md --json context.json
Still images use the same command and output contract:
opencontext analyze mockup.png --out context.md --json context.json
PDFs up to 30 pages use the same output contract and combine embedded text with rendered-page vision evidence:
opencontext analyze reference.pdf --out context.md --json context.json
The web upload flow can submit up to 10 images as one ordered image-set job with cross-image comparisons. CLI batch mode analyzes each file independently and keeps collision-safe per-file outputs.
Use --offline to run the full extraction and export path with clearly labeled
fixture transcription and vision output:
opencontext analyze video.mp4 --offline --out context.md --json context.json
The CLI accepts LOW, MEDIUM, or HIGH via --detail-level, and provider
overrides via --transcription-provider, --vision-provider, and
--text-provider.
Analyze every supported file in a directory:
opencontext analyze ./recordings --output-dir ./context --offline
Batch mode writes collision-safe <name>.md and <name>.json pairs and prints
a JSON summary with success and failure counts. It continues after an invalid
input, preserves outputs that already succeeded, and exits non-zero when any
item fails. Use --quiet to suppress the summary.
Turn an existing result into a repository-aware implementation brief:
opencontext brief context.json --repo ../my-app \
--task "Implement the recorded settings flow" --out implementation-brief.md
The brief preserves evidence IDs, detects repository languages and manifests, and separates observed behavior from inferred or uncertain claims.
Score a context result against a ground-truth evaluation item:
opencontext evaluate context.json \
--truth docs/evaluation/fixture-dataset.json \
--model-name fixture --model-version 1 \
--measurement-kind fixture-baseline --out evaluation.json
The report includes transcript WER/CER, OCR precision/recall/F1, and visual keyword recall. Fixture, smoke-test, and measured runs remain separately labeled.
Check the local runtime and configured providers before submitting a job:
opencontext doctor --offline
opencontext doctor --offline --json
The report labels each item OK, MISSING, or UNVERIFIED without printing
API keys or tokens. Network checks are opt-in with --check-network and use a
three-second timeout. --json emits one document containing an overall ok
value and ordered checks for setup scripts and CI preflight checks.
When configuring TRANSCRIPTION_PROVIDER=faster_whisper as in .env.example,
install the local extra alongside dev:
cd workers/processor
python -m venv .venv
# Windows
.venv/Scripts/python -m pip install -e ".[dev,local]"
.venv/Scripts/python -m oc_worker.main
# macOS/Linux
.venv/bin/python -m pip install -e ".[dev,local]"
.venv/bin/python -m oc_worker.main
Use --once to claim and process at most one job, which is useful for
integration tests and cron-style deployments:
python -m oc_worker.main --once
Set WORKER_API_TOKEN to the same value used by the web app before starting
the worker. Provider settings are read from the worker process environment.
Local providers
TRANSCRIPTION_PROVIDER=faster_whisperruns speech recognition locally; install thelocalextra and allow the first model download.TRANSCRIPTION_PROVIDER=openai_audiosends extracted WAV audio to an audio-capable OpenAI-compatible chat model through the sameOPENAI_BASE_URLand API-key settings used for hosted vision.VISION_PROVIDER=ollamaremains available for a local Ollama server.VISION_PROVIDER=openai_compatiblecan call OpenCode Go withOPENAI_BASE_URL=https://opencode.ai/inference/go/openai/v1,OPENCODE_API_KEY, and an image-capableVISION_MODEL. Each claimed job receives an independentx-opencode-sessionidentifier so one job cannot exhaust another job's session quota or share conversation state.VISION_PROVIDER=geminiusesGEMINI_API_KEY, an image-capableVISION_MODEL, andGEMINI_BASE_URLfor native Gemini image analysis.VISION_TIMEOUT_SECONDSbounds the request.VISION_CONCURRENCYbounds simultaneous image analysis calls. Use1for rate-limited upstream accounts. Transient provider errors retry up to three times with short backoff. A longerRetry-Afterdefers the whole job so the worker can continue with other queued work.VISION_MAX_FRAMESsets the maximum number of evenly sampled video/PDF frames sent to the vision provider per job (default 60). Image sets are already limited to 10 source images.OCR_PROVIDER=tesseractextracts text independently with the local Tesseract binary.OCR_PROVIDER=visionkeeps the compatibility behavior of deriving OCR rows from the vision provider'svisibleText.TRANSCRIPTION_PROVIDER=fixtureandVISION_PROVIDER=fixtureprovide deterministic, clearly labeled output for offline tests. They do not run speech recognition or computer vision and should not be used to claim real analysis quality.
The generated-media integration tests in tests/test_e2e_fixture.py invoke
real FFmpeg and PDFium for probing, audio and frame extraction, still-image
conversion, image sets, and PDF page rendering, while using fixture providers
for inference.
Real OpenCode Go vision smoke test
The hosted vision test is opt-in because it calls an external API:
export OPENCODE_API_KEY=...
export OPENAI_BASE_URL=https://opencode.ai/inference/go/openai/v1
export VISION_MODEL=hy4-flash-free
OPENCONTEXT_OPENCODE_E2E=1 pytest tests/test_opencode_vision_smoke.py -q
The test verifies the model catalog accepts image input, analyzes a generated frame, and runs a synthetic checkout reference through the full image pipeline. It requires the model to recover at least two of the expected UI/OCR labels. This is a setup smoke test, not evidence of broad model quality.
Real OpenCode Go audio smoke test
export OPENCODE_API_KEY=...
export OPENAI_BASE_URL=https://opencode.ai/inference/go/openai/v1
export TRANSCRIPTION_MODEL=mimo-v2.6-pro
OPENCONTEXT_OPENCODE_AUDIO_E2E=1 pytest tests/test_opencode_audio_smoke.py -q
This checks model-catalog audio support and transcribes the attributed Harvard
sentence recording committed under docs/evaluation/.
MCP server
Install the agent extra:
pip install "opencontext-video[agent]"
opencontext-mcp
The stdio MCP server exposes:
analyze_media— analyze a local video or image and return an evidence-linked brief.analyze_videoandanalyze_image— explicit compatibility entry points.implementation_brief— convert an existing context JSON result into a brief.context_evidence— return the bounded evidence ledger.
Example client configuration:
{
"mcpServers": {
"opencontext": {
"command": "opencontext-mcp",
"args": []
}
}
}
Metadata
Release files for opencontext-video 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| opencontext_video-0.1.1.tar.gz | 112.1 kB | With provenance | Details for opencontext_video-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| opencontext_video-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for opencontext_video-0.1.1-py3-none-any.whl |
Total release size: 193.8 kB
Release files / opencontext_video-0.1.1.tar.gz
| Download URL | opencontext_video-0.1.1.tar.gz |
|---|---|
| Size | 112.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ffa164b34bd627f076f7209a95c747b46606c68a07e286c96e894ada617a0332
|
|
BLAKE2b-256 checksum How to use checksums |
b36d9fa30f191c0efbce21c9c2538787b763600776f25e33b528192670bcdf10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logRelease files / opencontext_video-0.1.1-py3-none-any.whl
| Download URL | opencontext_video-0.1.1-py3-none-any.whl |
|---|---|
| Size | 81.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
58eadb883e06daa0e6a749684362d368273f9745a1ef45ffcf250d65412378f8
|
|
BLAKE2b-256 checksum How to use checksums |
db8fc7ee2ad4d4510bcb90b415cfc672fdc61e78254a0e40fe47bd41e2c6cdf0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logSecurity for opencontext-video 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for opencontext_video-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.