npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

demrec

v6.1.0

Published

Demo Recorder Renderer

Downloads

13

Readme

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"