For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

Recording Unreal footage

for Unreal & UnrealTournament
Post Reply
User avatar
GreatEmerald
OldUnreal Member
Posts: 5347
Joined: Mon May 21, 2007 2:30 pm

Recording Unreal footage

Post by GreatEmerald »

Now that I'm going to start a run of Unreal: RtNP, I tried and figured out how to record the game on Linux. It's a bit complex, though, so I'll share the method I discovered.

Important thing to note is that Unreal is a 32-bit game, so you need 32-bit recording software. Which can be quite a hassle to find these days! Thankfully, the Simple Screen Recorder (SSR) has a library called ssr-glinject that can also be built in 32-bit (and is built in openSUSE at least, in the Packman repository).

However, Unreal isn't very cooperative and will immediately segfault if you try to record it regularly. It seems to not like things being in its LD_PRELOAD for some reason, and to get accelerated recording, an OpenGL hook is needed.

The good thing is that the Linux version of Unreal actually allows you to specify the name of the OpenGL library to load! So you can specify to load the ssr-glinject library like this:

Code: Select all

[OpenGLDrv.OpenGLRenderDevice]
OpenGLLibName=libssr-glinject.so
That works to get the hooks, but of course you won't be able to do much without SSR itself running. And it always tries to use LD_PRELOAD, thus crashing the game. But there's a workaround you can do: simply make SSR call `bash -c 'LD_PRELOAD="" ./UnrealLinux.bin'` – that way the program sets LD_PRELOAD, but the command it executes unsets it immediately before starting the game. The "bash" part is needed because otherwise SSR will assume that LD_PRELOAD is the name of the executable.

Don't forget to set the Working Directory to your Unreal/System directory (UnrealLinux.bin isn't smart enough to figure out where it resides in, unfortunately).

So that's the short version. It will work just as well as it does recording any other program when set up that way.

However, there are some extra things I personally need that SSR doesn't handle. First, I have two monitors, and SDL by default puts the game on the wrong one. That can be solved with an additional environment variable.

Second is mouse acceleration. SDL by default doesn't do anything to change it, it uses the desktop settings (which means you get mouse acceleration). The optimal way to toggle it is to use `xinput` to first disable it and then re-enable it.

Third is sound. SSR lacks a way to record more than one sound stream at the moment. And I need to record both the game audio and the microphone... There's a workaround for that too: http://www.maartenbaert.be/simplescreenrecorder/recording-game-audio/

So in the end I made myself two scripts to handle it all. One script for launching SSR (have to set up the audio before launching it), and one for launching Unreal with all those extra features. The first one looks like this at the moment:

Code: Select all

#!/bin/sh
pactl load-module module-null-sink sink_name=duplex_out
pactl load-module module-null-sink sink_name=game_out
pactl load-module module-loopback source=game_out.monitor latency_msec=1
pactl load-module module-loopback source=game_out.monitor sink=duplex_out latency_msec=1
pactl load-module module-loopback sink=duplex_out latency_msec=1
simplescreenrecorder
pactl unload-module module-loopback
pactl unload-module module-null-sink
Note that in pavucontrol, if you right-click on a sink's name, you can change it. I named the duplex_out one "Unified" and the game_out "Game". These names will stick around. Make sure to put the inputs the way it's explained in the above webpage and set SSR to record "Monitor of Unified" or whatever else you named duplex_out.

In my case, somehow Unreal refused to get remapped to the Game sink... No idea why, setting it simply didn't do anything. But thankfully there is another environment variable, called PULSE_SINK, that controls which sink the program should output the sound to.

The Unreal launcher script ended up being this:

Code: Select all

#!/bin/sh
MOUSE_NAME="The full name of your mouse"
cd /path/to/Unreal/System

xinput set-prop "$MOUSE_NAME" "Device Accel Profile" -1
PULSE_SINK=game_out SDL_VIDEO_FULLSCREEN_HEAD=0 LD_PRELOAD="" ./UnrealLinux.bin
xinput set-prop "$MOUSE_NAME" "Device Accel Profile" 0
You get the full name of your mouse by running `xinput list`. You can use the numerical ID as well, but you might get problems if you connect the mouse to a different USB slot down the road.
Also note that profile 0 is the default profile. If you use a different profile, use the profile number you want at the second command there.

To get SSR to execute this, I have in OpenGL Settings [ch8594] Command `bash ~/bin/unreal-ssr.sh` (the latter is of course the path to the script above). As a bonus, since I have that `cd` statement in my script, I no longer need to enter anything into Working Directory.

So after that everything works very nicely. And the person who made SSR is working on a nicer way to record multiple inputs, so I'll be able to drop one of the scripts once that is done.
Post Reply

Return to “Linux-Board”