@dinahmoe/dmafjs-ffmpeg
v24.0.0-alpha.0
Published
Server-side FFmpeg integration for DMAFJS applications. Provides media processing capabilities including metadata extraction, image manipulation (resize, crop), and video keyframe extraction through the standard DMAFJS component/environment pattern.
Readme
dmafjs-ffmpeg
Server-side FFmpeg integration for DMAFJS applications. Provides media processing capabilities including metadata extraction, image manipulation (resize, crop), and video keyframe extraction through the standard DMAFJS component/environment pattern.
Installation
npm install @dinahmoe/dmafjs-ffmpegPrerequisite: FFmpeg must be installed and available in your system PATH.
Quick Start
import { ffmpegController } from "@dinahmoe/dmafjs-ffmpeg";
// In your descriptor, create an FFmpegController node
const descriptor = {
type: "FFmpegController",
uid: "ffmpeg",
tmpDirPath: "/tmp/ffmpeg-work"
};
// Send messages to process media
ffmpegProxy.tell({
type: "get_metadata",
uri: "/path/to/video.mp4"
});
ffmpegProxy.tell({
type: "resize_image",
uri: "/path/to/image.jpg",
width: 800,
height: -1 // maintain aspect ratio
});
ffmpegProxy.tell({
type: "crop_image",
uri: "/path/to/image.jpg",
width: 100,
height: 100,
x: 50,
y: 50
});
ffmpegProxy.tell({
type: "extract_video_keyframes",
uri: "/path/to/video.mp4",
interval: 5000, // ms between frames
quality: 100
});Documentation
For detailed concepts and architecture, see the wiki.
Related Packages
- dmafjs-core - Core runtime engine and Entity base class
- dmafjs-javascript - JavaScript environment base for server-side execution
