All Projects → dominikus → p5.rec

dominikus / p5.rec

Licence: MIT License
🍿 p5.rec lets you record your p5.js sketches and convert them to mp4 in your browser ▶️

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to p5.rec

camstudio
CamStudio fork
Stars: ✭ 83 (+18.57%)
Mutual labels:  ffmpeg, mp4, screen-recorder, screen-capture
Gifserver
A server for transcoding gif to video on the fly
Stars: ✭ 100 (+42.86%)
Mutual labels:  ffmpeg, mp4
Screen Recorder Ffmpeg Cpp
*Multimedia project* A screen recording application to capture your desktop and store in a video format. Click here to watch the demo
Stars: ✭ 98 (+40%)
Mutual labels:  ffmpeg, screen-capture
Vidgear
A High-performance cross-platform Video Processing Python framework powerpacked with unique trailblazing features 🔥
Stars: ✭ 2,048 (+2825.71%)
Mutual labels:  ffmpeg, screen-capture
canvas-capture
Record the canvas as an image, mp4 video, or gif from the browser
Stars: ✭ 35 (-50%)
Mutual labels:  ffmpeg, mp4
Live Dl
Download live streams from YouTube
Stars: ✭ 82 (+17.14%)
Mutual labels:  ffmpeg, mp4
Youtube2audio
Desktop application to download YouTube videos as annotated MP3 or MP4 files
Stars: ✭ 128 (+82.86%)
Mutual labels:  ffmpeg, mp4
Ffmediaelement
FFME: The Advanced WPF MediaElement (based on FFmpeg)
Stars: ✭ 733 (+947.14%)
Mutual labels:  ffmpeg, mp4
Ffmediatoolkit
FFMediaToolkit is a cross-platform video decoder/encoder library for .NET that uses FFmpeg native libraries. It supports video frames extraction, reading stream metadata and creating videos from bitmaps in any format supported by FFmpeg.
Stars: ✭ 156 (+122.86%)
Mutual labels:  ffmpeg, mp4
Swiftffmpeg
A Swift wrapper for the FFmpeg API
Stars: ✭ 243 (+247.14%)
Mutual labels:  ffmpeg, mp4
ZFScreenRecorder
录屏,支持暂停、取消
Stars: ✭ 38 (-45.71%)
Mutual labels:  screen-recorder, screen-capture
Sickbeard mp4 automator
Automatically convert video files to a standardized format with metadata tagging to create a beautiful and uniform media library
Stars: ✭ 1,142 (+1531.43%)
Mutual labels:  ffmpeg, mp4
Webxdownloader
Browser extension to download Webex meeting recordings
Stars: ✭ 52 (-25.71%)
Mutual labels:  ffmpeg, mp4
Tricycle
Video transcoding... easier than riding a bike.
Stars: ✭ 35 (-50%)
Mutual labels:  ffmpeg, mp4
live-stream-media-source-extensions
Live stream h264 encoded mp4 video on media source extensions using ffmpeg, node.js, socket.io, and express. Works in chrome, firefox, safari, and android. Not iOS compatible. Work has moved to mse-live-player repo =>
Stars: ✭ 24 (-65.71%)
Mutual labels:  ffmpeg, mp4
Ffscreencast
ffscreencast - ffmpeg screencast/desktop-recording with video overlay and multi monitor support
Stars: ✭ 1,625 (+2221.43%)
Mutual labels:  ffmpeg, screen-recorder
Ffmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
Stars: ✭ 27,382 (+39017.14%)
Mutual labels:  ffmpeg, mp4
Obs Studio
OBS Studio - Free and open source software for live streaming and screen recording
Stars: ✭ 34,115 (+48635.71%)
Mutual labels:  ffmpeg, screen-capture
Fastflix
FastFlix is a free GUI for HEVC and AV1 encoding, GIF/WebP creation, and more!
Stars: ✭ 154 (+120%)
Mutual labels:  ffmpeg, mp4
screencast
Interface to record a X11 desktop
Stars: ✭ 91 (+30%)
Mutual labels:  screen-recorder, screen-capture

p5.rec 🍿

Library for easy recording of p5.js sketches and in-browser conversion to MP4.

P5.rec hooks into the p5.js draw loop to produce buttery-smooth results 🧈🎉 to upload to Youtube, Instagram, Twitter, etc.

Unfortunately, p5.rec doesn't work on Firefox at the moment :( (see this issue)

Check out the demo:

👉🏽 Demo on p5js  👈🏽

How it works

If you've ever recorded your p5.js sketches with a screen recording tool like quickTime, you might have run into the problem of jerky recordings. If your sketch is too complex, rendering performance drops and frames are missing, since your screen recording tool doesn't know about what it's recording.

p5.rec solves this problem similar to CCapture. It hooks into the p5.js draw() loop. Once the drawing of a single frame is complete, that frame is stored and the next one is rendered. Usually this looks a bit broken in the browser, but the resulting video is guaranteed to contain every single frame in perfect quality.

Getting started

Import p5.rec from npm to your index.html after importing p5.js:

  <head>
  ...
  <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.0.0/p5.js"></script>
  <script type="module" src="https://unpkg.com/p5.rec"></script>
  ...

Launch with startRecording(options) (global mode):

  startRecording();

and stop your recording with

  stopRecording();

API

startRecording( options ): Starts the recording. Don't worry if the p5.js frame starts to look choppy, that's just so that p5.rec can do it's magic 🧙🏼‍♀️. Options is optional (just like each of its attributes) and gives you more control over the result:

  startRecording({
    preset: "slow",
      // H264 preset. One of [ "ultrafast",
      //                       "superfast",
      //                       "veryfast",
      //                       "faster",
      //                       "fast",
      //                       "medium",
      //                       "slow",
      //                       "slower",
      //                       "veryslow"]
      // See https://trac.ffmpeg.org/wiki/Encode/H.264
    crf: 18,
      // crf (Constant Rate Factor) defines video quality and
      // goes from 0 (maximum quality/size) to 51 (worst quality possible)
      // See https://trac.ffmpeg.org/wiki/Encode/H.264#crf
    onProgress: (progress) => console.log(progress),
      // callback for the encoding progress. *progress* is a float from 0 to 1.
    onFinish: (videoBuffer) => {},
      // callback for the resulting Uint8array. By default, p5.rec shows an overlay for checking and downloading the result.
  });

stopRecording(): Stops the recording and starts the transcoding. When starting transcoding, p5.rec has to download @ffmpeg/core (around 25MB) which takes a while. Once you see 'starting transcoding' on the console the actual transcoding (and callbacks to onProgress) starts.

When no specific callback is provided for onFinish p5.rec opens an overlay with the result. In Chrome, you can use the 'Download' feature (bottom right) to download the result:

How to download from the overlay

Limitations

p5.rec at the moment only supports p5's global mode. I'm working on getting it running in instance mode as well (See this issue).

Also in general, p5.rec unfortunately takes a while to do its job. So just be patient :)

Examples

Check out the examples from /examples for ways to use p5.rec locally.

Alternatives

You might also want to use:

  • CCapture hooks into requestAnimationFrame to arrive at a similarly smooth result and let's you export webm and gif among others.
  • p5js-gif-recoder uses CCapture to export gifs directly from p5.
  • p5.createLoop creates loops and exports them as gifs from p5.

Relies on

p5.rec is using @ffmpeg/ffmpeg for doing the transcoding.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].