ets2la_capture is a DLL plugin for Euro Truck Simulator 2 and American Truck Simulator that grabs every rendered frame in full resolution and shares it with any number of clients through shared memory, with minimal latency for up to 10 clients at once.
Requires CMake 3.15+ and MSVC (Visual Studio 2019+). MinHook is fetched automatically at configure time.
cmake -B build -A x64
cmake --build build --config ReleaseOutputs ets2la_capture.dll (put it in <game>/bin/win_x64/plugins/)
Python client: pip install ./python (see python/README.md).
from ets2la_capture import FrameReader
reader = FrameReader()
frame = reader.get_frame()
bgr = frame.to_bgr()#include "ets2la_capture/frame_reader.h"
ets2la_capture::FrameReader reader;
ets2la_capture::Frame frame;
if (reader.get_frame(frame)) {}get_frameblocks for a frame newer than the last one this reader got. First call after connecting waits for a fresh frame.get_latest_frameis non-blocking.- Zero-copy views stay valid for ~5 newer frames (ring of 6). Finish (or
.copy()) within about 4 frame times, then checkvalid(). - GPU clients:
examples/python/torch_gpu.pyuploads straight from shared memory.