hero

HLTV Demo Parser

A focused PHP parser for reading metadata, timing, and entry tables from GoldSrc demo files.

Get Started

Reads GoldSrc demos

Supports .dem files from HLTV, Counter-Strike 1.6, Half-Life, Team Fortress Classic, Day of Defeat, and compatible mods.

Extracts useful metadata

Returns protocol versions, map name, map CRC, game directory, client name, start and end time, playback duration, parsed entries, and macro block frames.

Small PHP API

Built for PHP 8.2+ with PSR-4 autoloading, readonly DTOs, backed enums, typed exceptions, and only ext-mbstring required.

Predictable failures

Dedicated exceptions cover missing paths, wrong extensions, unreadable files, and invalid demo headers.

$parser = new \VitalyArt\DemoParser\Parser();
$parser->setDemoFile('/path/to/demo/pub-1609152130-de_dust2_2x2.dem');

$demo = $parser->getDemo();

echo $demo->getMapName();
echo $demo->getDuration();

Use the sidebar to move through installation, examples, the public API, supported formats, and contribution notes.