Neoclassical Philosophic Musings

    @moviemasher/server-express
    TypeScript icon, indicating that this package has built-in type declarations

    5.0.6 • Public • Published

    Image

    JavaScript video editor, encoder, and streamer - version 5.0.6

    • visual compositing through Canvas API
    • audio mixing through WebAudio API
    • encoding and streaming through FFmpeg
    • client implemented in ReactJS
    • server implemented in ExpressJS

    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.

    Installation

    The following shell command installs the server and core libraries to your NPM project, saving the former to the dependencies array in your package.json file.

    npm install @moviemasher/server-express --save

    Please note that this does not install a client implementation that interacts with this module. Learn more about how the codebase is structured in the Architecture Guide.

    Server Example

    server.ts
    import path from 'path'
    import { Host, DefaultHostOptions, expandToJson } from '@moviemasher/server-express'
    
    const configuration = process.argv[2] || path.resolve(__dirname, './server-config.json')
    const options = expandToJson(configuration)
    const host = new Host(DefaultHostOptions(options))
    host.start()

    In this example we're using the DefaultHostOptions function to create the Host constructor arguments from a JSON file with the following structure:

    server-config.json
    {
      "port": 8570,
      "previewSize": { "width": 480, "height": 270 },
      "outputSize": { "width": 1920, "height": 1080 }
    }

    We are setting the preview dimensions to their default for demonstration purposes. The server will pass these to the client and the client will apply them, but only after the CSS is applied so a resize will be visible if they differ. Preview dimensions should be overridden either in the client, or better still, in the CSS. If the defaults are overidden there they should be here too, since the client does NOT pass them to the server. The rendering server uses them to optimally size previews of uploaded video and images.

    We are also setting the output dimensions here, which are used as default values for both the rendering and streaming servers. Please note: they should always be an even multiple of the preview dimensions - in this case it's a multiple of four. Using different aspect ratios is actually supported, but then the preview in the client will not match the output of these servers.

    Learn more about building your own customized server in the Integration 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 send an email to discuss ways to contribute to the project.

    Keywords

    none

    Install

    npm i @moviemasher/server-express

    DownloadsWeekly Downloads

    0

    Version

    5.0.6

    License

    MPL-2.0

    Unpacked Size

    305 kB

    Total Files

    61

    Last publish

    Collaborators

    • syntropo