{"id":18371106,"url":"https://github.com/welefen/canvas2video","last_synced_at":"2025-04-06T02:11:11.057Z","repository":{"id":42371077,"uuid":"255314488","full_name":"welefen/canvas2video","owner":"welefen","description":"Convert dynamic canvas to video, support merge audio","archived":false,"fork":false,"pushed_at":"2022-04-08T10:59:14.000Z","size":130,"stargazers_count":254,"open_issues_count":4,"forks_count":28,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-30T01:09:04.224Z","etag":null,"topics":["canvas","canvas2video","capturestream","ffmpeg","mediarecorder","video"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/welefen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-13T12:05:26.000Z","updated_at":"2025-01-12T22:37:50.000Z","dependencies_parsed_at":"2022-08-12T09:51:40.909Z","dependency_job_id":null,"html_url":"https://github.com/welefen/canvas2video","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/welefen%2Fcanvas2video","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/welefen%2Fcanvas2video/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/welefen%2Fcanvas2video/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/welefen%2Fcanvas2video/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/welefen","download_url":"https://codeload.github.com/welefen/canvas2video/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423515,"owners_count":20936626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["canvas","canvas2video","capturestream","ffmpeg","mediarecorder","video"],"created_at":"2024-11-05T23:43:01.102Z","updated_at":"2025-04-06T02:11:11.035Z","avatar_url":"https://github.com/welefen.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# canvas2video\n\n![](https://img.shields.io/npm/v/canvas2video.svg?style=flat-square)\n\nConvert dynamic canvas to video, support merge audio (use [ffmpeg.wasm](https://github.com/ffmpegwasm/ffmpeg.wasm))\n\n## Install\n\n```js\nnpm i canvas2video\n```\n\n## Usage\n\n```js\nimport { Canvas2Video } from \"canvas2video\";\n```\n\n```html\n\u003cscript src=\"https://unpkg.com/canvas2video/dist/canvas2video.js\"\u003e\u003c/script\u003e\n\u003c!--if convert video type or merge audio, must be include ffmpeg.js in html file --\u003e\n\u003cscript src=\"https://unpkg.com/@ffmpeg/ffmpeg/dist/ffmpeg.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  const canvas = document.querySelector(\"canvas\");\n  const instance = new Canvas2Video({\n    canvas: canvas,\n    workerOptions: {\n      // logger: str =\u003e console.error(str),\n    },\n    // audio: 'http://s5.qhres.com/static/465f1f953f1e6ff2.mp3'\n  });\n  instance.startRecord();\n\n  setTimeout(() =\u003e {\n    instance.stopRecord();\n  }, 3000);\n\n  instance\n    .getStreamURL()\n    .then((url) =\u003e {\n      console.log(\"video url\", url);\n    })\n    .catch((err) =\u003e console.error(err));\n\u003c/script\u003e\n```\n\n## Demo\n\n- [canvas to video](./demo/index.html)\n- [canvas to video, convert to mp4](./demo/mp4.html)\n- [canvas to video, convert to mp4, merge audio](./demo/audio.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwelefen%2Fcanvas2video","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwelefen%2Fcanvas2video","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwelefen%2Fcanvas2video/lists"}