https://wiki.archlinux.org/api.php?action=feedcontributions&user=Darkimmortal&feedformat=atomArchWiki - User contributions [en]2024-03-29T14:19:56ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=GLC&diff=315218GLC2014-05-15T14:58:41Z<p>Darkimmortal: </p>
<hr />
<div>[[Category:Audio/Video]]<br />
GLC is an ALSA & OpenGL capture tool for Linux. It consists of a generic video capture, playback and processing library and a set of tools built around that library. GLC should be able to capture any application that uses ALSA for sound and OpenGL for drawing. It is similar to Fraps on Windows.<br />
<br />
==Installation==<br />
To install GLC, simply install the {{AUR|glc}} package from AUR.<br />
<br />
If you want to record 32 bit programs such as Wine on a 64 bit system, you will also need to install {{AUR|lib32-glc}}.<br />
<br />
NOTE: GLC will only work with ALSA. If you use Pulseaudio, install the [https://aur.archlinux.org/packages.php?O=0&K=glc-pulseaudio&do_Search=Pesquisar glc-pulseaudio*] packages instead. If you use OSS, you will probably need to record the audio separately.<br />
<br />
==Usage==<br />
The basic usage is simple. By default, GLC will save a (large) .glc file in the current directory. You can then play or encode it. Just run this:<br />
glc-capture [application]<br />
Press '''Shift + F8''' to start and stop recording. Otherwise you can use:<br />
glc-capture -s [application]<br />
To start recording immediately. For complete list of available options see:<br />
glc-capture --help<br />
<br />
If you want to record from two different audio devices, usually the application and the microphone, you need to use the '''-a''' option. For example:<br />
glc-capture -a 'hw:0,48000,1;hw:1,48000,1' [application]<br />
The '''-a''' format is ''device,rate,channels;device2...''; you probably want to mix the two audio streams togheter after, so to make it easier keep both sample rate at the same value.<br />
<br />
==Playback==<br />
To play a captured stream directly, execute<br />
glc-play [stream file]<br />
'''ESC''' stops playback, '''f''' toggles fullscreen and Right seeks forward.<br />
<br />
==Encoding==<br />
In order to use the videos outside of glc-play, you will need to encode it. Here are a few example that work well for encoding. Of course, you can be creative and use any of the formats supported by ffmpeg to get your desired result (mencoder works too, I'm just not familiar with it).<br />
<br />
For either script, run with the following context (assuming it's saved as glc-encode.sh):<br />
glc-encode.sh filename.glc<br />
<br />
'''H.264 Ultrafast + FLAC Audio''': (fairly quick encoding, high quality, good filesize)<br />
This script requires the following packages: ffmpeg<br />
#!/bin/bash<br />
glc-play $1 -a 1 -o glc.wav<br />
glc-play $1 -o - -y 1 | ffmpeg -i - -preset ultrafast -i glc.wav -acodec flac -vcodec libx264 output.mkv<br />
rm glc.wav<br />
It will output as output.mkv<br />
<br />
'''Lossless''' (usually quickest, no quality loss, ''huge'' files, need plenty of HD space):<br />
This script requires the following packages: ffmpeg<br />
#!/bin/bash<br />
glc-play $1 -a 1 -o glc.wav<br />
glc-play $1 -y 1 -o glc.yuv<br />
ffmpeg -i glc.wav -i glc.yuv -acodec copy -vcodec copy output.mkv<br />
rm glc.yuv<br />
rm glc.wav<br />
It will output as output.mkv<br />
<br />
'''WebM''':<br />
This script requires the following packages: vorbis-tools, ffmpeg, and mkvtoolnix<br />
#!/bin/bash<br />
glc-play $1 -a 1 -o - | oggenc - -b 128k -o glc.ogg<br />
glc-play $1 -o - -y 1 | ffmpeg -i - -vcodec libvpx glc.webm<br />
mkvmerge -o output.webm glc.webm glc.ogg<br />
rm glc.ogg<br />
rm glc.webm<br />
It will output as output.webm<br />
<br />
Note: Sometimes when recording WINE, the audio stream you want won't be #1, so you'll have to find out which one it is and experiment, and edit the encoding script accordingly. You can get some info on the streams using '''glc-play -i 1 filename.glc'''<br />
<br />
==Mixing audio streams==<br />
Using '''glc-play -i 1 filename.glc''' you get the list of audio tracks, extract them with the command from the previous section and you get '''.wav''' files with the audio tracks.<br />
<br />
Depending on how the application started the Alsa driver, it is possible there are silent tracks, so listen them and delete the unneeded ones. Once done you can mix using '''sox''' (from the package of the same name) using this command:<br />
sox -m -v 0.3 gamesound.wav -v 0.7 voice.wav finalaudio.wav<br />
The '''-m''' option asks the mix, instead '''-v''' options change the volume of the audio file, try to keep the sum of both to 1.<br />
<br />
Once you get a single '''.wav''' file with audio as you want, encode and mux normally.<br />
<br />
== Interfaces ==<br />
Two graphical interfaces are available for glc to try and simplify it's usage, with both of them being avalible from the [[AUR]].<br />
*{{AUR|soulcapture}} is a graphical front-end made in [[Gambas]] that utilizes [[FFmpeg]] for encoding.<br />
*{{AUR|gamecaster}} is a graphical front-end made in [[Python]] that utilizes [[FFmpeg]] for encoding; optimized for Ubuntu.<br />
<br />
==See also==<br />
*https://github.com/nullkey/glc - Homepage, and they have a good wiki there as well<br />
*https://github.com/darkimmortal/glc - An alternative version with support for 32-bit float audio (many Windows games via [[wine]] use this)</div>Darkimmortalhttps://wiki.archlinux.org/index.php?title=Firefox_Sync_Server&diff=210861Firefox Sync Server2012-06-21T17:53:41Z<p>Darkimmortal: typo fix</p>
<hr />
<div>[[Category:Networking]]<br />
[[Category:Daemons and system services]]<br />
This page is about special operations required in order to install Mozilla Sync Server.<br />
<br />
Newer versions of Mozilla Firefox feature bookmarks, passwords, settings and browsing history synchronization between all your computers and devices. Mozilla Foundation provides a public Sync server, but you can host your own one if you want.<br />
==Prerequisites==<br />
===Dependencies===<br />
Before proceeding, you need to [[pacman|install]] {{pkg|python2}}, {{pkg|python2-virtualenv}}, {{pkg|sqlite3}}, {{pkg|mercurial}} and {{pkg|make}}, all available in the [[official repositories]].<br />
===Accessibility===<br />
If you intend to use your server with itinerant clients, you should install it on an Internet reachable computer.<br />
===Administration Rights===<br />
All installation instructions are commands relying on the superuser privileges, so open a terminal and type:<br />
{{bc|<br />
$ su -<br />
Password: <br />
# <br />
}}<br />
<br />
==Installation==<br />
Mozilla Sync Server depends on Python 2 during installation. Arch Linux provides Python 3 as default Python version so there are special tweaks needed before running Mozilla Sync Server setup.<br />
Setup process creates an isolated Python environment in which all necessary dependencies are downloaded and installed. Afterwards, running the server only relies on the isolated Python environment, independently of the system-wide Python.<br />
===Python preparation===<br />
Mozilla Sync Server setup needs Python 2.6 or newer. In default configuration, {{ic|/usr/bin/python}} is a symbolic link to {{ic|/usr/bin/python3}} whereas Python 2 is {{ic|/usr/bin/python2}}.<br />
<br />
Before running setup, we must check the link and change it if necessary:<br />
{{bc|<br />
# cd /usr/bin<br />
# ls -l python<br />
<br />
lrwxrwxrwx 1 root root 7 5 sept. 07:04 python -> python3<br />
<br />
# ln -sf python2 python<br />
}}<br />
===Setup===<br />
Installation instructions:<br />
{{bc|<br />
# mkdir -p /opt/weave<br />
# cd /opt/weave<br />
# hg clone https://hg.mozilla.org/services/server-full<br />
<br />
... source repository cloning messages ...<br />
<br />
# cd server-full<br />
# make build<br />
<br />
... many build messages, including harmless warnings ...<br />
<br />
... end of the successful build messages:<br />
<br />
Building the app <br />
Checking the environ [ok]<br />
Updating the repo [ok]<br />
Building Services dependencies <br />
Getting server-core [ok]<br />
Getting server-reg [ok]<br />
Getting server-storage [ok] [ok]<br />
Building External dependencies [ok]<br />
Now building the app itself [ok]<br />
[done]<br />
<br />
}}<br />
<br />
Check the end of the build messages, they should state "[done]". Otherwise, look at the first error messages, they give you hints on the problem and how to solve it.<br />
<br />
===Python initial state restoration===<br />
{{bc|<br />
# cd /usr/bin<br />
# ln -sf python3 python<br />
}}<br />
<br />
==Configuration==<br />
===Server-side configuration files===<br />
Configuration files are used to define where databases and logs will be created.<br />
We will place databases in {{ic|/opt/weave/data}} and log files in {{ic|/var/log/weave}}, so we must create the directories.<br />
# mkdir /opt/weave/data /var/log/weave<br />
<br />
At least two configuration files must be changed in {{ic|/opt/weave/server-full}} in order to reflect these choices: {{ic|development.ini}} and {{ic|etc/sync.conf}}.<br />
<br />
In {{ic|development.ini}}, locate the line:<br />
{{bc|1=<br />
args = ('/tmp/sync-error.log',)<br />
}}<br />
and change it to:<br />
{{bc|1=<br />
args = ('/var/log/weave/sync-error.log',)<br />
}}<br />
<br />
In {{ic|etc/sync.conf}}, locate the line:<br />
{{bc|1=<br />
sqluri = sqlite:////tmp/test.db<br />
}}<br />
and change it to:<br />
{{bc|1=<br />
sqluri = sqlite:////opt/weave/data/sync.db<br />
}}<br />
This statement appears twice in the file, both should be modified.<br />
<br />
Bump the disk quota from 5 to 25 MB:<br />
{{bc|1=<br />
quota_size = 25600<br />
}}<br />
The fallback node URL must reflect the server's hostname (here {{ic|server-name.domain-name}}). <br />
Change:<br />
{{bc|1=<br />
fallback_node = <nowiki>http://localhost:5000/</nowiki><br />
}}<br />
to:<br />
{{bc|1=<br />
fallback_node = <nowiki>http://server-name.domain-name:5000/</nowiki><br />
}}<br />
<br />
===Unprivileged User===<br />
It is a good practice to run daemons as an unprivileged user. Create the group {{ic|weave}} and the user {{ic|sync}} for that purpose:<br />
{{bc|<br />
# groupadd weave<br />
# useradd -d /opt/weave -g weave -r -s /bin/bash sync<br />
}}<br />
This new user must have read and write access on every file in {{ic|/opt/weave}} and {{ic|/var/log/weave}}<br />
# chown -R sync:weave /opt/weave/*<br />
# chown -R sync:weave /var/log/weave<br />
<br />
===Automatic Startup of the Server===<br />
In order to make the Sync Server start automatically at boot-time, create a startup script:<br />
{{hc|<br />
/etc/rc.d/mozillaweave|<nowiki><br />
#!/bin/bash<br />
<br />
RUNDIR=/var/run/weave<br />
DAEMON=/opt/weave/bin/python<br />
PIDFILE=/var/run/weave.pid<br />
MESSAGELOG=/var/log/weave/sync-messages.log<br />
<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
PID=`pidof -x -o %PPID paster`<br />
case "$1" in<br />
start)<br />
stat_busy "Starting Mozilla Sync Server"<br />
[ -d $RUNDIR ] || mkdir $RUNDIR<br />
[ -z "$PID" ] && su sync -c "cd /opt/weave/server-full && bin/paster serve development.ini &>$MESSAGELOG &"<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
PID=`pidof -x -o %PPID paster`<br />
echo $PID >$PIDFILE<br />
add_daemon weave<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping Mozilla Sync Server"<br />
[ ! -z "$PID" ] && kill $PID &>/dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon weave<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}" <br />
esac<br />
exit 0<br />
</nowiki><br />
}}<br />
The script must have execution rights:<br />
# chmod 755 /etc/rc.d/mozillaweave<br />
Start the Sync Server at boot by including {{ic|mozillaweave}} in the [[Daemon]] list. It depends on the network so it should be placed accordingly.<br />
===Client-side configuration===<br />
Use the Sync Configuration Wizard in Firefox' Settings to create a new account on the server. Don't forget to choose "Custom server..." in the list, and input the server address: {{ic|<nowiki>http://server-name.domain-name:5000/</nowiki>}}<br />
<br />
The "Advanced Settings" button allows fine tuning of the synchronized elements list, and the definition of the client hostname.<br />
==See also==<br />
* [http://docs.services.mozilla.com/howtos/run-sync.html Mozilla Sync Server Howto]<br />
* [http://alien.slackbook.org/blog/setting-up-your-own-mozilla-sync-server/ Great tutorial, by Eric Hameleers]</div>Darkimmortal