
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.
@meframe/core
Advanced tools
新一代高性能浏览器端视频合成引擎
MEFrame Core 是完全重新设计的视频处理引擎,基于 WebCodecs API 和 Worker 并行架构,提供毫秒级响应的视频编辑和秒级导出能力。
| 指标 | 目标值 | 说明 |
|---|---|---|
| 首帧渲染 | < 100ms | 从加载到显示第一帧 |
| Seek 响应 | < 50ms | 缓存命中情况下 |
| 播放帧率 | > 29.97 fps | 1080p 多轨合成 |
| 导出速度 | > 2x 实时 | 1080p H.264 编码 |
| 内存占用 | < 500MB | 典型项目场景 |
npm install @meframe/core
// vite.config.ts
import { defineConfig } from 'vite';
import { meframePlugin } from '@meframe/core/vite-plugin';
export default defineConfig({
plugins: [
meframePlugin(), // 必需:复制 worker 文件到输出目录
],
});
为什么需要插件? Worker 文件在
node_modules中,生产环境需要复制到输出目录才能访问。插件会自动处理这个过程。
import { Meframe } from '@meframe/core';
import { parseDSL } from '@meframe/dsl-parser'; // 可选:DSL 解析
// 1. 创建实例
const core = await Meframe.create();
// 2. 设置合成树(两种方式)
// 方式一:直接使用标准模型格式
// CompositionModel 是引擎的标准输入模型,定义了明确的数据契约
const compositionTree = {
version: '1.0',
fps: 30,
durationUs: 10_000_000, // 10 seconds
root: {
type: 'group',
id: 'root',
startUs: 0,
durationUs: 10_000_000,
children: [
{
type: 'video',
id: 'video-1',
src: 'https://example.com/video.mp4',
startUs: 0,
durationUs: 5_000_000,
},
{
type: 'caption',
id: 'caption-1',
text: 'Hello World',
startUs: 1_000_000,
durationUs: 3_000_000,
style: {
fontSize: 48,
color: '#ffffff',
},
},
],
},
};
await core.setCompositionTree(compositionTree);
// 方式二:使用 DSL Parser(业务 DSL → CompositionModel)
const dsl = await fetch('/project.json').then((r) => r.json());
const model = parseDSL(dsl); // 转换为标准格式
await core.setCompositionTree(model);
// 3. 开始预览
const preview = core.startPreview();
preview.play();
// 4. 导出视频
const blob = await core.export({
preset: 'high',
container: 'mp4',
});
// 应用局部更新
await core.applyPatch({
version: '1.0',
operations: [
{
type: 'update',
nodeId: 'caption-1',
updates: {
text: 'Updated Text',
},
},
],
});
import { PerfMonitorPlugin } from '@meframe/core/plugins';
const core = await Meframe.create({
canvas,
workerBaseUrl: '/workers/',
plugins: [
new PerfMonitorPlugin({
overlay: true,
sampleRate: 60,
}),
],
});
static async create(config: CoreConfig): Promise<Meframe>
async setCompositionTree(model: CompositionModel): Promise<void>
async applyPatch(patch: CompositionPatch): Promise<void>
startPreview(options?: PreviewOptions): PreviewHandle
async export(options: ExportOptions): Promise<Blob>
interface PreviewHandle {
play(): void;
pause(): void;
seek(timeUs: number): void;
setRate(rate: number): void;
getCurrentTime(): number;
on(event: string, handler: Function): void;
}
interface CompositionModel {
version: '1.0';
fps: 24 | 25 | 30 | 60;
durationUs: number;
root: GroupNode;
renderConfig?: {
width: number;
height: number;
background?: string;
};
}
┌─────────────────────────────────────────────────────────┐
│ Main Thread │
│ ┌─────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Meframe │ │ Orchestrator │ │ CacheManager │ │
│ └─────────────┘ └──────────────┘ └──────────────┘ │
└─────────────────────────┬───────────────────────────────┘
│ MessageChannel
┌─────────────────────────┴───────────────────────────────┐
│ Worker Threads │
│ ┌────────────┐ ┌─────────────┐ ┌────────────────┐ │
│ │DecodeWorker│ │ComposeWorker│ │EncodeWorker │ │
│ └────────────┘ └─────────────┘ └────────────────┘ │
│ ┌─────────────┐ │
│ │ MuxWorker │ │
│ └─────────────┘ │
└──────────────────────────────────────────────────────────┘
Input Stream
↓
[ResourceLoader] → ReadableStream
↓
[DecodeWorker] → VideoFrame/AudioData
↓
[ComposeWorker] → Composed VideoFrame
↓
[EncodeWorker] → EncodedChunk
↓
[MuxWorker] → MP4/WebM Blob
↓
Output File
┌─────────────────────────────────────┐
│ Cache Manager │
├─────────────────────────────────────┤
│ L1: VRAM (VideoFrame) │
│ - LRU eviction │
│ - ~90 frames @ 1080p │
├─────────────────────────────────────┤
│ L2: IndexedDB (EncodedChunk) │
│ - Compressed storage │
│ - Persistent across sessions │
└─────────────────────────────────────┘
// 显式释放资源
videoFrame.close();
// 配置缓存限制
const core = await Meframe.create({
cache: {
l1: { maxMemoryMB: 200 },
l2: { maxSizeMB: 1000 },
},
});
// 配置预渲染窗口
core.setPreRenderWindow({
forward: 10_000_000, // 10s ahead
backward: 2_000_000, // 2s behind
});
// 配置质量自适应
core.setAdaptiveQuality({
enabled: true,
targetFPS: 30,
minQuality: 'low',
maxQuality: 'high',
});
| 浏览器 | 最低版本 | 说明 |
|---|---|---|
| Chrome | 94+ | 完整支持 |
| Edge | 94+ | 完整支持 |
| Safari | 16.4+ | 需要开启实验性功能 |
| Firefox | - | 暂不支持 WebCodecs |
主要变化:
详细迁移步骤请参考 MIGRATION.md
# 安装依赖
npm install
# 启动开发服务器
npm run dev
# 运行测试
npm test
# 构建
npm run build
packages/core-next/
├── src/ # 源代码
├── tests/ # 测试文件
├── examples/ # 示例代码
├── docs/ # 文档
└── benchmarks/ # 性能测试
git checkout -b feature/amazing)git commit -m 'Add amazing feature')git push origin feature/amazing)MIT License
感谢所有贡献者和以下开源项目:
FAQs
Next generation media processing framework based on WebCodecs
We found that @meframe/core 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.