Coder Social home page Coder Social logo

video2longexposure's Introduction

video to longexposure

Journey

Built this project to create images that looks like long exposure photos based on video samples.

In the beggining of the project I tried to use imagemagick as an old known lib and turns out it worked really well (check tag v0.3-worker-based). The process based on imagemagick is good to see the steps of merging and you can check the halfstep samples to see lower levels of this long exposure

However the imagemagick based strategy was a bit slow and became worse on 8K samples so I tried another strategies like array processing using the Jimp lib which was way faster than imagemagick at the beggining but couln't handle the large images when converting to a classic javascript number array (tag v0.4).

Then I tried processing on GPU, using the gpu.js lib, this approach was little bit faster than jimp alone but took too much effort to configure the gpu kernel function and had the same problem of classic number array for larger images (tag v0.5).

To solve the problem of large arrays I used the buffer directly processing color by color of bitmap and reducing the sum of each pixel to a bigger buffer then mapping back the reduction to a bitmap with the average of each pixel.

Usage

The scripts starts on merge.mjs, it requires the video file path and a framerate, node merge.mjs vids/test4.mp4 30 . the result will be sabe as buffered01.png, I didn't add any configuration to output however it's possible to change directly into merge.mjs file at const filename="result.png". It's using the last version created, buffer process over workers to split the process between CPU cores.

video2longexposure's People

Contributors

msproesser avatar

Stargazers

Silvio Silva avatar

Watchers

 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.