video-vec2wav2-tokenizer-2
Version 2 - continuation shard of the video-to-AI-dataset tokenizer project.
Production-ready pipeline (Python package video_vec2wav2_tokenizer, CLI command
video2dataset) that turns a folder of videos into clean AI training datasets
for speech recognition (ASR) and text-to-speech (TTS) .
text
Copy
videos βββΊ audio (16 kHz mono PCM) βββΊ whisper transcript βββΊ clips βββΊ metadata.csv / dataset.jsonl / tts_metadata.csv / report.json
Video processing β recursive scan of mp4 / mkv / avi / mov / webm, FFmpeg
audio extraction to mono Β· 16 kHz Β· 16-bit PCM WAV.
Speech recognition β faster-whisper ,
CPU & CUDA, automatic language detection, word-level timestamps.
Segmentation β cut audio by transcript timestamps into dataset/audio/000001.wav β¦.
Dataset generation β metadata.csv, dataset.jsonl, tts_metadata.csv.
Feature extraction (optional) β streaming features/train.bin + train.dat
with float32 samples, mel spectrograms, duration and sample rate.
Statistics β report.json with totals, durations and language distribution.
Training β train_wav2vec2.py: HuggingFace Wav2Vec2 CTC with resume,
multi-GPU, mixed precision and checkpointing.
Performance β multiprocessing, batch processing, tqdm progress bars and
memory-efficient streaming that scales past 1 TB of source media.
Installation Requires Python 3.11+ and the FFmpeg binary on your PATH.
bash
Copy
# 1. FFmpeg (one of):
# macOS: brew install ffmpeg
# Ubuntu: sudo apt install ffmpeg
# Windows: winget install Gyan.FFmpeg (or choco install ffmpeg)
# 2. The package
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
pip install -e . # exposes the `video2dataset` command
# Optional: training extras (torch + transformers)
pip install -e ".[train]"
Verify:
bash
Copy
video2dataset --version
f