m4k
v0.3.3
Published
Media toolkit for node, bun, and deno
Maintainers
Readme
m4k - media kit
A media conversion toolkit based on ffmpeg and sharp/libvips. It provides queueing and progress reporting via async iterables.
The API is unified for audio, images and videos.
Usage
Processing audio
import { processAudio, ProcessedFile } from "m4k";
// input is a file path or an async iterable of Uint8Arrays or a Blob
for await (const value of processAudio(input, opts)) {
if (value instanceof ProcessedFile) {
// do something with the file
}
}Processing images
import { processImage, ProcessedFile } from "m4k";
// input is a file path or an async iterable of Uint8Arrays or a Blob
for await (const value of processImage(input, opts)) {
if (value instanceof ProcessedFile) {
// do something with the file
}
}Processing videos
import { processVideo, ProcessedFile } from "m4k";
// input is a file path or an async iterable of Uint8Arrays or a Blob
for await (const value of processVideo(input, opts)) {
if (value instanceof ProcessedFile) {
// do something with the file
}
}