CremyX ASR (whisper.cpp) avatar

CremyX ASR (whisper.cpp)

Under maintenance

Pricing

Pay per usage

Go to Apify Store
CremyX ASR (whisper.cpp)

CremyX ASR (whisper.cpp)

Under maintenance

Word-level speech-to-text with whisper.cpp. Accepts any audio or video (https URL or kv ref) and returns a word-level transcript JSON ready for clipping and subtitle pipelines.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Andrew Babo

Andrew Babo

Maintained by Community

Actor stats

0

Bookmarked

23

Total users

19

Monthly active users

a day ago

Last modified

Categories

Share

cremyx-asr

whisper.cpp + model ggml nướng sẵn trong image. Thay cho việc bắt user tải Whisper và model vài trăm MB về máy.

  • Actor ID: R0oNMKNuyiaoEeZWf (cremyx-asr)
  • Base image: apify/actor-node:22 (Alpine) — whisper.cpp build static
  • Build hiện tại: 0.1.4, model mặc định large-v3-turbo-q5_0 (~570 MB)

Input

{
"source": "kv:<storeId>/audio.wav", // hoặc https://… (mp4/m4a/mp3/wav đều được)
"options": {
"preset": "balanced", // fast | adaptive | balanced | accurate
"language": "vi", // bỏ trống = tự nhận diện
"model": null, // tên file .bin khác trong image (nếu build nhiều model)
"threads": null, // mặc định = adaptive theo số CPU
"segment_gap_ms": 700, // khoảng lặng để tách segment caption
"keep_raw_json": false, // giữ luôn JSON gốc của whisper.cpp
"timeout_sec": null
},
"output": { "signed_upload_url": null },
"cleanup": "on_success",
"callback": null
}

Actor luôn tự convert nguồn về WAV 16 kHz mono trước khi chạy — đưa mp4 thẳng vào cũng được, nhưng nếu đã có audio16k từ cremyx-media-tools thì nhanh hơn.

Preset

PresetDùng khiGhi chú
fastduyệt nhanh, nội dung rõ tiếngbeam nhỏ
adaptivemặc định an toàn cho video dàitự cân theo CPU
balancedmặc định — chất lượng/tốc độ tốt nhất
accuratelời thoại khó, nhiều tiếng ồnchậm hơn đáng kể, bật --dtw nếu model hỗ trợ

Output

{
"status": "success",
"op": "transcribe",
"artifacts": [{ "name": "transcript", "kv_key": "transcript.json", "url": "…" }],
"meta": {
"engine": "whisper.cpp", "model": "ggml-large-v3-turbo-q5_0.bin", "preset": "balanced",
"language": "vi", "duration_sec": 5.7, "word_count": 18, "segment_count": 3,
"words": [{ "id": 0, "text": "Xin", "startMs": 120, "endMs": 310, "confidence": 0.93 }],
"segments": [{ "id": 0, "text": "Xin chào các bạn", "startMs": 120, "endMs": 1980 }]
},
"timings": { "decode_ms": 400, "asr_ms": 79000, "total_ms": 80100 },
"errors": null
}

words dùng đúng schema từ của engine/asr.mjs bên SuperClipping ({ id, text, startMs, endMs, confidence }) — bộ chuẩn hoá normalizeWhisperJson được port nguyên văn, nên thay ASR local bằng actor này không phải sửa gì phía sau.

Dòng dataset được lược bớt words/segments cho nhẹ; bản đầy đủ nằm trong record RESULT và artifact transcript.json.

Hiệu năng & chi phí

  • CPU 8 GB: ~79 s cho 5.7 s audio với large-v3-turbo-q5_0 (phần lớn là nạp model). Video càng dài thì tỉ lệ càng tốt vì chi phí nạp model chỉ trả một lần.
  • Video dài → chạy song song nhiều run (mỗi run một đoạn từ op=cut) thay vì tăng RAM một run.
  • Muốn nhẹ và nhanh hơn: build lại image với model nhỏ hơn apify push --build-arg WHISPER_MODEL=medium (hoặc small, base).

Ví dụ nối chuỗi

const wav = await tools.mediaTools({ op: 'audio16k', source: 'https://…/video.mp4' });
const asr = await tools.asr({ source: wav.kv('audio'), options: { preset: 'balanced', language: 'vi' } });
console.log(asr.meta.words.length, 'từ');

Shard window (v2) — video dài

Với nguồn dài (>3 phút), client chia shard qua plan_shards của cremyx-media-tools rồi chạy song song nhiều run, mỗi run:

{ "source": "https://.../video.mp4",
"options": { "start_sec": 120, "duration_sec": 120, "overlap_sec": 1, "language": "vi" } }
  • Timestamp trong kết quả đã được cộng offset về timeline gốc (meta.shard.offset_applied: true).
  • Từ nằm trong đuôi overlap có _overlap: true — client bỏ khi ghép shard.
  • timeout_sec: 0 tắt giới hạn nội bộ; mặc định = max(20 phút, 12× độ dài audio).
  • Speaker không đổi giữa các shard; nếu cần speaker nhất quán toàn video thì dùng cremyx-diarize trên full file.

Memory mặc định run: 12 GB.