@moviemasher/server-express
v5.1.1
Published
Movie Masher Server Plugin implemented in ExpressJS - version 5.1.1
Downloads
7
Readme
JavaScript video editor, encoder, switcher
- visual compositing through SVG API
- audio mixing through WebAudio API
- client implemented in ReactJS
- server implemented in ExpressJS
- encode and stream through FFmpeg
Express Server Plug-in
This module is an ExpressJS reference implementation of a server plug-in that utilizes the core @moviemasher/moviemasher.js module.
It exports classes and interfaces that fulfill half a dozen APIs utilized by a client implementation like @moviemasher/client-react. Its imports are all specified as peer dependencies.
This server implementation utilizes SQLite, Fluent FFmpeg, Node Media Server, and WebRTC to support its data, rendering, and streaming APIs.
Documentation
In addition to this README, there is a simple demo and more extensive documentation available on MovieMasher.com. Inline documentation and code completion is also available when using a code editor that supports TypeScript and IntelliSense.
Server Example
The following shell command installs the server and required packages to your NPM project,
saving the former to the dependencies
array in your package.json file.
npm install @moviemasher/server-express --save
The script below can then be included in your project and triggered in a variety of ways. The most straightfoward is to simply pass its path directly to node.
const MovieMasherServer = require("@moviemasher/server-express")
const { Host } = MovieMasherServer
const options = {
port: 8572, host: '0.0.0.0',
api: { authentication: { type: 'basic' } }
}
const host = new Host(options)
host.start()
The script first requires MovieMasherServer, then destructures what's needed from it. In this example we're just grabbing the Host
class and corresponding HostDefaultOptions
function. We call the later with the desired port number, and then pass the options it returns as arguments to the class constructor. Finally, the start
method of the new instance is called to start the ExpressJS server.
While the server is running, requests can be made to http://localhost:8570 following half a dozen APIs that save data, handle uploads, render video, etc.
Please note
This example installs an FFmpeg build that has limited rendering capabilities due to lack of support of SVG files. Typically a custom build is utilized instead. Learn more about integrating your own services in the Server Developer Guide.
Feedback
If any problems arise while utilizing the Movie Masher repository, a GitHub Issue Ticket should be filed. Further support is occassionally offered to particular projects on an hourly consulting basis.
Pull requests for fixes, features, and refactorings are always appreciated, as are documentation updates. Creative help with graphics, video and the web site is also needed. Please review the Contributor Guide and send an email to discuss ways to work on the project.