{"id":17166465,"url":"https://github.com/pbeshai/p5js-ccapture","last_synced_at":"2025-04-10T20:44:08.536Z","repository":{"id":54974711,"uuid":"155118011","full_name":"pbeshai/p5js-ccapture","owner":"pbeshai","description":"An example of using p5.js with CCapture.js for exporting frames","archived":false,"fork":false,"pushed_at":"2021-01-22T23:39:42.000Z","size":7,"stargazers_count":44,"open_issues_count":0,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T18:15:10.478Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://peterbeshai.com/p5js-ccapture/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pbeshai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-28T21:35:31.000Z","updated_at":"2023-09-19T11:42:34.000Z","dependencies_parsed_at":"2022-08-14T07:50:51.572Z","dependency_job_id":null,"html_url":"https://github.com/pbeshai/p5js-ccapture","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/pbeshai%2Fp5js-ccapture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pbeshai%2Fp5js-ccapture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pbeshai%2Fp5js-ccapture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pbeshai%2Fp5js-ccapture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pbeshai","download_url":"https://codeload.github.com/pbeshai/p5js-ccapture/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248294245,"owners_count":21079810,"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":[],"created_at":"2024-10-14T23:05:47.559Z","updated_at":"2025-04-10T20:44:08.517Z","avatar_url":"https://github.com/pbeshai.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# p5.js recording with CCapture.js example\n\nA demonstration of how to record a [p5.js](https://p5js.org/) animation using [CCapture.js](https://github.com/spite/ccapture.js).\n\nIf you only need the first 15 frames, you can use p5.js' [saveFrames()](https://p5js.org/reference/#/p5/saveFrames) function, but for more than that they recommend using a different library such as CCapture.js.\n\nRead [the blog post](https://peterbeshai.com/p5js-ccapture.html) for more details.\n\nSee **[index.html](https://github.com/pbeshai/p5js-ccapture/blob/master/index.html)** for the code or [view the live demo](https://peterbeshai.com/p5js-ccapture/).\n\n\n### Create video from ffmpeg\n\n- **Frame rate**: 30 (see `fps` in the code)\n- **Dimensions**: 540x540 (should match `createCanvas()` in the code)\n- **Frame filenames**: `\"%07d.png\"` (incrementing numbers, 7 numbers long)\n- **Quality (CRF)**: 17 (see [ffmpeg docs](https://trac.ffmpeg.org/wiki/Encode/H.264), but 17–28 is reasonable, 0 is lossless)\n\n```\nffmpeg -r 30 -f image2 -s 540x540 -i \"%07d.png\" -vcodec libx264 -crf 17 -pix_fmt yuv420p output.mp4\n```\n\n\n### Create a GIF from ImageMagick's convert\n\n|   |   |\n| ---- | ----- |\n| frame delay | = 100 \u0026times; 1 / frame rate |\n|  | = 100 / 30 |\n|  | = 3.33 |\n\n```bash\nconvert -delay 3.33 -loop 0 *.png output.gif\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpbeshai%2Fp5js-ccapture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpbeshai%2Fp5js-ccapture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpbeshai%2Fp5js-ccapture/lists"}