{"id":19138020,"url":"https://github.com/lemonpi/window_recorder","last_synced_at":"2025-10-14T07:03:48.507Z","repository":{"id":49226679,"uuid":"300999021","full_name":"LemonPi/window_recorder","owner":"LemonPi","description":"Programatically video record a window with a python context manager in Linux","archived":false,"fork":false,"pushed_at":"2024-07-22T23:45:19.000Z","size":25,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T02:41:16.344Z","etag":null,"topics":["context-manager","programmatic","python","record","record-video","screen-capture","screen-recorder","video-recording"],"latest_commit_sha":null,"homepage":"","language":"Python","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/LemonPi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-03T23:08:57.000Z","updated_at":"2024-12-01T09:38:46.000Z","dependencies_parsed_at":"2024-07-23T03:11:25.249Z","dependency_job_id":null,"html_url":"https://github.com/LemonPi/window_recorder","commit_stats":{"total_commits":21,"total_committers":2,"mean_commits":10.5,"dds":0.09523809523809523,"last_synced_commit":"ce0d4240add21d85f8038a5ee39f03627406d974"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LemonPi%2Fwindow_recorder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LemonPi%2Fwindow_recorder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LemonPi%2Fwindow_recorder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LemonPi%2Fwindow_recorder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LemonPi","download_url":"https://codeload.github.com/LemonPi/window_recorder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249664139,"owners_count":21308086,"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":["context-manager","programmatic","python","record","record-video","screen-capture","screen-recorder","video-recording"],"created_at":"2024-11-09T06:41:28.066Z","updated_at":"2025-10-14T07:03:43.469Z","avatar_url":"https://github.com/LemonPi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Installation\nThis only works on Linux systems. You should have `xwininfo` installed by default.\n\n```shell\npip install window-recorder\n```\n\nIf the above does not work (OpenCV can be finicky), then you can install the dependencies manually.\nInstall `opencv` and `mss` as dependencies (recommended with conda):\n```\nconda install opencv\nconda install -c conda-forge python-mss\n```\nThen clone this repository anywhere and install locally with\n```\npip install -e .\n```\n\n## Usage\nThe `WindowRecorder` class comes as a context manager.\nYou pass in a list of window names to record and it will try to find them\nin the order given, recording the first one with a valid window configuration.\nIf you pass in None as the first argument, then instead it will prompt you\nto click on a window (cursor turns into a cross and blocks until you click).\n\nThe video will start and end recording according to the life cycle of the\ncontext manager.\n\n```python\nfrom window_recorder import WindowRecorder\nimport time\n\n# passing in nothing as the window name will allow you to select the window by clicking\n# want to capture an RViz window, which could have name \"RViz*\" as well\nwith WindowRecorder([\"RViz*\", \"RViz\"], frame_rate=30.0, name_suffix=\"rviz\"):\n    # do things...\n    time.sleep(0.1)\n    start = time.time()\n    while time.time() - start \u003c 2:\n        time.sleep(0.1)\n```\n\nYou can test it out with `scripts/text.py` which will prompt you to\nclick a window that it will then record for 2 seconds\n(see the log for the default location the video will be saved to)\n\nTo not record, a `record=False` argument can be passed to the constructor for better convenience than unindenting the block\nand not using the context manager.\n```python\nfrom window_recorder import WindowRecorder\nimport time\nwith WindowRecorder([\"RViz*\", \"RViz\"], frame_rate=30.0, name_suffix=\"rviz\", record=False):\n    # will not record; the arguments above also won't be checked and you won't be asked to click a window\n    time.sleep(0.1)\n    start = time.time()\n    while time.time() - start \u003c 2:\n        time.sleep(0.1)\n```\n\n### Limitations\nThe original location of the window will be what is actually recorded,\nso if you move the window during the recording or another window comes\nin front of it, that will also be recorded.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemonpi%2Fwindow_recorder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flemonpi%2Fwindow_recorder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemonpi%2Fwindow_recorder/lists"}