{"id":19210486,"url":"https://github.com/itchio/capsule","last_synced_at":"2025-04-15T17:24:08.666Z","repository":{"id":66881827,"uuid":"58953965","full_name":"itchio/capsule","owner":"itchio","description":"🎬 Cross-platform hotkey short video capture for games","archived":false,"fork":false,"pushed_at":"2019-05-06T10:27:30.000Z","size":2711,"stargazers_count":180,"open_issues_count":12,"forks_count":14,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-28T23:04:04.815Z","etag":null,"topics":["itchio","sharing","video-game"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itchio.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-16T17:46:34.000Z","updated_at":"2025-03-27T23:18:29.000Z","dependencies_parsed_at":"2023-02-23T14:15:58.736Z","dependency_job_id":null,"html_url":"https://github.com/itchio/capsule","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/itchio%2Fcapsule","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itchio%2Fcapsule/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itchio%2Fcapsule/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itchio%2Fcapsule/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itchio","download_url":"https://codeload.github.com/itchio/capsule/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249117035,"owners_count":21215327,"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":["itchio","sharing","video-game"],"created_at":"2024-11-09T13:36:14.592Z","updated_at":"2025-04-15T17:24:08.638Z","avatar_url":"https://github.com/itchio.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# capsule\n\ncapsule augments any game so that pressing a key records a video+audio clip. Those clips\ncan be easily shared later, see [this tweet](https://twitter.com/moonscript/status/846061609009143809) for example.\n\nIt's being developed mainly for integration with the [itch.io app](https://itch.io/app),\nbut is designed as a separate pair of projects:\n\n`libcapsule` is responsible for detecting which video \u0026 audio APIs a game uses, and intercepting\ncalls to them so that it may capture video and audio frames.\n\n`capsulerun` is responsible for launching the game, injecting libcapsule, establishing a connection to it,\nreceiving video and audio frames, encoding, and muxing them.\n\nSee [Build instructions](#build-instructions) if you know enough to give it a shot :)\n\n## Design goals\n\n  * Easy to use - no configuration, hit a key = record (think FRAPS)\n  * Fast - should slow down games as little as possible\n  * Quality recordings - high FPS, preserve colorspace when possible\n  * Desktop audio - all captured gameplay should come with audio\n  * Easy sharing - output should be immediately useful (H264/AAC)\n\n## Non-goals\n\nThings that are *out of scope* (ie. that capsule will not officially support):\n\n  * Compositing (more than one video source, etc.)\n  * Live-streaming\n  * Any platforms that aren't Linux, macOS, or Windows (especially mobile, BSDs, etc.)\n  * Long videos - haven't settled on a maximum yet but \"a few minutes\"\n  * Hooking into existing processes - capsulerun must be used to launch game\n\n## Status\n\n### Core\n\n  * System\n    * [x] capsulerun launches child, relays stdout/stderr, injects 32-bit \u0026 64-bit processes properly\n    * [x] capsulerun handles child quitting unexpectedly, relays exit code\n    * [x] capsulerun \u0026 libcapsule communicate via a pair of fifos/named pipes, send frames via shared memory\n    * [x] capsulerun has 'headless' mode where it doesn't launch a child, acts as just an encoder (HTML5 games, etc.)\n  * Video\n    * [x] encoder outputs variable fps h264 video, aac audio, in an mp4 container\n\n### Linux\n\n  * Control\n    * [x] X11 recording hotkey support (hardcoded to F9)\n  * Video\n    * [x] OpenGL capture\n    * [ ] Vulkan capture\n  * Audio\n    * [x] ALSA: Intercepts ALSA API calls, only F32LE supported so far\n    * [x] PulseAudio: Captures monitor of default output device\n\n### macOS\n\n  * Control\n    * [x] Cocoa recording hotkey support (hardcoded to F9)\n  * Video\n    * [x] OpenGL capture\n    * [ ] Vulkan capture\n  * Audio\n    * [x] CoreAudio: Intercepts API calls, only F32LE supported so far\n\n### Windows\n\n  * Control\n    * [x] Win32 recording hotkey support (hardcoded to F9)\n  * Video\n    * [x] Direct3D 9 capture\n    * [ ] Direct3D 10 capture\n    * [x] Direct3D 11 capture (with GPU color conversion \u0026 dummy overlay)\n    * [ ] Direct3D 12 capture\n    * [ ] Vulkan capture\n  * Audio\n    * [x] Wasapi: Intercepts API calls, only F32LE supported so far\n    * [x] Wasapi fallback: captures default loopback device\n\n## Build instructions\n\n**This project is being ported to Go \u0026 Rust. These instructions are OUTDATED.**\n\ncapsule is a (set of) CMake projects, which handles things like:\n\n  * Download some dependencies\n  * Generating Makefiles, MSVC project files, etc.\n  * Doing 32/64-bit tests\n  * Bundling required libraries with the final executable\n\nLike typical CMake projects, capsule should be built in a subfolder, never \ndirectly in the source tree, as you'll see in platform-specific instructions\n\n### Building on Linux\n\nNotes: some distributions ship libav, most distributions ship outdated\nversions of ffmpeg, save yourself some trouble and build x264 and ffmpeg 3.2+\nyourself into a prefix. You can then pass it to cmake with `-DCAPSULE_DEPS_PREFIX=/path/to/prefix`\n\n64-bit and 32-bit versions are built separately. Example of 64-bit build:\n\n```bash\ncd /path/to/capsule\nmkdir build64\ncd build64\ncmake ..\nmake install -j4\n```\n\ncapsulerun usage:\n\n```bash\n/path/to/capsule/build64/dist/capsulerun -- path/to/some/game.x86_64\n```\n\nIf nothing's happening, the game isn't using OpenGL, you've got the wrong capsule architecture\n(64-bit for a 32-bit game for example), or there's something capsule doesn't support yet.\n\nNB: Launcher scripts may give you a bit of trouble at the moment, as capsulerun will establish\na connection with the shell and not the game, which will fail. This will be addressed later.\n\n### Building on macOS\n\nPretty much the same as Linux, except you don't need to compile x264 \u0026 ffmpeg yourself,\na stripped-down home-cooked universal build will be downloaded by cmake.\n\nThe resulting capsulerun \u0026 libcapsule are universal, which means there's no separate\n32-bit/64-bit build processes and they should work with every app, no matter what their architecture.\n\nExample build:\n\n```bash\ncd /path/to/capsule\nmkdir build\ncd build\ncmake ..\nmake install -j4\n```\n\ncapsulerun supports launching .app bundles and invididual executables. Example usage:\n\n```bash\n/path/to/capsule/build/dist/capsulerun -- path/to/some/Game.app\n```\n\n### Building on Windows\n\nImportant notes:\n\n  * Microsoft Visual C++ (MSVC) is needed, 2015 is what we're using internally.\n  * CMake shipped with msys2 won't cut it, you need a Windows release of CMake (which\n  includes the Visual Studio project generators): \u003chttps://cmake.org/\u003e\n\n**You probably won't get anywhere with an MSVC older than 2015.**\n\nFrom the `Visual C++ 2015 Native Build Tools Command Prompt`, run:\n\n```batch\ncd C:\\path\\to\\capsule\nmkdir build32\ncd build32\ncmake -G \"Visual Studio 14 2015\" ..\n```\nTo compile, run this from the build32 folder:\n\n```batch\nmsbuild INSTALL.vcxproj\n```\n\n(You can use `/maxcpucount:n` to speed up the build process, since capsule is\nbroken down in a few projects - where `n` is the maximum number of CPUs you want to use)\n\nTo build a 64-bit version, add ` Win64` to the generator name (the `-G` parameter).\n\n```\nC:\\path\\to\\capsule\\build32\\dist\\capsulerun.exe -- some_game.exe\n```\n\nNB: Some games with launchers (for example UE4 games) may give you a bit of trouble at the moment,\nas capsulerun will establish a connection with the launcher and not the game, which will fail.\nThis will be addressed later.\n\n## License\n\ncapsule is released under the GPL v2 license, see the `LICENSE` file.\n\nIt uses the following libraries:\n\n  * ffmpeg (for AAC encoding, muxing): \u003chttps://ffmpeg.org/\u003e\n  * x264 (for H264 encoding): \u003chttp://www.videolan.org/developers/x264.html\u003e\n  * Deviare-InProc (for hooking on Windows): \u003chttps://github.com/nektra/Deviare-InProc/\u003e\n  * argparse: \u003chttps://github.com/cofyc/argparse\u003e\n  * OpenGL, DXGI, Direct3D for capture\n\nSome of its code is derived from the following projects:\n\n  * OBS studio: \u003chttps://github.com/jp9000/obs-studio\u003e\n\nSpecial thanks to:\n\n  * [@moonscript](https://twitter/moonscript) for sponsoring my work on it as part of \u003chttps://itch.io\u003e\n  * [@Polyflare](https://twitter.com/Polyflare) for advice and code\n  * [@roxlu](https://twitter.com/roxlu) for advice and code\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitchio%2Fcapsule","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitchio%2Fcapsule","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitchio%2Fcapsule/lists"}