render-video

0.0.5 • Public • Published

render-video

Convert canvas animation to video in browser using WebCodecs API.

Basic usage

const mp4Blob = await renderVideo(async function(frameIndex) {
  if (frameIndex === canvasPlayer.totalFrames) return;

  await canvasPlayer.seek(frameIndex);

  return canvasPlayer.canvas;
});

download(mp4Blob);

Audio support

const mp4Blob = await renderVideo(getFrameCallback, {
  audio: "https://xxx/yyy.mp3"
});

Demos

canvas player https://ziyunfei.github.io/render-video/demo/canvas player.html

images slideshow https://ziyunfei.github.io/render-video/demo/images slideshow.html

gif to mp4 https://ziyunfei.github.io/render-video/demo/gif to mp4.html

lottie to mp4 https://ziyunfei.github.io/render-video/demo/lottie to mp4.html

screen recording https://ziyunfei.github.io/render-video/demo/screen recording.html

Browser support

Chrome 94+ only.

Readme

Keywords

none

Package Sidebar

Install

npm i render-video

Weekly Downloads

2

Version

0.0.5

License

none

Unpacked Size

3.03 MB

Total Files

10

Last publish

Collaborators

  • ziyunfei