video-vec2wav2-tokenizer-2
收藏资源简介:
该数据集是由视频处理管道(video-vec2wav2-tokenizer-2)生成的,专为语音识别(ASR)和文本转语音(TTS)模型的AI训练而设计。它通过对输入视频(支持mp4、mkv、avi、mov、webm格式)进行自动处理构建,核心流程包括:使用FFmpeg提取并转换为16 kHz、单声道、16位PCM的WAV音频;利用faster-whisper模型(支持CPU和CUDA)进行自动语言检测和语音识别,生成带词级时间戳的转录文本;根据时间戳将音频切割成片段;最终生成结构化的数据集。数据集包含音频片段文件(.wav)、对应的转录文本、音频时长以及可选的说话人标识。输出格式多样,包括CSV、JSONL和JSON文件,用于不同用途:`metadata.csv`(音频文件与文本的映射)、`dataset.jsonl`(包含音频路径、文本和时长的结构化记录)、`tts_metadata.csv`(为TTS任务添加说话人信息)、`report.json`(包含总样本数、总/平均时长、语言分布等统计信息)。此外,还可选择生成流式特征文件(`features/train.bin`和`train.dat`),其中包含浮点音频样本和梅尔频谱图。数据集处理支持多进程、批处理,并能高效扩展到处理超过1TB的源视频数据。配置灵活,可指定Whisper模型、强制语言、处理设备(CPU/CUDA)、音频片段的最小/最大长度以及说话人分配模式(固定、按视频、按文件)。该数据集主要用于微调基于CTC的HuggingFace Wav2Vec2等语音处理模型。
This dataset is generated by a video processing pipeline (video-vec2wav2-tokenizer-2) and is specifically designed for AI training of automatic speech recognition (ASR) and text-to-speech (TTS) models. It is constructed through automated processing of input videos (supporting formats such as mp4, mkv, avi, mov, webm). The core workflow includes: using FFmpeg to extract and convert audio to WAV format with 16 kHz, mono, 16-bit PCM; utilizing the faster-whisper model (supporting both CPU and CUDA) for automatic language detection and speech recognition, generating transcription text with word-level timestamps; segmenting the audio based on timestamps; and finally producing a structured dataset. The dataset contains audio segment files (.wav), corresponding transcription texts, audio durations, and optional speaker identifiers. Output formats are diverse, including CSV, JSONL, and JSON files for various purposes: `metadata.csv` (mapping audio files to text), `dataset.jsonl` (structured records containing audio paths, text, and durations), `tts_metadata.csv` (adding speaker information for TTS tasks), `report.json` (statistical information including total sample count, total/average duration, language distribution, etc.). Additionally, optional streaming feature files (`features/train.bin` and `train.dat`) can be generated, containing floating-point audio samples and mel spectrograms. The dataset processing supports multi-processing, batch processing, and can efficiently scale to handle over 1TB of source video data. Configuration is flexible, allowing specification of Whisper models, forced language, processing devices (CPU/CUDA), minimum/maximum audio segment lengths, and speaker assignment modes (fixed, per video, per file). This dataset is primarily used for fine-tuning CTC-based HuggingFace Wav2Vec2 and other speech processing models.
数据集概述
数据集名称
video-vec2wav2-tokenizer-2(Version 2)
核心功能
该数据集是一个从视频到AI训练数据集的流水线工具,专为自动语音识别和文本转语音任务设计。它将视频文件夹处理为清洁的、可直接用于模型训练的数据集。
处理流程
- 视频输入:递归扫描
mp4 / mkv / avi / mov / webm格式的视频文件。 - 音频提取:使用FFmpeg将视频音频提取为单声道、16 kHz、16-bit PCM WAV格式。
- 语音识别:使用
faster-whisper进行语音转文本,支持CPU和CUDA,自动语言检测,并提供词级时间戳。 - 音频分割:根据转录时间戳将音频切割成独立的音频片段,存储为
dataset/audio/000001.wav等文件。 - 数据集生成:生成
metadata.csv、dataset.jsonl、tts_metadata.csv等标准格式的元数据文件。 - 特征提取:可选步骤,生成流式特征文件
features/train.bin和features/train.dat,包含float32样本、梅尔频谱图、持续时间和采样率。 - 统计报告:生成
report.json,包含总数、总时长和语言分布。 - 模型训练:提供
train_wav2vec2.py脚本,支持Wav2Vec2 CTC模型微调,具备断点续训、多GPU和混合精度训练功能。
输出格式
| 文件 | 格式 |
|---|---|
metadata.csv |
`000001.wav |
dataset.jsonl |
{"audio":"audio/000001.wav","text":"Hello world","duration":2.5} |
tts_metadata.csv |
`000001.wav |
report.json |
总量、总/平均时长、语言分布 |
features/train.bin |
小端序float32:每个片段的音频样本+梅尔谱 |
features/train.dat |
JSONL索引(偏移量、形状、时长、采样率) |
架构特点
- 惰性导入:
faster-whisper、torch和transformers等大型依赖仅在执行相关命令时导入,核心库轻量快速。 - 流式处理:转录、切片、特征存储均按视频逐一处理,内存使用与语料库大小无关。
- 优雅降级:当
soundfile/librosa未安装时,WAV IO和梅尔频谱图会回退到stdlib和NumPy。 - 容错机制:处理失败的视频会被记录并跳过,流水线继续运行。
关键配置参数 (config.yaml)
model_name:facebook/wav2vec2-base-960h(训练模型)whisper_model:large-v3(ASR模型)language:null(自动检测)device:auto(自动选择CPU/CUDA)sample_rate:16000,channels:1min_segment_length/max_segment_length:1.0/20.0(音频片段长度限制)speaker_mode:fixed(固定说话人;可选按视频或按片段划分)
依赖与环境
- 需要Python 3.11+ 和系统安装的FFmpeg。
- 核心依赖较少,训练的额外依赖(
torch,transformers)可选。




