
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
mediax-sdk
Advanced tools
Node.js SDK for ffmpeg media processing (convert, compress, thumbnails, audio, GIF, watermark, frames, etc.)
MediaX SDK is a Node.js TypeScript library for high-level video/audio/media processing built on ffmpeg. It provides a simple, typed interface to convert, compress, extract audio, generate thumbnails, clip, GIF conversion, watermark, frames extraction, and more. It supports real-time progress, accurate percent calculation, and job queues for production-grade pipelines.
# Using npm
npm install mediax-sdk
# Using pnpm
pnpm add mediax-sdk
Make sure
ffmpegis installed on your system. On Windows, you can download it from FFmpeg.org. On Mac/Linux, you can usebrew install ffmpegor your package manager.
import { MediaX } from "mediax-sdk";
const mx = new MediaX();
// Convert video
const job = mx.convert("input.mp4", "output.mkv");
job.on("start", (cmd) => console.log("Started:", cmd));
job.on("progress", (p) => console.log(`Progress: ${p.percent?.toFixed(1)}%`));
job.on("done", (output) => console.log("Done:", output));
job.on("error", (err) => console.error("Error:", err));
job.start();
| Method | Description |
|---|---|
convert(input, output, format?) | Convert video/audio to specified format |
compress(input, output, bitrate?) | Compress video with bitrate |
thumbnail(input, output, time?) | Generate thumbnail at time |
metadata(input) | Get media metadata |
extractAudio(input, output, codec?) | Extract audio track |
replaceAudio(video, audio, output) | Replace audio track in video |
toGif(input, output, { start?, duration? }) | Convert video segment to GIF |
clip(input, output, { start?, duration? }) | Clip video segment |
concat(inputs[], output) | Concatenate multiple videos |
addWatermark(input, watermark, output, { x?, y? }) | Add image watermark |
extractFrames(input, pattern, { fps? }) | Extract frames as images |
Each job emits typed events:
start(cmdLine: string) → FFmpeg command startedprogress(progress: ProgressInfo) → Progress update with percent, frames, fps, kbpsdone(output?: string) → Job completederror(err: Error) → Job failedjob.on("progress", p => console.log(`Percent: ${p.percent?.toFixed(1)}%`));
Run multiple jobs concurrently:
import { Queue } from "mediax-sdk";
const queue = new Queue(2); // 2 concurrent jobs
queue.add(mx.convert("a.mp4", "a_out.mkv"));
queue.add(mx.compress("b.mp4", "b_out.mp4"));
queue.add(mx.toGif("c.mp4", "c.gif", { start: 1, duration: 5 }));
queue.on("jobProgress", (job, progress) => console.log(`${job.opts.input}: ${progress.percent?.toFixed(1)}%`));
queue.on("jobDone", (job) => console.log(`${job.opts.input} done`));
queue.on("empty", () => console.log("All jobs completed"));
export interface ProgressInfo {
percent?: number;
frames?: number;
currentFps?: number;
currentKbps?: number;
time?: string;
}
Clone and build:
git clone https://github.com/ksaurav24/mediax.git
cd mediax/packages/core
pnpm install
pnpm build
Run tests:
pnpm test
ffmpeg and ffprobe are automatically configured using @ffmpeg-installer/ffmpeg and @ffprobe-installer/ffprobe.ffprobe to fetch media duration.FAQs
Node.js SDK for ffmpeg media processing (convert, compress, thumbnails, audio, GIF, watermark, frames, etc.)
The npm package mediax-sdk receives a total of 0 weekly downloads. As such, mediax-sdk popularity was classified as not popular.
We found that mediax-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.