Skip to main content

A simple tool to make the video, audio, subtitle and video-url (especially youtube) content into a written markdown files with the ability to rewritten the oral expression into written ones, or translating the content into a target language by using LLM.

Project description

Wenbi

Wenbi converts media and text into structured Markdown, then rewrites or translates it.

It supports:

  • Video/audio/URL transcription to VTT/Markdown
  • Text rewriting (rewrite, academic style)
  • Translation (translate) with DeepL first, then LLM fallback
  • English interview rewriting (en-en) with speaker-separated output
  • Chinese interview rewriting (zh-zh) with speaker-separated output
  • PPT-style slide + speech combination (ppt)
  • Batch directory processing (wenbi-batch)

Install

Prerequisites:

  • Python 3.10+
  • ffmpeg in PATH

Install:

pip install wenbi

Or from a local checkout:

# from the project directory
pip install -e .

Quick Start

Rewrite:

wenbi rewrite input.mp4 --lang Chinese --llm ollama/qwen3.5:cloud

Translate (DeepL first):

wenbi translate input.md --lang Chinese --deepl-key "$DEEPL_API_KEY"

English interview rewrite:

wenbi en-en interview.mp4 --gladia-key "$GLADIA_API_KEY"

Chinese interview rewrite:

wenbi zh-zh interview.mp4 --gladia-key "$GLADIA_API_KEY"

PPT workflow:

wenbi ppt lecture.mp4 --lang English

Commands

rewrite (rw)

Rewrite spoken/transcribed text into written style.

wenbi rewrite <input> [options]

Key options:

  • --style rewrite|academic
  • --lang
  • --llm
  • --cite-timestamps
  • --start-time, --end-time (media/URL)

translate (tr)

Translate content to a target language.

wenbi translate <input> --lang <target> [options]

Key options:

  • --deepl-key (or DEEPL_API_KEY env var)
  • --llm (fallback model)
  • --keep-original-lang
  • --cite-timestamps

Translation behavior

translate uses this order:

  1. Try DeepL API first (when key is available).
  2. If DeepL is unavailable or chunk translation fails, fallback to LLM.

If both DeepL and LLM are unavailable, translation cannot complete successfully.

en-en (enen)

Transcribe an English interview, separate speaker turns, and rewrite it as polished written English using ollama/qwen3.5:cloud by default.

wenbi en-en <input> [options]

Key options:

  • --speaker-count (default: 2)
  • --asr-provider auto|gladia|sensevoice|whisper
  • --gladia-key (or GLADIA_API_KEY env var)
  • --llm (default: ollama/qwen3.5:cloud)
  • --start-time, --end-time (media/URL)

The rewrite preserves speaker labels and adds a ## Questions for Clarification section when speaker roles, names, terms, or ambiguous ASR phrases need human confirmation.

zh-zh (zhzh)

Transcribe a Chinese interview, separate speaker turns, and rewrite it as polished written Chinese using ollama/qwen3.5:cloud by default.

wenbi zh-zh <input> [options]

Key options:

  • --speaker-count (default: 2)
  • --asr-provider auto|gladia|sensevoice|whisper
  • --gladia-key (or GLADIA_API_KEY env var)
  • --llm (default: ollama/qwen3.5:cloud)
  • --start-time, --end-time (media/URL)

The rewrite preserves speaker labels and adds a ## 需要确认的问题 section when speaker roles, names, terms, or ambiguous ASR phrases need human confirmation.

ppt (p)

Extract slides from video, align with speech, and export combined markdown.

wenbi ppt <video_or_url> [options]

Key options:

  • --frame-interval
  • --cropped-slide [auto|x0,y0,x1,y1]
  • --ppt <ppt/pdf/image/odp>
  • --no-ocr
  • --no-clean
  • --ssim-threshold, --hist-threshold, --dedup-method

Supported Inputs

  • Media: .mp4 .avi .mov .mkv .flv .wmv .m4v .webm .mp3 .flac .aac .ogg .m4a .opus
  • Text/subtitles: .vtt .srt .ass .ssa .sub .smi .txt .md .markdown .docx
  • URL inputs are supported for media flows.

Common Global Options

Used by subcommands:

  • --output-dir
  • --lang
  • --llm
  • --chunk-length
  • --max-tokens
  • --timeout
  • --temperature
  • --transcribe-model
  • --transcribe-lang
  • --multi-language
  • --verbose

Output Files

Typical outputs:

  • *_rewritten.md
  • *_translated.md
  • *_academic.md
  • *_en.md, *_en.vtt (English interview transcripts)
  • *_zh.md, *_zh.vtt (Chinese interview transcripts)
  • *_combine.md / *_combine_clean.md (PPT workflows)
  • *.vtt, *.csv (depending on flow)

Batch Processing

Process a directory of media files:

wenbi-batch <input_dir> --output-dir <dir> --md

Optional config:

wenbi-batch <input_dir> --config config.yaml

YAML Config (CLI)

wenbi supports YAML via --config.

Example:

input: lecture.mp4
output_dir: ./out
llm: ollama/qwen3.5:cloud
lang: Chinese
chunk_length: 20

Multi-input format is also supported using inputs:.

Python API

from wenbi.main import process_input

text, md_file, csv_file, base_name = process_input(
    file_path="input.mp4",
    subcommand="translate",
    lang="Chinese",
    use_deepl=True,
    deepl_key="<DEEPL_KEY>",
    llm="ollama/qwen3.5:cloud",
)

Troubleshooting

  • No DeepL translation output:
    • Set DEEPL_API_KEY or --deepl-key
    • Run with --verbose to confirm DeepL connectivity
  • Fallback LLM not working:
    • Ensure your provider is reachable (for example, Ollama running locally for ollama/...)
  • PPT OCR issues:
    • Ensure marker_single and OCR dependencies are installed correctly

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wenbi-0.141.0.tar.gz (4.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wenbi-0.141.0-py3-none-any.whl (98.2 kB view details)

Uploaded Python 3

File details

Details for the file wenbi-0.141.0.tar.gz.

File metadata

  • Download URL: wenbi-0.141.0.tar.gz
  • Upload date:
  • Size: 4.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.1

File hashes

Hashes for wenbi-0.141.0.tar.gz
Algorithm Hash digest
SHA256 37f3942edfa8488a9397c788fe9d564d4f28a80b176aab74c407df701e4ca833
MD5 5c6f440466cc634e520a3f850a276016
BLAKE2b-256 2bcf36e7b8dfa3ee0fa19b5ffc12a6954fcd99b9272240dea8a550bda08ba22e

See more details on using hashes here.

File details

Details for the file wenbi-0.141.0-py3-none-any.whl.

File metadata

  • Download URL: wenbi-0.141.0-py3-none-any.whl
  • Upload date:
  • Size: 98.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.1

File hashes

Hashes for wenbi-0.141.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b1f1c8f8467e6e252136a231f15fc9bf48b0cbf7a6c2d1b51cbf778b31230b97
MD5 9fc3772516dc8094b4052f5af4915047
BLAKE2b-256 57b4c701b074e78d9181a7ec30ae3d9294edc5396d69753dfe279804f8724e94

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page