Warzone video capture under linux

Other talk that doesn't fit elsewhere.
This is for General Discussion, not General chat.
Post Reply
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Warzone video capture under linux

Post by NoQ »

What's the easiest way to record a warzone game on video under linux? I've used a few tools already (xvidcap, recordMyDesktop), but they aren't able to capture the 3d graphics.
(putting a camera in front of the screen is not discussed :lol2: )
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Warzone video capture under linux

Post by NoQ »

Just a little success story: suddenly found out that gtk_recordMyDesktop does the job well enough. The "Full shots at every frame" button makes sure 3d content is recorded, and without "Encode on the fly", it doesn't affect game performance too much. Unfortunately, this doesn't record game in fullscreen anyway, but recording windowed game works well.

One of the problems is that you can occasionally move the window, and the recording area will remain on its place, recording the desktop below the window, hence the name of the application. One of the solutions is to use some more advanced window manager that allows you to 1. undecorate the game window, so that you couldn't move it via the titlebar by mistake and to 2. put the game always on top, so that you couldn't hide it behind some other window. GNOME's metacity sucks; not sure about KDE's kwin4, haven't seen it for a while. As for me, i'm using openbox, so i just added the following to the applications section of the config:

Code: Select all

	<application name="warzone2100">
		<decor>no</decor>
		<layer>above</layer>
	</application>
Last edited by NoQ on 19 Feb 2011, 17:45, edited 1 time in total.
User avatar
tmp500
Trained
Trained
Posts: 120
Joined: 30 Jun 2010, 16:31

Re: Warzone video capture under linux

Post by tmp500 »

gnome sucks? lol... anyways.... right click on upper application and click on "stay always on top".... or make a shortcut
gconf-editor
/apps/metacity/window_keybindings/toggle_above

ill give record my desktop another try... last time i felt the performance drop.
tmp
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Warzone video capture under linux

Post by NoQ »

gnome sucks? lol...
Rather metacity. I don't have anything against gnome. :oops:
toggle_above
Hmm, nice. What about undecorate? :roll:
What about setting this as default for warzone2100? ;)
cybersphinx
Inactive
Inactive
Posts: 1695
Joined: 01 Sep 2006, 19:17

Re: Warzone video capture under linux

Post by cybersphinx »

When I tried screen recording tools, only ffmpeg (as described in e.g. http://verb3k.wordpress.com/2010/01/26/ ... -on-linux/) worked without noticeable slowdown. I didn't get it to record sound (didn't try long though), but you can set openal to output a wav file and put them together manually. It also records fullscreen games, just set it to record the game resolution.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Warzone video capture under linux

Post by NoQ »

only ffmpeg (as described in e.g. http://verb3k.wordpress.com/2010/01/26/ ... -on-linux/) worked without noticeable slowdown
Nice one! But seems to bring in some artefacts for me. /me hates ATI Uhh :(

But the file size with -vpre lossless_ultrafast is obviously smaller than what gtk-recordMyDesktop gives, and fps around 14 on my pc (when capturing 800x480) is good enough. Still, file size wasn't a problem so far.
Safety0ff
Trained
Trained
Posts: 397
Joined: 18 Jul 2009, 23:23

Re: Warzone video capture under linux

Post by Safety0ff »

User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Warzone video capture under linux

Post by NoQ »

Thanks!
Where were you guys half a year ago when i asked this question? (:
Safety0ff
Trained
Trained
Posts: 397
Joined: 18 Jul 2009, 23:23

Re: Warzone video capture under linux

Post by Safety0ff »

NoQ wrote:Thanks!
I am curious, which one did the trick for you?
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Warzone video capture under linux

Post by NoQ »

/me wrote:Just a little success story: suddenly found out that gtk-recordMyDesktop does the job well enough.
:roll:
Don't worry, it's all right, i know how hard it is to read someone else's messages!
Safety0ff
Trained
Trained
Posts: 397
Joined: 18 Jul 2009, 23:23

Re: Warzone video capture under linux

Post by Safety0ff »

NoQ wrote:
/me wrote:Just a little success story: suddenly found out that gtk-recordMyDesktop does the job well enough.
:roll:
Don't worry, it's all right, i know how hard it is to read someone else's messages!
That's an unfair comment. You followed that up with that that program brought in artefacts so I thought that the search was still on.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Warzone video capture under linux

Post by NoQ »

Ok never mind. Sorry for making this unclear. :oops:
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Warzone video capture under linux

Post by NoQ »

Bump. That's what i've been using for dozens of videos without any obvious problems:

Code: Select all

#!/bin/sh
# Interrupt this script with Ctrl+C when the record is over, 
# and then allow it to finish the audio compression and 
# multiplexing (shouldn't take long).

# Feel free to adjust the settings below
XRESOLUTION=800
YRESOLUTION=480
FRAMERATE=15
XSHIFT=0
YSHIFT=0
BITRATE=1300
OUTPUT="final.avi"
TEMPVIDEO="raw.avi"
TEMPAUDIO="raw.wav"
DISPLAY=":0.0"

# Clean up, just in case
rm "${TEMPVIDEO}"
rm "${TEMPAUDIO}"
rm "${OUTPUT}"

sox -t alsa "default" -t wav "${TEMPAUDIO}" | ffmpeg -isync -f x11grab -s ${XRESOLUTION}x${YRESOLUTION} -r ${FRAMERATE} -i ${DISPLAY}+${XSHIFT},${YSHIFT} -vcodec mpeg4 -b ${BITRATE}k "${TEMPVIDEO}";

ffmpeg -isync -i "${TEMPAUDIO}" -i "${TEMPVIDEO}" -acodec libmp3lame -vcodec copy "${OUTPUT}"

rm "${TEMPVIDEO}"
rm "${TEMPAUDIO}"
Usage: Install ffmpeg and sox packages. Use your audio mixer to set audio capture device to "Mix" ("Monitor", whatever). Find a good fixed position for the Warzone 2100 window (eg., top left corner of the screen. hint: with some window managers, you can force the position of the window to be always the same). Save this text as an .sh script, adjust the necessary settings (resolution, frame rate, window position ("shift") etc.) and run in the console. When you want to stop the recording, press Ctrl+C once and then let it finish some post-processing (should be relatively fast; no video re-encoding occurs).

Technical: I'm using divx codec for video, encoding on the fly. The resulting video is ready for youtube upload, even though the quality is lossy; divx with default settings also seems to be slightly faster than h264 -vpre lossless_ultrafast. Audio is captured with sox (because it is free from some weird desync problems that occur when i use pure ffmpeg), and a-v sync information is piped to ffmpeg, but the audio itself is stored in a separate file instead. Then, after the recording, the second command assembles the final .avi file from raw audio and video files created by the first command; encoding audio to mp3 happens here as well.
Post Reply