Giter Site home page Giter Site logo

doriclaudino / p5.recorder Goto Github PK

View Code? Open in Web Editor NEW
28.0 5.0 5.0 3.08 MB

record and export p5js canvas as webm, mp4, gif

Home Page: https://editor.p5js.org/doriclaudino/sketches/LgLw5UaBr

License: MIT License

JavaScript 99.98% HTML 0.01% CSS 0.01%
p5 p5js javascript sketch art mp4 export-video ffmpeg

p5.recorder's Introduction

p5.recorder

NPM

npm version

styled with prettier contributions welcome

Install (CDN)

<!--jsdelivr-->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/p5.recorder.js"></script>

Install (NPM)

npm install p5.drawer
or
yarn install p5.drawer

Example using default options:

let rec = new p5.Recorder();
rec.start();

//stop after some time
rec.stop();

Example using custom options:

let autoDownloadFile = false

//set to no download at the end
let rec = new p5.Recorder(autoDownloadFile);

let options = {
  filename: "my_custom_name_output.webm",
  recordAudio: true,
  audioBitRate: 128000,
  videoBitRate: ‭100000000‬ , //10 megabits
  fps: 45,
}

//passing custom configs
rec.start(options);

//stop after some time
rec.stop();

/**
 * contains current status
 * status: {
 *   frames: 0,
 *   progress: 0,
 *   state: undefined,
 *   time: undefined,
 * }
 */
rec.status;


//download the file after stop
rec.download();

default options start() method:

name value
filename "p5.recorder.canvas.webm"
recordAudio true
audioBitRate 128000
videoBitRate 120000000
fps 60

enable audio

Don't forget to CHECK enable audio (we are trying a better approach to capture audio-context on p5js-sound):

Image description

commands

  • yarn dev
  • yarn build

still in development

only support .webm for now

for future reference

https://editor.p5js.org/doriclaudino/sketches/LgLw5UaBr

p5.recorder's People

Contributors

doriclaudino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

p5.recorder's Issues

Implementing mp4

Really excited for this and your example here does an amazing job of exporting an mp4 too (the main element missing from most canvas recording techniques, as not too many platforms/apps support webm).

Is the ffmpeg.min.js from the example your own reduction for this conversion or from somewhere else? Was trying to find a simple way to convert webm's to mp4 in browser or blobs straight to mp4 and couldn't find anything nearly so small... only 10+ mb libs.

Can't wait for mp4 to be part of this library and hope you'll include some sort of options in the method for which/multiple formats to save on export (like in example above).

NPM Install instructions wrong

Currently npm instructions are:

npm install p5.drawer

npm install p5.recorder will install the right package (however it doesn't seem to be functional anymore)

edit: typo

Capture in headless mode

Great library. Helps me record my animations as videos and a great help.

would be nice to also have the feature to record videos using nodejs in headless browser

Thanks

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.