Linkin' Linux

For system help, all hardware / software topics NOTE: use Coders Corner for all coders topics.

Moderators: Krom, Grendel

Post Reply
User avatar
sdfgeoff
DBB Ace
DBB Ace
Posts: 498
Joined: Wed Jan 12, 2011 1:07 am
Location: Low Earth Orbit
Contact:

Linkin' Linux

Post by sdfgeoff »

Well, For those who know, I'm making Defender, a descent clone. As part of managing this project I have to release videos every now and then on youtube to let people know I'm alive.
My first (and so far only) video was OK, but suffered from a low frame-rate due to my computer not having enough power to run teh game AND record the screen (even only part of if).

So what I tried today was getting my even worse computer (a laptop), hooking it up via ethernet and then "ssh"ing the main computer. Then I used the bad computer to do the recording, while the main computer played the game, in theory.....
What actually happened was that ran about the same (1 or 2 fps faster actually), but it still used a lot of the main computers processor just to record. The command I used to record was:

Code: Select all

ffmpeg -f X11grab -vc avi -s vga -r 25 -sameq -i :0.0 ~/screenCapture.avi
And because I ran that command from the sshed terminal it was still doing all the processing on the main computer.

Can anyone think of a better way of linking the two computers to further distribute the load, or just reduce the power necessary to record (currently sitting at a good 40% total CPU)?
Eh?
User avatar
fliptw
DBB DemiGod
DBB DemiGod
Posts: 6459
Joined: Sat Oct 24, 1998 2:01 am
Location: Calgary Alberta Canada

Re: Linkin' Linux

Post by fliptw »

if you have the space, capturing it uncompressed, on another HD, would save on the CPU time.

can't blender render to video by itself?

I wouldn't try it over the network myself.

whats your setup anyways?
User avatar
Thenior
DBB Captain
DBB Captain
Posts: 667
Joined: Wed Oct 06, 2004 9:40 am

Re: Linkin' Linux

Post by Thenior »

You should probably use some kind of capture card, so all you're doing is recording video input.
User avatar
snoopy
DBB Benefactor
DBB Benefactor
Posts: 4435
Joined: Thu Sep 02, 1999 2:01 am

Re: Linkin' Linux

Post by snoopy »

Thenior wrote:You should probably use some kind of capture card, so all you're doing is recording video input.
You can do this, except that limits the resolution that you can use.

I struggled with this stuff for a while. I'd recommend that you check out recordmydesktop.

Here's my script to record game-play:

Code: Select all

#!/bin/sh
#record.sh
cd ~
if test -f pid.log
then
cat ~/pid.log | xargs kill -s int
killall parec
rm pid.log
sleep 600
rec-comp.sh
else
        window=`xwininfo -name "StarCraft II" | grep -i "StarCraft II" | awk {'print $4'}`
        echo $window
        recordmydesktop --no-sound --full-shots --windowid $window &
#       parec -d alsa_output.pci-0000_03_05.0.analog-stereo.monitor | sox -t raw -r 44100 -sb 16 -c 2 - audiorec.wav &

PROCNAME="recordmydesktop"
PID=`ps -ef | grep -i $PROCNAME | grep -v grep | awk {'print $2'} | head -1`
echo $PID > pid.log
fi
I tied this script to a hotkey... hit the hotkey once, and it starts recording, hit it again and it stops the recording and launches a compress script that encodes the output:

Code: Select all

#!/bin/sh
#rec-comp.sh

if test -f out.ogv
then
mencoder -profile desktop1 -audiofile audiorec.wav -o /dev/null out.ogv
date '+%F-%R.avi' | xargs -t mencoder $1 -profile desktop2 out.ogv -audiofile audiorec.wav -o
rm divx2pass.log
rm out.ogv
rm audiorec.wav
fi
and the mencoder profile:

Code: Select all

[desktop1]
ovc=xvid=1
oac=mp3lame=1
ffourcc=DX50=1
xvidencopts=pass=1:bitrate=1000:threads=3
lameopts=cbr=1:br=128

[desktop2]
ovc=xvid=1
oac=mp3lame=1
ffourcc=DX50=1
xvidencopts=pass=2:bitrate=1000:threads=3
lameopts=cbr=1:br=128

It's been a while since I used the scripts, so they probably need some tweaking. I didn't have the audio recording portion in use, so no promises on that- last time I messed with it was while I was running pulseaudio. It'd need some help to be converted over to alsa. I'd probably use arecord instead of sox.

I found that recordmydesktop didn't take many resources.... it just needs to write a lot to the disk.
Arch Linux x86-64, Openbox
"We'll just set a new course for that empty region over there, near that blackish, holeish thing. " Zapp Brannigan
User avatar
snoopy
DBB Benefactor
DBB Benefactor
Posts: 4435
Joined: Thu Sep 02, 1999 2:01 am

Re: Linkin' Linux

Post by snoopy »

note: I'd also update the encoding to use something more modern than xvid, like vp8.
Arch Linux x86-64, Openbox
"We'll just set a new course for that empty region over there, near that blackish, holeish thing. " Zapp Brannigan
Post Reply