ldcapture is a frame perfect recording tool by injecting itself into the target application.
Since this hijacks some internal functions, some Anti-Cheats may detect this a cheating. Use this tool at your own risk and make sure the target application doesn't use an Anti-Cheat or is fine with this.
$ git clone https://github.com/psyGamer/ldcapture
$ cd ldcapture
$ make release
The resulting shared library is located under ./bin/ldcapture.so
Use the following command to start you program with ldcapture:
LD_PRELOAD="path/to/ldcapture.so" ./your-program
In order to control ldcapture you can use the API functions prowided.
To get a function pointer for those API functions you can call dlsym(_, "apiFunctionName")
. The first parameter is ignored. The second parameter is the API function name.
void ldcapture_StartRecording()
: Starts the recordingvoid ldcapture_StopRecording()
: Stops the recordingvoid ldcapture_StopRecordingAfter(i32)
: Stops the recording after the specifed amount of framesvoid ldcapture_ReloadConfig()
: Reloads the config file.
If a file called ldcapture.conf
exists in your working directory, it will try to use it as a config file.
The following example config is intended for use with Celeste, but can be adapted to work with everything:
fps = 60
video_width = 1920
video_height = 1080
video_bitrate = 6500000
audio_bitrate = 128000
audio_samplerate = 48000
container_type= "mp4"
video_codec = "libx264"
audio_codec = "aac"
video_codec_options = {
preset = "ultrafast"
}
fps
:The framerate of the recordingvideo_width
: The output video width of the recordingvideo_height
: The output video height of the recordingvideo_bitrate
: The output video bitrate of the recordingaudio_bitrate
: The output audio bitrate of the recordingaudio_samplerate
: The output audio samplerate of the recordingcontainer_type
: Output container type as the file extension. For example:mp4
. See: Video container formats - Wikipediavideo_codec
: If not empty, overwrites the output video codec. See: Video codecs - Wikipediaaudio_codec
: If not empty, overwrites the output audio codec. See: Audio codecs - Wikipediavideo_codec_options
: Set of codec options specific it the specified codec. See the codecs documentation for the options and the above example for the formatting.audio_codec_options
: Set of codec options specific it the specified codec. See the codecs documentation for the options and the above example for the formatting.
Currently only Linux with OpenGL X11 and FMOD is supported.
You should install the ldcapture-CelesteInterop mod, which provides easy access to the API functions via the debug console.
Additionally you might also want to consider installing the .NET Core version of Everest, since it greatly improves performance. NOTE: This version is still in development and not stable. Use it at you own risk.
If you are not using ldcapture-CelesteInterop, use the following command:
LD_PRELOAD="path/to/ldcapture.so" ./Celeste
If you are using ldcapture-CelesteInterop, use the following commands depending on your .NET platform. If you don't know what this means, use the ".NET Framework" command.
.NET Framework: LD_PRELOAD="/path/to/ldcapture.so" LD_LIBRARY_PATH="./lib64:" ./Celeste
.NET Core: LD_PRELOAD="/path/to/ldcapture.so" LD_LIBRARY_PATH="./lib64-linux:" ./Celeste
If you need help setting this up, have a features request or a bug report, please open an issue here. Alternativly, you can DM me on Discord or ping me in the Celeste Discord: psyGamer#8442
This project was mainly inspired by .kkapture.