6.1.0 • Published 1 year ago

demrec v6.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

demrec

NodeJS wrapper for SourceVideoRender!

Installation

  • Download latest release of this fork
  • Set svr_dir in your config.ini to that SVR directory

Usage

let DemRec = require("demrec");
let dr = new DemRec("config.ini");

// prepare event log
let Events = Object.keys(DemRec.Events);
dr.on("log", (data) => {
  console.log(`EVENT: ${Events[data.event]}`);
});

// launch the game
await dr.launch();

// render a demo
await dr.record(
  "cooldemo.dem",
  {
    ticks: [300, 1800],
    spec: "soupcan", // player/steamid to spectate (SourceTV demo only)
    cmd: "mat_fullbright 1; volume 0.2", // commands to execute before recording
    out: "soupcan_does_cool_stuff", // output file
  },
  "output"
); // output folder
// result: -> output/soupcan_does_cool_stuff.mp4

// multiple recordings in a single demo supported
await dr.record(
  "Z:/demos/auto-20200724-224342-jump_haze.dem",
  [
    {
      ticks: [12710, 14067],
      spec: "STEAM_0:0:443798979",
      out: "toss_bonus1",
    },
    {
      ticks: [14359, 15936],
      spec: "STEAM_0:0:443798979",
      out: "toss_bonus2",
    },
    {
      ticks: [19334, 20723],
      spec: "STEAM_0:1:50458194",
      cmd: "spec_mode 5",
      out: "tom_wallclimbing",
    },
    {
      ticks: [21051, 22219],
      spec: "STEAM_0:1:50458194",
    },
  ],
  "output"
);
// results:
// output/toss_bonus1.mp4, output/toss_bonus2.mp4,
// output/tom_wallclimbing.mp4, output/out-4.mp4

// close the game
await dr.exit();

FFMPEG configuration

The default configuration in config.ini simply merges the resulting mp4 & wav files into a single mp4. If you remove the FFMPEG section entirely, output of dr.record will contain both files instead.

You can add additional FFMPEG jobs like this:

[FFMPEG]
-i "%INPUT%.mp4"
-c:v copy
-c:a aac
"%NEXT%.mp4"

[FFMPEG]
-i "%PREV%.mp4" # %INPUT% is no longer available at this point
-vf "vignette=angle=0.5"
"%OUT%.mp4"
6.1.0

1 year ago

6.0.0

1 year ago

5.8.1

2 years ago

5.8.0

2 years ago

5.7.0

2 years ago

5.6.5

2 years ago

5.6.4

2 years ago

5.6.3

2 years ago

5.6.2

2 years ago

5.6.1

2 years ago

5.6.0

2 years ago

5.5.5

3 years ago

5.5.4

3 years ago

5.5.3

3 years ago

5.5.2

3 years ago

5.5.1

3 years ago

5.5.0

3 years ago

5.4.2

3 years ago

5.4.1

3 years ago

5.4.0

3 years ago

5.3.8

3 years ago

5.3.7

3 years ago

5.3.6

3 years ago

5.3.5

3 years ago

5.3.4

3 years ago

5.3.3

3 years ago

5.3.2

3 years ago

5.3.1

3 years ago

5.1.3

3 years ago

5.3.0

3 years ago

5.1.2

3 years ago

5.1.1

3 years ago

5.1.0

3 years ago

3.4.0

3 years ago

3.2.1

3 years ago

3.2.0

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.6.0

3 years ago

3.4.2

3 years ago

3.4.1

3 years ago

3.0.0

3 years ago

4.2.3

3 years ago

4.4.0

3 years ago

4.2.2

3 years ago

4.2.5

3 years ago

4.2.4

3 years ago

4.0.0

3 years ago

4.2.1

3 years ago

4.2.0

3 years ago

5.2.3

3 years ago

5.2.2

3 years ago

5.2.1

3 years ago

5.2.0

3 years ago

5.0.1

3 years ago

5.0.0

3 years ago

4.2.7

3 years ago

4.2.6

3 years ago

3.3.1

3 years ago

3.3.0

3 years ago

3.1.0

3 years ago

3.5.2

3 years ago

3.5.1

3 years ago

3.5.0

3 years ago

4.1.0

3 years ago

4.3.0

3 years ago

2.3.0

3 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.3.1

3 years ago

2.2.2

3 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago