Skip to main content

Video processing helpers for the twat plugin ecosystem

Project description

twat-video

twat-video is the video domain package for the twat plugin ecosystem. It builds reusable, testable ffmpeg command wrappers and delegates AI video generation to twat_genai when such provider engines are available.

Font-organizer preservation

This repository used to package font_organizer. The canonical copy now exists in plugins/repos/twat_font as twat_font, with the same organizer/core modules and CLI surface. The old source tree is left in this repo only as historical material; the build now packages src/twat_video.

Requirements

Install ffmpeg and ffprobe for real media processing. Tests exercise command construction with dry_run=True and do not require media binaries.

Python API

from twat_video import crop_scale, import_audio, split_segment

crop_scale("input.mp4", "square.mp4", crop="1080:1080:420:0", scale="720:720")
split_segment("input.mp4", "clip.mp4", start=12.5, duration=4.0)
import_audio("silent.mp4", "voice.wav", "dubbed.mp4")

Implemented deterministic helpers:

  • ffmpeg boundary: run_command, run_ffmpeg, probe_video.
  • video geometry/timing: crop_scale, change_fps, split_segment, reverse_video.
  • composition: merge_by_gap, ken_burns.
  • audio/subtitle operations: import_audio, extract_subtitles, repair_srt_text, add_reverb.
  • visual effect: add_grain.

CLI

python -m twat_video --help
python -m twat_video crop-scale in.mp4 out.mp4 --crop 1080:1080:420:0 --scale 720:720 --dry-run
python -m twat_video fps in.mp4 out.mp4 24 --dry-run
python -m twat_video split in.mp4 clip.mp4 --start 1.5 --duration 3 --dry-run
python -m twat_video import-audio silent.mp4 voice.wav dubbed.mp4 --dry-run
python -m twat_video ken-burns still.png out.mp4 --duration 5 --dry-run

AI video boundary

generate_video() is a narrow adapter. It imports twat_genai and calls a future twat_genai.generate_video provider API if present; it does not embed SkyReels, WAN, Chutes, or other provider clients.

Reference scripts

Reusable patterns from vidcropscale.py, vidfps, vidframedrop.py, vidsplit.py, vidreverse, vidmergebygap.py, vidkenburns.py, vidgrainer.py, vidreverb.py, vidimportaudio, mkv2srt.py, and srtmultifix.py are represented as package APIs.

Watermark removal, menu-bar automation, JSON presets, batch shell wrappers, and local renaming/upload workflows remain in reference/bin-img-vid/ because they are workstation-specific one-offs or policy-sensitive scripts rather than reusable package behavior.

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

twat_video-2.7.6.tar.gz (88.1 kB view details)

Uploaded Source

Built Distribution

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

twat_video-2.7.6-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file twat_video-2.7.6.tar.gz.

File metadata

  • Download URL: twat_video-2.7.6.tar.gz
  • Upload date:
  • Size: 88.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for twat_video-2.7.6.tar.gz
Algorithm Hash digest
SHA256 a9cd4231cb42a86ded8e14793a8226f0d8fb9fec2d9dfbbe379e92538e59b29d
MD5 ff99b2a66c86c00d9be416d9c792136f
BLAKE2b-256 8c35f6a79cb2a01b57eb9255c98dfb28f3654c774c8df935826f74e74ae26bf7

See more details on using hashes here.

File details

Details for the file twat_video-2.7.6-py3-none-any.whl.

File metadata

  • Download URL: twat_video-2.7.6-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for twat_video-2.7.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7dd98d24bb6335bc41b4ec8cfd0e6c9adf82e46a6b58436c647ee1fa7d5bae48
MD5 ebae69c552e545d85f54e630e4ff87a5
BLAKE2b-256 7bfcce2a7b5d5425c138b0162db27b2554a63d6d518767f61ba6db3b84eac19d

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