AnimeSub
Инструмент для автоматического создания субтитров из видео- или аудиофайлов.
Оптимизирован для японского языка (подходит для аниме, интервью и т.п.).
⚡ Быстрый старт
Локальный файл → субтитры:
animesub -i input_file.mp4
YouTube → субтитры:
animesub -u "https://youtube.com/watch?v=XXXX"
📦 Установка
Из PyPI:
pip install animesub
💡 Для работы на CUDA желательно поставить torch и torchaudio под свою версию CUDA:
pip install torch torchaudio --index-url https://download.pytorch.org/whl/cu126
Не забудьте установить ffmpeg и demucs:
conda install ffmpeg -c conda-forge
pip install demucs
🚀 Использование
Локальный файл
animesub -i input_file.mp4
Создаст input_file.srt в текущей папке.
Скачивание по URL (YouTube и др.)
animesub -u "https://youtube.com/watch?v=XXXX"
Сохранит результат в output.srt.
🔧 Аргументы CLI
| Аргумент | Описание |
|---|---|
-i, --input_file |
Путь к локальному видео или аудио |
-u, --url |
URL видео/аудио (YouTube) |
-o, --output |
Путь к выходному .srt (по умолчанию: <имя_файла>.srt или output.srt для URL) |
-m, --model |
Модель ASR: tiny, base, small, medium, large, large-v2, large-v3,kotoba-faster, kotoba-whisper, kotoba-whisper-v2.2, kotoba-faster (по умолчанию: small) |
-d, --device |
cpu или cuda (по умолчанию определяется автоматически) |
--demucs-model |
Модель сепарации вокала: htdemucs или mdx_extra_q (по умолчанию: htdemucs) |
--merge-silence |
Максимальная пауза между VAD-сегментами для объединения (по умолчанию: 0.6) |
📌 Примеры
CPU + base модель
animesub -i input.mp3 -m base -d cpu
Kotoba-модель с кастомной паузой
animesub -i anime.mkv -m kotoba-whisper-v2.2 --merge-silence 0.8 -d cuda
С YouTube
animesub -u "https://youtube.com/watch?v=XXXX" -m kotoba-faster -d cuda
С указанием файла вывода
animesub -i episode.mp4 -o subs/episode01.srt
🎯 Как работает
- Отделение вокала (Demucs)
- Детекция речи (Silero VAD)
- Транскрипция (Whisper или Kotoba-Whisper)
- Пунктуация (XLM-RoBERTa через
punctuators) - Экспорт в
.srtс форматированием
🛠️ Использование как библиотеки
from AnimeSub.main_logic import process_audio
process_audio(
input_path="video.mp4",
output_path="subs.srt",
model_name="kotoba-whisper-v2.2",
device="cuda",
merge_silence=0.6
)
📜 Лицензия
MIT
👤 Автор
Ivan Tyumentsev 📧 ivanfufa184@gmail.com 🔗 GitHub
Metadata
Release files for animesub 1.0.3
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 |
|---|---|---|---|---|
| animesub-1.0.3.tar.gz | 22.7 kB | Without provenance | Details for animesub-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| animesub-1.0.3-py3-none-any.whl | Python 3 | none | any | Details for animesub-1.0.3-py3-none-any.whl |
Total release size: 50.5 kB
Release files / animesub-1.0.3.tar.gz
| Download URL | animesub-1.0.3.tar.gz |
|---|---|
| Size | 22.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ce763db1dc83517b5f476c21516cd2c406df002e93b212f27375f9672a4c5bb
|
|
BLAKE2b-256 checksum How to use checksums |
23507558cb2c092111024b580f13f8c27f60a6ba7ca688eae20b9b195824601b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.18
|
Release files / animesub-1.0.3-py3-none-any.whl
| Download URL | animesub-1.0.3-py3-none-any.whl |
|---|---|
| Size | 27.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c14f3f1911afd4e1d16a8fa2247ba69b1ebaee4a7f5a26caab5d3ba25b35fac9
|
|
BLAKE2b-256 checksum How to use checksums |
38f2fd5bc4dd5e5d895fccb0d275e1cf43d4a2f124f9cb5c22cbc94050f13ea1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.18
|
Security for animesub 1.0.3
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.