PDA

View Full Version : Howto: Record on GNU/Linux with hardware accelerated encoder


Mashu
01-23-2018, 08:54 AM
1 Pre-requirements

1.1 Operating system

Using GNU/Linux Debian sid.
The Intel HD Graphics 530 (Skylake GT2) in my case is my primary graphics, running GNOME 3 desktop. My secondary graphics is GeForce GTX 960M in Optimus setup (by default disabled).

1.2 Required hardware

Nvidia graphics card with hardware encoder capabilities. These include Maxwell architectures first generation for H264 (h264_nvenc) and newer architectures for h265 (hvenc).

1.3 Software

I installed the following packages

apt-get install bumblebee bumblebee-nvidia \ # To run Optimus Nvidia setup
ffmpeg \ # For encoding video
simplescreenrecorder # Recording application
2 Launching game with Nvidia

To start game with Nvidia GPU in case when desktop runs on primary graphics (Optimus configuration) you need to start

cd live
optirun ./game LOGIN <md5password>
This is I heard normal way of doing it, however it does not work for me, I can't connect to server, and I am using Steam instead, where in Game properties -> Set Launch Options you enter

optirun %command%
3 Launching game with SSR-GLInject

To record OpenGL applications, and not the whole desktop Window, which is convenient you need to preload the following library

optirun ssr-glinject %command%
It basically allows capturing frames from OpenGL application directly into recorder in an efficient way and comes with simplescreenrecorder.
Documented by author here http://www.maartenbaert.be/simplescreenrecorder/recording-steam-games/

4 Setting up SimpleScreenRecorder

Start recorder in Optimus mode


optirun simplescreenrecorder

Video Input

Record OpenGL
Frame rate: 25
Don't scale your video, it will lose a lot in quality, change resolution of your game context instead if files get too big

File

Matroska (MKV)

Video

Codec "Other"
Codec name: h264_hvenc
Bitrate: 5000
Custom options: preset=fast,crf=11,keyinit=1
Audio
MP3


Ready
Now you are ready to record your Champions of Regnum movies or PvP fights.
I hope this is useful for community or I can get some feedback from NGD.

Would be nice to figure out why I can't start a game without steam

optirun ./game LOGIN <md5>

I am getting error in Regnum's own dialog window on black screen that Server not available O01 and game exits.