Skip to content
This repository has been archived by the owner on Sep 18, 2022. It is now read-only.

Installation and usage

Ivan Molodetskikh edited this page Dec 20, 2017 · 12 revisions

Video covering the installation and basic usage: https://youtu.be/yIoirAI-gkI

Dependencies

hl-capture requires the 32-bit OpenCL ICD to run, and (optionally) a GPU-specific 32-bit OpenCL package to actually utilize the GPU acceleration (which may be included with the GPU driver). Below you can see the package names for some of the distributions:

  • Arch Linux: lib32-ocl-icd
  • Fedora: ocl-icd.i686
  • Ubuntu-based: ocl-icd-opencl-dev:i386

Installation

First of all, make sure not to connect to multiplayer servers with hl-capture loaded, as this could cause a VAC ban.

Download or build libhl_capture.so. Get the full path to the folder where you put it (for example, by running pwd from the terminal in that folder). If your distribution does not provide 32-bit FFMpeg libraries, or if the ones provided don't work, you can download a static build with the main codecs here.

The easiest way of loading hl-capture (that, unfortunately, doesn't always work) is going into Half-Life's properties by right clicking it in Steam's game list, then pressing Set Launch Options, and entering LD_PRELOAD="/full/path/to/your/libhl_capture.so" %command%. Launch Half-Life through Steam and verify that hl-capture is loaded by checking that cap_ console commands and variables exist. Make sure to clear the launch options after you're done using hl-capture to not get VAC banned accidentally by connecting to a multiplayer server with hl-capture loaded.

Another way is by using a shell script to run Half-Life. Download this example script, change the variables inside appropriately, mark it as executable. Then launch Half-Life with hl-capture by running the shell script. If you get errors like

libGL error: unable to load driver: radeonsi_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: radeonsi
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast

then you need to delete libstdc++.so.6 and libgcc_s.so.1 located in ~/.steam/bin32/steam-runtime/i386/usr/lib/i386-linux-gnu/.

Usage

Once again, make sure not to connect to multiplayer servers with hl-capture loaded, as this could cause a VAC ban.

Launch Half-Life in fullscreen to make hl-capture use the GPU acceleration, which makes everything way faster. If you don't have OpenCL installed or your GPU does not support it, the game will freeze for about 5 seconds the first time you try to start the capturing.

If you need to quickly capture and upload a demo, you can simply do playdemo <name>;cap_start and wait for the demo to finish playing back. The video will be saved to capture.mp4 in your Half-Life folder.

In general, the capturing is started with cap_start and stopped with cap_stop. By default, the capturing is stopped automatically when a demo stops playing. This can be changed with cap_playdemostop.

There is a number of console commands and variables to customize the default behavior. The main rule is that if some CVar looks similar to one of HLAE's CVars, it does the same thing.

Some useful things:

  • cap_test checks your settings and tells you if anything is wrong,
  • cap_filename sets the video path and filename,
  • cap_fps controls the video FPS,
  • cap_crf changes the video quality (higher is worse quality but less file size),
  • cap_video_encoder and cap_audio_encoder set the video and audio encoder,
  • cap_x264_preset controls the x264 preset, set to ultrafast for really fast capturing.

The full list of console commands and variables can be found on this page.

Clone this wiki locally