{"id":20050035,"url":"https://github.com/kldzj/puppeteer-stream","last_synced_at":"2025-05-05T11:31:03.390Z","repository":{"id":57682752,"uuid":"471749129","full_name":"kldzj/puppeteer-stream","owner":"kldzj","description":"Screen capture puppeteer pages using either CDP tools or fmmpeg's x11grab","archived":false,"fork":false,"pushed_at":"2022-03-20T14:09:39.000Z","size":29,"stargazers_count":14,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-02T10:58:56.213Z","etag":null,"topics":["capture","ffmpeg","puppeteer","record","screen","stream","x11grab"],"latest_commit_sha":null,"homepage":"https://npmjs.com/@kldzj/puppeteer-stream","language":"TypeScript","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/kldzj.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":"2022-03-19T16:21:42.000Z","updated_at":"2025-04-26T22:49:48.000Z","dependencies_parsed_at":"2022-09-15T17:50:25.407Z","dependency_job_id":null,"html_url":"https://github.com/kldzj/puppeteer-stream","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kldzj%2Fpuppeteer-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kldzj%2Fpuppeteer-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kldzj%2Fpuppeteer-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kldzj%2Fpuppeteer-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kldzj","download_url":"https://codeload.github.com/kldzj/puppeteer-stream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252488959,"owners_count":21756241,"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":["capture","ffmpeg","puppeteer","record","screen","stream","x11grab"],"created_at":"2024-11-13T11:53:50.513Z","updated_at":"2025-05-05T11:31:03.068Z","avatar_url":"https://github.com/kldzj.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Using this package you are able to screen capture your puppeteer pages.\n\n## Installation\n\nTo use this package a [ffmpeg](https://www.ffmpeg.org/) binary needs to be available. You can obtain it from [here](https://ffmpeg.org/download.html) or using the [ffmpeg-static](https://www.npmjs.com/package/ffmpeg-static) package.\n\nUsing yarn:\n\n```sh-session\n$ yarn add @kldzj/puppeteer-stream\n```\n\nUsing npm:\n\n```sh-session\n$ npm i -S @kldzj/puppeteer-stream\n```\n\n## Usage\n\nView the [examples](https://github.com/kldzj/puppeteer-stream/tree/master/examples) on how to use this package.\n\n### Notes on using the `x11` recorder\n\nWhen using the `x11` recorder it is recommended to render to a [`xvfb`](https://en.wikipedia.org/wiki/X_Window_System#Xvfb) server.\n\n```sh-session\n$ export DEBUG=puppeteer-stream:*\n$ xvfb-run -s \"-screen 0 1920x1080x24\" yarn ts-node examples/x11.ts\n```\n\n### Code\n\n```typescript\nconst browser = await puppeteer.launch();\nconst page = await browser.newPage();\n\n// https://github.com/puppeteer/puppeteer/issues/6904\nconst streamer = new PuppeteerStreamer(page as unknown as Page, {\n  // ffmpegPath: '/path/to/ffmpeg',\n  output: {\n    format: 'mp4',\n    path: join(process.cwd(), 'output.mp4'),\n  },\n  frameSize: {\n    width: 1280,\n    height: 720,\n  },\n  fps: 30,\n});\n\n// navigate page\nawait page.goto('https://example.com');\n\n// start recording\nawait streamer.start();\n\n// do something\nawait page.waitFor(1000);\n\n// stop recording\nawait streamer.stop();\n\n// finish up\nawait browser.close();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkldzj%2Fpuppeteer-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkldzj%2Fpuppeteer-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkldzj%2Fpuppeteer-stream/lists"}