Re: [mediacapture-record] Ability to tell MediaRecorder to maximize frame rate (#177)

Note that frame rate necessarily must change when input is variable width and height frames https://plnkr.co/edit/4Tb91b?preview, https://plnkr.co/edit/Axkb8s?preview. [webm-writer](https://github.com/thenickdude/webm-writer-js) which decodes WebP image VP8 frame has the ability to set frame rate https://plnkr.co/edit/Inb676?preview, in pertinent part, setting frame rate manually

```
      for (const blobURL of media) {
        await new Promise(async resolve => {
          video.addEventListener("pause", e => {
            controller.close();
            const currentFrames = frames[frames.length - 1];
            const [frame] = currentFrames;
            frame.duration = video.currentTime - frame.duration;
            frame.frameRate = (frame.duration * 60) / currentFrames.length -1;
            done.then(resolve);
          }, {
            once: true
          });
          video.src = blobURL;
        });
      }
      console.log(frames);
      for (const frame of frames) {
        const [{
          duration, frameRate, width, height
        }] = frame;
        console.log(frameRate);
        const framesLength = frame.length;
        const frameDuration = Math.ceil((duration * 1000) / framesLength);
        for (let i = 1; i < framesLength; i++) {
          videoWriter.addFrame(frame[i], frameDuration, width, height);
        }
      }
```

`MediaRecorder` could add that option. The requirement is possible now using various means, include `pause()`, `resume()`; seeking to every frame https://bugs.chromium.org/p/chromium/issues/detail?id=1065675.



-- 
GitHub Notification of comment by guest271314
Please view or discuss this issue at https://github.com/w3c/mediacapture-record/issues/177#issuecomment-661550076 using your GitHub account

Received on Tuesday, 21 July 2020 01:51:31 UTC