open-audiovisual
Search GitHub

oav-p5 reference · Recording

OAVp5.record.fps#

variableoav-p5
OAVp5.record.fps

Also: OAVp5.record.limit

The frame rate (fps) and the longest take in seconds (limit) that the loading options recfps and reclimit set.

They are there to read: OAVp5.record.limit tells a sketch how long a take can be. Writing to them changes nothing, because a take reads the options, not these two. To record at another frame rate once, pass startRecording({ fps: 60 }); to change the limit, set the reclimit option before oav-p5 loads (window.OAV_P5 = { reclimit: 600 }).

Type
Number
Range
fps 1..60, limit 1 …

fps is 30 and limit is 300 unless the options say otherwise (fps is kept between 1 and 60).

Examples

jsOpenProcessing ↗
function setup() {
  createCanvas(400, 300);
  textSize(14);
}

function draw() {
  background(20);
  fill(255);
  text('a take is ' + OAVp5.record.fps + ' frames a second', 20, 30);
  text('and at most ' + OAVp5.record.limit + ' seconds (' + OAVp5.record.limit / 60 + ' minutes)', 20, 60);
}
Prints the two defaults: 30 frames a second and 300 seconds.

Related

  • startRecording() Records the canvas and the sound your sketch makes into one video file, and returns a promise that says whether the recording began.
  • OAVp5.record The object behind the recording names: the state, the time, the last file, the formats this browser can write and the screenshot function.

p5/oav-p5.js, line 1916

↑ Back to top · All names