
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
In-browser video editing using WebCodecs, WebStreams, and WebGL → mfxlib.com
Decode MP4 Video -> zoom out -> encode to WebM keeping original Audio (vp8):
import {
decode,
encode,
effect,
visual,
writeToFile,
} from "mfx";
// Files can be fetched locally
const file = await fetch("https://example.com/myvideo.mp4");
// Decode video container, returns each track as a WebStream
const { video, audio } = await decode(file, "video/mp4", {
// Addresses Chromium WebCodecs bug, Set to true for HEVC or if "Can't readback frame textures" is thrown. Has ~10% performance impact.
forceDecodeToSoftware: false,
});
// Hardware accelerated (WebGL2) effect pipeline
const videoOutput = effect(video, [
// Apply zoom out effect
visual.zoom({ factor: 0.5, x: 0.5, y: 0.25 })
]);
// Readable WebStream
const outputStream = encode({
mimeType: `video/webm; codecs="vp8,opus"`, // Transcode to WebM VP8 (video) and Opus (audio)
video: {
...video.track.config, // Inherit configuration from input video
stream: videoOutput,
width: 640,
height: 360,
bitrate: 1e6,
framerate: 30,
},
audio: {
...audio.track.config, // Inherit configuration from input audio
stream: audio
}
});
// Opens a save dialog in the browser
await writeToFile(outputStream, "output.webm");
// Alternatively you can pipeTo a fetch POST request
await fetch("example.com/save", {
method: "POST",
body: outputStream
});
While codec support heavily depends on the browser, mfx aims to provide support for the following container / codec pairs:
| Container | Codec | Encode / Decode |
|---|---|---|
| MP4 | H.264/AVC | Both |
| MP4 | H.265/HEVC | Decode |
| MP4 | VP8 | Both |
| MP4 | VP9 | Both |
| WebM | VP8 | Both |
| WebM | VP9 | Both |
| GIF | LZW | Encode |
Audio | ||
| MP4 | Opus | Both |
| MP4 | AAC | Both |
| WebM | Opus | Both |
| WebM | Vorbis | Both |
Install git-lfs to pull sample files:
brew install git-lfs
npm install
npm start
MIT License
Some test videos are sourced from coverr.co yet they are only used for testing and will not be built into the MFX package.
These videos are under a permissive license (https://coverr.co/license).
FAQs
In-browser video editing toolkit, with effects accelerated by WebGL
We found that mfx 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.