Giter Site home page Giter Site logo

adityakrshnn / framo Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 5.57 MB

Glorious media processing right in your browser with Typescript support ✨

License: MIT License

JavaScript 3.22% HTML 0.86% TypeScript 95.92%
ffmpeg-wasm filmstrip browser media-processing-api frame-extraction

framo's Introduction


Framo

Framo License CodeQL Lint & Test Framo bundle size Framo npm version Deepscan Framo Maintained yes

✨ Glorious media processing right in your browser with Typescript support ✨
Explore the docs »

Table of Contents

  1. About The Project
  2. Getting Started
  3. Features
  4. Observables
  5. Documentation
  6. License

About The Project

Framo aims to provide advanced media features on the browser itself without having to configure or setup multiple dependencies. It does all the hard work for you by using the best configurations for FFmpeg and only exposing the necessary options. See the full list of features.

Framo is made using:

Getting Started

Installation

To use Framo in your project

npm install framo

Usage

Initialize framo with initializeFramo() before using any of its features

const framo = new Framo();

await framo.initializeFramo();
...
OR
framo.initializeFramo().then(() => {
  ...
})

Alternatively, you can initialize framo asynchronously by subscribing to the ready observable.

const framo = new Framo();

framo.ready.subscribe(() => {
  ...
});
framo.initializeFramo();

Features

🎞️ Filmstrip : makeFilmstrip()

Make a filmstrip using frames at regular intervals.

const config: FilmstripRequestConfig = {
  file: <File>,
  filename: 'input.mp4',
  timeInterval: 1,
  outputExtension: FramoImageExtension.JPG,
  orientation: FilmstripOrientation.VERTICAL,

  /** Optional */
  resolution: {
    height: 150,
  },
  margin: 5,
  padding: 5,
  color: '#ff0000',
}

const filmstrip = await framo.makeFilmstrip(config);

🧵 Frames To Video : stitchFrames()

Stitch frames together to make a video.

const config: StitchFramesRequestConfig = {
  files: <Files>,
  inputExtension: FramoImageExtension.JPG,
  videoExtension: FramoVideoExtension.MP4;

  /** Optional */
  frameDuration: 1,
};

const frames = await framo.stitchFrames(config);

🖼 Frame Extractor : extractFrames()

Extract frames from videos at specific time points or at regular intervals.

const config: ExtractFramesRequestConfig = {
  file: <File>,
  filename: 'input.mp4',
  timeInterval: 5,
  outputExtension: FramoImageExtension.JPG,
};

const frames = await framo.extractFrames(config);

More features coming soon...

Observables

⚡ Ready

ready is triggered when framo is ready for operations.

framo.ready.subscribe(() => {
  ...
});

⚡ Progress

Subscribe to the progress observable to monitor operation progress.

framo.progress.subscribe((progress: Progress) => {
  ...
});

Documentation

For more details, please refer to the Documentation

License

Distributed under the MIT License. See LICENSE for more information.

framo's People

Contributors

adityakrshnn avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.