CremyX Media Tools
Under maintenancePricing
Pay per usage
CremyX Media Tools
Under maintenanceffmpeg / ffprobe / yt-dlp / aria2c as a service: probe metadata, extract 16 kHz mono WAV, build 480p proxies, rough cuts, and YouTube downloads. Chainable through key-value store refs.
Pricing
Pay per usage
Rating
0.0
(0)
Developer
Andrew Babo
Maintained by CommunityActor stats
0
Bookmarked
1.1K
Total users
793
Monthly active users
a day ago
Last modified
Categories
Share
cremyx-media-tools
ffmpeg / ffprobe / yt-dlp / aria2c chạy trên Apify. Thay cho việc bắt user cài những tool này trên máy.
- Actor ID:
9BJXSNONxKn3OGsyW(cremyx-media-tools) - Base image:
apify/actor-node:22(Alpine) - Build hiện tại:
0.4— proxy single-pass, remux copy-first, audio16k range
Input
{"op": "audio16k", // probe | plan_shards | audio16k | proxy | cut | ytdlp | ingest | remux | capabilities"source": "https://…/video.mp4", // hoặc "kv:<storeId>/<key>""options": { }, // xem bảng dưới// audio16k: { format: "mp3", bitrate: "32k", start: 120, dur: 60 }"output": { "signed_upload_url": null },"cleanup": "on_success", // on_success | always | off"callback": { "url": "https://…", "secret_header": { "name": "x-secret", "value": "…" } }}
Các op
op | Kết quả | options |
|---|---|---|
probe | Không sinh file, chỉ meta (duration, w/h, fps, codec, channels…) | — |
audio16k | audio.wav — PCM 16 kHz mono, đầu vào chuẩn cho ASR/diarize; hỗ trợ mp3/opus để giảm dung lượng shard | sample_rate (mặc định 16000), format (wav mặc định, mp3, opus), bitrate (mp3 mặc định 32k), start/dur hoặc start_sec/duration_sec |
proxy | proxy.mp4 — bản 480p nhẹ để phân tích (vision, xem trước) | height (480), fps (25), crf (28), preset (ultrafast) |
cut | cut_01.mp4, cut_02.mp4… (tối đa 200 đoạn) | segments: [{ start_sec, end_sec, name }], reencode (false = cắt copy stream, nhanh nhưng bám keyframe), crf |
ytdlp | download.mp4 tải bằng yt-dlp + aria2c 16 luồng | format (mặc định bv*+ba/b), aria2c (true) |
ingest | tải + chuẩn hoá thành MP4 h264/aac faststart | tuỳ chọn ytdlp + max_height, crf, preset |
remux | đưa container/codec về MP4, copy trước rồi mới transcode phần không tương thích | copy_only, max_height, transcode_audio |
capabilities | trả ops/features/vCPU, không cần source | — |
op=ytdlp không hỗ trợ cookie / nội dung cần đăng nhập — cố ý, để không
phải gửi thông tin đăng nhập lên cloud.
Output
{"status": "success","op": "audio16k","artifacts": [{ "name": "audio", "kv_key": "audio.wav", "url": "https://api.apify.com/v2/key-value-stores/…/records/audio.wav","bytes": 183244, "stored_in": "key_value_store", "content_type": "audio/wav" }],"meta": { "duration_sec": 5.7, "sample_rate": 16000, "channels": 1, "source": { /* probe */ } },"timings": { "work_ms": 900, "publish_ms": 120, "total_ms": 1100 },"cleanup": "on_success","errors": null}
Kết quả nằm ở 3 nơi: dòng dataset, record RESULT trong key-value store của
run, và webhook callback (nếu có).
Ví dụ
Tách audio cho ASR:
curl -X POST "https://api.apify.com/v2/acts/cremyx-media-tools/runs?token=$APIFY_TOKEN" \-H 'content-type: application/json' \-d '{"op":"audio16k","source":"https://example.com/interview.mp4"}'
Cắt 3 đoạn, không re-encode:
{"op": "cut","source": "https://example.com/long.mp4","options": {"segments": [{ "start_sec": 12.5, "end_sec": 41.0, "name": "hook" },{ "start_sec": 130, "end_sec": 168, "name": "point_1" },{ "start_sec": 402, "end_sec": 447, "name": "cta" }],"reencode": true}}
reencode: true cho cắt đúng frame (dùng khi ghép lại); false nhanh hơn
nhiều nhưng điểm cắt nhảy về keyframe gần nhất.
Nối tiếp actor khác
artifacts[].kv_key + storeId của run tạo thành ref kv:<storeId>/<key>. Các op ingest, remux và capabilities có trong build 0.4; client nên gọi capabilities trước khi dùng contract mới.
Đưa thẳng ref đó vào source của cremyx-asr / cremyx-diarize /
cremyx-vision — file không phải tải về máy rồi upload lại.
Dung lượng
- Mọi file trung gian chỉ nằm trong key-value store mặc định của run (unnamed) → Apify tự xoá theo hạn giữ dữ liệu của gói.
cleanup: "always"+output.signed_upload_url→ file đi thẳng về storage của bạn, Apify chỉ còn vài KB JSON.- Dọn hàng loạt:
node scripts/purge-old-stores.mjs --days 3 --apply.
Shard plan (fan-out song song — v2)
Video dài → KHÔNG để 1 run xử lý cả file. Client gọi op: "plan_shards" trước:
{ "op": "plan_shards", "source": "https://.../video.mp4", "options": { "shard_sec": 120 } }
Trả về meta.shards: [{index, start_sec, duration_sec, is_last}]. Client chạy 1 run mỗi shard (song song) trên actor ASR/diarize/vision với options.start_sec/duration_sec tương ứng, rồi tự merge kết quả (timestamp đã được offset về timeline gốc; bỏ các phần tử có _overlap: true khi nối).
ytdlp — YouTube bot check (v2)
Khi YouTube trả Sign in to confirm you're not a bot, actor trả lỗi bot_check: với hướng khắc phục. Truyền một hoặc cả hai:
{ "op": "ytdlp", "source": "https://youtube.com/watch?v=...","options": {"cookies": "<nội dung file cookies.txt định dạng Netscape, export từ trình duyệt đã đăng nhập>","apify_proxy": { "groups": ["RESIDENTIAL"], "country": "US" },"player_client": "android,web_safari"} }
cookies(nội dung file) hoặccookies_url(HTTPS tới file cookies.txt) — không bao giờ log.apify_proxydùng Apify Proxy (khuyến nghị RESIDENTIAL), hoặcproxy= URL proxy tự có.player_client: danh sách client thử lần lượt (mặc địnhandroid,web_safari).
Chaining qua URL công khai
Qua proxy xoay tài khoản Apify, kv: từ run khác sẽ lỗi quyền truy cập (mỗi tài khoản chỉ đọc store của chính nó). Hãy truyền artifacts[].url (URL công khai) của run trước vào source của run sau.
artifacts[].upload_status
Mỗi phần tử trong artifacts kèm upload_status:
| Giá trị | Ý nghĩa |
|---|---|
uploaded | Đã ghi xong lên KV store / signed URL đích |
skipped | Bỏ qua vì đã tồn tại (idempotent) hoặc output không yêu cầu publish |
failed | Ghi thất bại — xem artifacts[].error |
Dùng field này để phân biệt "actor chạy xong nhưng chưa có file" với "file đã sẵn sàng tải".