Record an OpenGL game in Linux using GLC

Get glc.

If starting the game in a terminal looks like `agame`, run this:

glc-capture agame

When you want the recording to start (and to stop), press

Shift + F8

Now convert the .glc file. If the game’s audio has been recorded, do this (after replacing the uppercase file names):

glc-play AGAME.glc -a 1 -o /tmp/agamesound.wav
glc-play AGAME.glc -o - -y 1 | ffmpeg -i - -i /tmp/agamesound.wav -acodec libmp3lame -ab 128k -ac 2 -vcodec libx264 -vpre slow -crf 22 -threads 0 "omgitworked.mp4"

If there is no audio, do this (after replacing the uppercase file name):

glc-play AGAME.glc -o - -y 1 | ffmpeg -i - -an -vcodec libx264 -vpre slow -crf 22 -threads 0 omgitworked.mp4

If you want to record a non-OpenGL game (many 2D games) or it just won’t work, perhaps the FFmpeg method will work!

Nikki and the Robots: Story Episodes
Buy the cute Überpixel™ style platformer now!

outrageously blatant self-promotion

About these ads
This entry was posted in qubodup and tagged , , , . Bookmark the permalink.

12 Responses to Record an OpenGL game in Linux using GLC

  1. Pingback: Where there's a will, be fast » “Bugger!” it’s official!

  2. Venn says:

    I would like to use this in a how-to for capture on a new live.TWIT.tv show. Granted, I use a *.mkv bit but; with your permission I will note the site in the how-to. In all honesty this was the 2′nd or 3′rd site I looked at before getting into GLC.

  3. Seb says:

    Thank you so much for this awesome software!
    Now I can record my OpenGL application to make a demo video.

  4. Seb says:

    (The big thanks goes of course to Martin Erik Werner for the software, but I also want to thank you for the converting commands.)

  5. Liviu says:

    Thanks for the nice tutorial. Here’s what worked for me:
    I encountered a lot of jerkiness when trying to record the game, and after consulting [1] I settled for teh following command.
    root@liv-laptop:~/tmp# nice -n -19 glc-capture –compression=none /usr/local/build/trigger/data/trigger

    I also needed to reduce the resolution of the game to 640×480. As for converting the resulting .glc file to something more portable, after consulting [2] I did the following:
    glc-play AGAME.glc -a 1 -o /tmp/agamesound.wav

    Then manually convert the .wav file to .mp3 (~192KB/s) using ‘soundconverter’, and then
    glc-play AGAME.glc -o – -y 1 | ffmpeg -i – -sameq -y /tmp/video.mp4
    ffmpeg -i /tmp/agamesound.mp3 -acodec copy -i /tmp/video.mp4 -vcodec copy omgitworked.mp4

    The audio part can still be improved and streamlined with ffmpeg, but I got the result that I wanted, so I didn’t bother to.

    [1] http://archive09.linux.com/feature/143775
    [2] https://github.com/nullkey/glc/wiki/Encode

  6. anonymous says:

    Not works:
    Unknown codec ‘libx264′

  7. Andrew says:

    I need to ask beause I feel like I’m missing something here: I’m trying to use GLC to record some videos but in the terminal I don’t know what I’m supposed to put in place of ‘agame’…if it’s a specific application name related to the game I’m playing then I have no idea what to put because nowhere will give me an example of what to put here. You are my shining beacon if you can illuminate this issue…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s