Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

demrec

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

demrec

Demo Recorder Renderer

  • 3.6.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by33.33%
Maintainers
1
Weekly downloads
 
Created
Source

demrec

NodeJS wrapper for SourceVideoRender!

Setup

  • Get the latest version of SourceVideoRender (35+)
  • Configure settings in config.ini

Usage

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

// launch the game
await dr.launch()

// prepare progress log
dr.on('log', data => {
  switch(data.type) {
    case 'Skipping':
      console.log(`[${data.file}] Fast-Forwarding to start tick...`)
      break
    case 'Rendering':
      console.log(`[${data.file}] Rendering video file... ${data.progress}%`)
      break
  }
})

// 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()

FAQs

Package last updated on 01 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc