Omniclip Documentation

repository·main·Indexed 23 days ago

https://github.com/omni-media/omniclip

An open-source, browser-based video editor using WebCodecs for high-performance rendering. It can be used as a standalone application or embedded via custom elements like <omni-text>, <omni-media>, and <omni-timeline>. Features include trimming, splitting, transitions, effects, and WebRTC-based collaborative editing. Built with TypeScript and @benev/slate, it follows a unidirectional data flow model.

Tokens
2K
Snippets
6
Records
19
Agent score
81%

What's inside Omniclip

  1. How Omniclip components work together

    main

    Omniclip is an open-source, browser-based video editor designed for privacy and performance. It uses modern browser APIs like WebCodecs for high-performance rendering directly in the browser.

    Key Capabilities:

    • Editing: Trimming, splitting, rotating, resizing, and text styling.
    • Media Support: Text, Audio, Video (mp4, mov, etc.), and Images.
    • Advanced Features: Undo/Redo, transitions, effects (filters), and project management.
    • Rendering: Supports various timebases (10-120 fps) and resolutions up to 4k.
    • Collaboration: Uses WebRTC for collaborative editing.

    Note on Compatibility: Because it relies on WebCodecs, it may not function correctly on older browsers or devices that lack support for these modern APIs.

  2. Understand the Omniclip architecture

    main

    Omniclip follows a unidirectional data flow model. Data flows in a single direction from actions to state, and from state to components. The architecture is composed of four key layers:

    1. State: Holds the application data.
    2. Actions: Triggers changes to the state.
    3. Controllers: Manages logic and orchestrates actions.
    4. Components/Views: The UI layer that renders based on the state.

    The project is built using TypeScript and @benev/slate.

  3. Set up a local development environment for Omniclip

    main

    To contribute to the Omniclip repository, follow these steps to set up your local environment:

    1. Clone the repository:
      git clone git@github.com:omni-media/omniclip.git
    2. Install dependencies:
      npm install
    3. Build the project:
      npm run build
    4. Start the development server:
      npm start
    git clone git@github.com:omni-media/omniclip.git
    npm install
    npm run build
    npm start
  4. Install Nippo Webfonts

    main

    To install the Nippo webfonts, follow these steps to organize your project files:

    1. Place the nippo/ folder inside a directory named fonts/.
    2. Place the nippo.css file inside your css/ directory.
    3. (Optional) If your website filesystem differs from the default, update the url('path') declarations within nippo.css to point to the correct font file locations.
    4. Import the nippo.css file at the top of your main stylesheet using the @import rule.
    @import url('nippo.css');
  5. Install the Poppins Webfont

    main

    To install the Poppins webfont, follow these steps to organize your filesystem and import the styles:

    1. Place the poppins/ folder into a directory named fonts/.
    2. Place poppins.css into your css/ directory.
    3. (Optional) If your website filesystem differs from the default, update the url('path') declarations inside poppins.css to point to the correct font file locations.
    4. Import the CSS file at the top of your main stylesheet using @import.
    @import url('poppins.css');
  6. Install and use Omniclip components in your application

    main

    You can embed Omniclip's video editing components directly into your own web projects. This allows you to use specific parts of the editor (like the timeline or text tools) or the entire editing experience.

    1. Install the package via npm:

      npm install omniclip
    2. Register the elements in your JavaScript entry point to make the custom elements available in the DOM:

      import {getComponents, registerElements} from 'omniclip'
      registerElements(getComponents())
    3. Add the components to your HTML. You can use specific components or include all of them for the full editor experience:

      • <omni-text></omni-text>: Text editing component.
      • <omni-media></omni-media>: Media handling component.
      • <omni-timeline></omni-timeline>: Timeline management component.
    npm install omniclip
  7. Use Poppins font styles in CSS

    main

    Once installed, you can apply the Poppins font family to elements using the following font-family values:

    font-family: Poppins-Thin;
    font-family: Poppins-ThinItalic;
    font-family: Poppins-ExtraLight;
    font-family: Poppins-ExtraLightItalic;
    font-family: Poppins-Light;
    font-family: Poppins-LightItalic;
    font-family: Poppins-Regular;
    font-family: Poppins-Italic;
    font-family: Poppins-Medium;
    font-family: Poppins-MediumItalic;
    font-family: Poppins-SemiBold;
    font-family: Poppins-SemiBoldItalic;
    font-family: Poppins-Bold;
    font-family: Poppins-BoldItalic;
    font-family: Poppins-ExtraBold;
    font-family: Poppins-ExtraBoldItalic;
    font-family: Poppins-Black;
    font-family: Poppins-BlackItalic;
    font-family: Poppins-Variable;
    font-family: Poppins-VariableItalic;
  8. Import core Omniclip components and context

    main
    The @omnimedia/omniclip entrypoint exports the central OmniContext for managing application state, along with specialized components for media, timelines, and text. It also provides utility functions for DOM registration and ID generation via @benev/slate.