Skip to content
ETS2LAPublic

About

ETS2/ATS plugin that shares full resolution frames via shared memory

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

17 Commits

Folders and files

Repository files navigation

ets2la_capture

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.

Build

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 Release

Outputs ets2la_capture.dll (put it in <game>/bin/win_x64/plugins/)

Python client: pip install ./python (see python/README.md).

Reading frames

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_frame blocks for a frame newer than the last one this reader got. First call after connecting waits for a fresh frame.
  • get_latest_frame is non-blocking.
  • Zero-copy views stay valid for ~5 newer frames (ring of 6). Finish (or .copy()) within about 4 frame times, then check valid().
  • GPU clients: examples/python/torch_gpu.py uploads straight from shared memory.

About

ETS2/ATS plugin that shares full resolution frames via shared memory

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages