WideCapture is an experimental utility designed to capture 360-degree (equirectangular) gameplay video from DirectX 11 applications. It utilizes DLL Injection, API Hooking, Compute Shaders, and Zero-Copy Hardware Encoding to achieve panoramic recording without requiring access to the game's source code.
Warning
Development Status: Proof of Concept
This project is currently in the Alpha stage. While the core infrastructure (injection, hooking, and FFmpeg integration) is implemented, advanced features like reliable camera control and seamless stitching are still in development.
The documentation below outlines the technical goals and architecture. Please anticipate instability, visual artifacts, and API limitations in the current build.
- Universal Compatibility: Works with most DirectX 11 games (Unity, Unreal Engine, proprietary engines).
- Zero-Copy Pipeline: Data never leaves the GPU. Surfaces are shared directly between DirectX and the Video Encoder.
- Compute Shader Stitching: Converts 6 cubemap faces to Equirectangular projection purely on the GPU.
- Hardware Acceleration: Direct integration with FFmpeg's D3D11VA and NVENC/AMF for substantial performance.
- Camera Hijacking: Heuristic analysis of Constant Buffers to identify and manipulate the game's camera for 6-axis rendering.
WideCapture functions by injecting into the target process and hooking key graphics API calls:
- Injection: The DLL enters the process and spins up a capture thread.
- Hooking: Intercepts
IDXGISwapChain::Presentto control the frame cycle andID3D11DeviceContext::VSSetConstantBuffersto manipulate the camera. - Rendering: For every single game frame, the engine is tricked into rendering 6 times (Front, Back, Left, Right, Up, Down).
- Stitching: A Compute Shader (
ProjectionShader.hlsl) samples these 6 views and writes to a single Equirectangular texture. - Encoding: The texture is passed to FFmpeg via D3D11 hardware context for immediate H.264 encoding.
- OS: Windows 10/11 (x64)
- Compiler: MSVC v142+ (Visual Studio 2019/2022) with C++17 support.
- Installation Requirement: You must install the Desktop development with C++ workload.
- Open the Visual Studio Installer.
- Select the Workloads tab.
- Check Desktop development with C++.
- Ensure the "Installation details" on the right include:
- MSVC ... C++ x64/x86 build tools
- Windows 10 (or 11) SDK
- Installation Requirement: You must install the Desktop development with C++ workload.
- Tools: CMake 3.20+, Python 3.x (for injection scripts).
Ensure the following libraries are placed in the external/ directory:
-
DirectXMath: microsoft/DirectXMath
-
Download the source code or specific header files.
-
Place the header files in
external/DirectXMath/include. -
Ensure the structure looks like this:
external/DirectXMath/ โโโ include/ โโโ DirectXMath.h โโโ DirectXMathConvert.inl โโโ DirectXMathMatrix.inl โโโ DirectXMathMisc.inl โโโ DirectXMathVector.inl โโโ ...
This external dependency is required to ensure full DirectXMath support on MinGW, which may have incomplete system headers.
-
-
FFmpeg (Static Libraries for MSVC):
-
Download a static build from artryazanov/ffmpeg-msvc-prebuilt (e.g.,
ffmpeg-n8.0.1-gpl-amd64-static.zip).- Note: Standard builds from gyan.dev do not contain the necessary static libraries for MSVC.
-
Extract the contents into
external/ffmpeg. -
Ensure the structure matches:
external/ffmpeg/ โโโ include/ # Header files (.h) โ โโโ libavcodec/ โ โโโ libavformat/ โ โโโ ... โโโ lib/ # Static libraries (.a) โโโ libavcodec.a โโโ libavformat.a โโโ ... โโโ pkgconfig/ โโโ ...
Note: This project is configured to link FFmpeg statically. You do not need to copy any FFmpeg DLLs to the output directory.
-
-
MinHook: TsudaKageyu/minhook
-
Clone the repository or download the source code.
-
Place the contents in
external/minhook. -
Ensure
CMakeLists.txtis located atexternal/minhook/CMakeLists.txt. Structure:external/minhook/ โโโ CMakeLists.txt โโโ include/ โ โโโ MinHook.h โโโ src/ โโโ ...
The project will automatically build MinHook as part of the solution.
-
-
Clone the repository:
git clone https://github.com/artryazanov/wide-capture.git cd WideCapture -
Configure with CMake:
mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=Release -
Build:
cmake --build . --config ReleaseArtifacts
WideCapture.dllandshaders/will be generated inbuild/Release.
If you use JetBrains CLion, critical configuration is required to match the MSVC environment:
-
Toolchain:
- Go to
Settings->Build, Execution, Deployment->Toolchains. - Add a Visual Studio toolchain (Click
+->Visual Studio). - Do not use MinGW or Cygwin. The static libraries are linked for MSVC.
- Ensure Architecture is set to
x64(amd64).
- Go to
-
Set as Default:
- In the Toolchains list, select the Visual Studio toolchain you created.
- Use the Up Arrow button (or drag and drop) to move it to the very top of the list.
- This ensures CLion automatically uses MSVC as the default compiler for all CMake profiles.
To use WideCapture with a target game, you must copy the built artifacts to the game's executable directory (where Game.exe is located).
Required Files:
WideCapture.dll: The main library.RGBToNV12.hlsl: Shader for video conversion.shaders/folder: ContainsProjectionShader.hlsl(Core compute shader).
Steps:
- Go to your build output folder (e.g.,
build/Release/). - Copy
WideCapture.dllandRGBToNV12.hlsl. - Copy the
shadersfolder. - Paste them all into the folder containing the game executable.
Folder Structure Example:
GameFolder/
โโโ Game.exe
โโโ WideCapture.dll
โโโ RGBToNV12.hlsl
โโโ shaders/
โโโ ProjectionShader.hlsl
Use the provided Python script to inject the DLL into your target game.
python scripts/inject.py <process_name.exe> <path/to/WideCapture.dll>Example: python scripts/inject.py SkyrimSE.exe build/Release/WideCapture.dll
- Automatic Start: Recording begins immediately upon successful initialization of the graphics hooks.
- Unload: Press the
ENDkey to stop recording, finalize the MP4 file, and unload the DLL safely.
To allow video players (YouTube, VLC) to recognize the file as 360ยฐ video, inject the spatial media metadata:
# Requires Google's spatial-media tool
python spatial_media_injector.py -i record_360.mp4 -o final_output.mp4WideCapture/
โโโ src/
โ โโโ Core/ # Hooks, Logger, Entry Point
โ โโโ Graphics/ # DX11 Management, Cubemap Logic
โ โโโ Compute/ # Shaders & Compilation
โ โโโ Camera/ # Matrix Math & Camera Control
โ โโโ Video/ # FFmpeg D3D11VA Backend
โโโ external/ # Dependencies (MinHook, FFmpeg, DirectXMath)
โโโ scripts/ # Injection & Utility scripts
โโโ CMakeLists.txt # Build Configuration
This software is for educational and research purposes only. Using this tool in multiplayer games may trigger anti-cheat software (VAC, BattlEye, EasyAntiCheat) resulting in bans. Use only in single-player modes or controlled environments.
This project is licensed under the MIT License - see the LICENSE file for details.
This project makes use of the following third-party libraries:
- MinHook: Developed by TsudaKageyu. Licensed under the BSD 2-Clause License.
- FFmpeg: Licensed under the GNU General Public License (GPL) version 3.
- DirectXMath: Developed by Microsoft. Licensed under the MIT License.