Skip to main content

media-import

media-import faithfully converts audio, video, documents, images, local folders, and direct HTTP(S) media URLs into an Obsidian-compatible Markdown corpus.

Docling is the sole media conversion engine. pro-ledin-ocr recognizes visual text in sampled video frames and image-based documents when needed.

pro-ledin-docling-ebook converts EPUB, FB2, FB2.ZIP, FBZ, MOBI, AZW, and AZW3 into native Docling documents. Ebook images can be referenced, skipped, or replaced with resumable OCR text.

Whisper Turbo remains the default transcription route. With transcription_provider=auto, the importer samples several short windows across the media and routes confidently Russian material to local GigaAM v3; uncertain or mixed-language material stays on Docling's multilingual Whisper route. Russian auto-routing falls back to Whisper with a warning when GigaAM is unavailable.

Install

Install the published package and verify the CLI:

python -m pip install pro-ledin-media-import
media-import --help

On macOS, install the system video dependencies separately:

brew install ffmpeg
ffmpeg -version
ffprobe -version

Install for development

uv sync --extra dev
uv run media-import --help

The development configuration resolves docling-gigaam and pro-ledin-docling-ebook from sibling checkouts. Published installations can install them explicitly:

python -m pip install 'docling-gigaam>=0.1,<0.2' 'pro-ledin-docling-ebook>=0.2,<0.3'

The published docling package supplies standard document support, while docling-slim[format-video] supplies the current video/ASR dependencies. The platform-appropriate Whisper backend is declared directly because it is also used by the automatic language detector: MLX Whisper on Apple Silicon and native Whisper on supported non-Apple Python versions. Docling media conversion and language sampling require ffmpeg and ffprobe. Model downloads are never started by inspect or --dry-run.

Workflow

uv run media-import inspect ./recordings --vault-root ~/vault --output-dir sources/demo
uv run media-import import ./recordings --vault-root ~/vault --output-dir sources/demo --dry-run
uv run media-import import ./recordings --vault-root ~/vault --output-dir sources/demo --confirmed
uv run media-import validate --output-dir ~/vault/sources/demo --source ./recordings
uv run media-import status --output-dir ~/vault/sources/demo

The first real import requires the exact dry-run plan to have been confirmed by the caller with --confirmed. An OpenCode agent should show the dry-run to the user before adding this flag.

Configuration

CLI arguments override environment variables, which override config.json. See config.example.json and references/routing.md.

The canonical environment prefix is MEDIA_IMPORT_. Credentials are never written to the manifest or included in cache-profile hashes.

To transcribe Russian media with GigaAM v3:

MEDIA_IMPORT_TRANSCRIPTION_PROVIDER=gigaam \
MEDIA_IMPORT_LANGUAGE=ru \
media-import inspect ./recordings --vault-root ~/vault --output-dir sources/demo

When no transcription model is explicitly configured, provider gigaam uses v3_e2e_rnnt; every other provider keeps the whisper_turbo default. GigaAM v3 accepts auto, ru, rus, or russian and rejects other explicit languages. The checksum-verified official model downloads into the media-import cache on first real conversion. Long recordings use local Silero long-form processing. No API token is required.

The package fallback for ebooks is referenced images. For per-book choices, write a JSON object keyed by the inventory source_path:

ebook-image-policies.json:

{
  "fiction/book.epub": "referenced",
  "reference/book.epub": "skip",
  "manual/book.epub": "ocr"
}
media-import import ./books --vault-root ~/vault --output-dir sources/books \
  --ebook-image-policies-file ebook-image-policies.json --dry-run --json

Use --ebook-image-policy skip to omit images. Use ocr to replace each image occurrence with recognized text; OCR requires --ebook-ocr-prompt (or prompt file), vision endpoint credentials, and explicit external-processing approval. The same --ebook-image-policies-file must be passed to the confirmed import. MOBI/AZW/AZW3 additionally require mobitool or Calibre ebook-convert.

Same-directory ebook files with the same basename are treated as format variants. The default canonical format order is epub,fb2,mobi,azw3,azw,fbz,fb2.zip; use --ebook-format-preference or MEDIA_IMPORT_EBOOK_FORMAT_PREFERENCE to change it. Variant content is not compared, and only the selected canonical source is converted.

Metadata

Release files for pro-ledin-media-import 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pro-ledin-media-import 0.2.0
File Size Uploaded
pro_ledin_media_import-0.2.0.tar.gz 375.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pro-ledin-media-import 0.2.0
File Interpreter ABI Platform
pro_ledin_media_import-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 435.1 kB

Release files / pro_ledin_media_import-0.2.0.tar.gz

Download URL pro_ledin_media_import-0.2.0.tar.gz
Size 375.3 kB
Tags Source
SHA-256 checksum
How to use checksums
67a968f75bc9048cfd943bcedf0287786887ae4a7f808aa563951413a54807b5
BLAKE2b-256 checksum
How to use checksums
d2d73c1b525e47ef2aafbf1dc697c429cf5689ba1dd0a0f4a3157475a1a9475d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 3, 2026.

Transparency log

Release files / pro_ledin_media_import-0.2.0-py3-none-any.whl

Download URL pro_ledin_media_import-0.2.0-py3-none-any.whl
Size 59.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
80972feefe8e991ef9ab37e40bae071fe0aea5d55570b58987d00516bd8ca6d2
BLAKE2b-256 checksum
How to use checksums
91ec09c259eeed4f923b65879a049ad485e9087e364a642e434843ffa00705d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 3, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.0

2 release files

This release

0.2.0 This release

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page