Archive for March, 2014

Compiling gstreamer from source

Thursday, March 13th, 2014

I have to compile gstreamer on different computers and thus wrote this little script to fetch the sources and compile them. Note that you need to install dependencies first. gstreamer will usually compile when they are not present, but will then not work properly.

You can download it here: gstreamer_build.sh

#!/bin/bash
 
# you might need these additonal packages:
# apt-get install  bison flex  libusb-1.0-0-dev libgudev-1.0-dev libxv-dev
 
# from http://lists.freedesktop.org/archives/gstreamer-openmax/2013-March/000724.html
# apt-get install build-essential autotools-dev automake autoconf libtool autopoint libxml2-dev zlib1g-dev libglib2.0-dev pkg-config bison flex python
# apt-get install libasound2-dev libgudev-1.0-dev libxt-dev libvorbis-dev libcdparanoia-dev libpango1.0-dev libtheora-dev libvisual-0.4-dev iso-codes libgtk-3-dev libraw1394-dev libiec61883-dev libavc1394-dev libv4l-dev libcairo2-dev libcaca-dev libspeex-dev libpng-dev libshout3-dev libjpeg-dev libaa1-dev libflac-dev libdv4-dev libtag1-dev libwavpack-dev libpulse-dev libsoup2.4-dev libbz2-dev libcdaudio-dev libdc1394-22-dev ladspa-sdk libass-dev libcurl4-gnutls-dev libdca-dev libdirac-dev libdvdnav-dev libexempi-dev libexif-dev libfaad-dev libgme-dev libgsm1-dev libiptcdata0-dev libkate-dev libmimic-dev libmms-dev libmodplug-dev libmpcdec-dev libofa0-dev libopus-dev librsvg2-dev librtmp-dev libschroedinger-dev libslv2-dev libsndfile1-dev libsoundtouch-dev libspandsp-dev libx11-dev libxvidcore-dev libzbar-dev libzvbi-dev liba52-0.7.4-dev libcdio-dev libdvdread-dev libmad0-dev libmp3lame-dev libmpeg2-4-dev libopencore-amrnb-dev libopencore-amrwb-dev libsidplay1-dev libtwolame-dev libx264-dev
# source: http://gstreamer.freedesktop.org/wiki/HowToCompileForEmbedded
#
# to build with libav support
# apt-get install libavutil-dev
# apt-get install yasm
#
# and for our stream.sh script:
# apt-get install  inotify-tools
#
# For reference: there is also an ppa, but it currently seems to only offer gstreamer 1.0, 
# which does not include uvch264src
# add-apt-repository ppa:gstreamer-developers/ppa
# apt-get update
# apt-get install gstreamer1.0*
 
 
 
SOURCE=$HOME/gstreamer_sources
BUILD=$HOME/gstreamer_build
if [ ! -d "$SOURCE" ]; then
	mkdir $SOURCE
fi
if [ ! -d "$BUILD" ]; then
	mkdir $BUILD
fi
 
cd $SOURCE
wget http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-1.2.0.tar.xz
tar -xJf gstreamer-1.2.0.tar.xz
wget http://gstreamer.freedesktop.org/src/orc/orc-0.4.18.tar.gz
tar -xzf orc-0.4.18.tar.gz
wget http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-1.2.0.tar.xz
tar -xJf gst-plugins-base-1.2.0.tar.xz
wget http://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-1.2.0.tar.xz
tar -xJf gst-plugins-good-1.2.0.tar.xz
wget http://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-1.2.0.tar.xz
tar -xJf gst-plugins-ugly-1.2.0.tar.xz
wget http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-1.2.0.tar.xz
tar -xJf gst-plugins-bad-1.2.0.tar.xz
wget http://gstreamer.freedesktop.org/src/gst-libav/gst-libav-1.2.0.tar.xz
tar -xJf gst-libav-1.2.0.tar.xz
 
cd gstreamer-1.2.0
./configure --prefix=$BUILD
make -j2
make install
 
cd ../orc-0.4.18
./configure --prefix=$BUILD 
make -j2
make install
 
cd ../gst-plugins-base-1.2.0
export PKG_CONFIG_PATH=$BUILD/lib/pkgconfig:$PKG_CONFIG_PATH; ./configure --prefix=$BUILD  --enable-orc --with-x 
make -j2
make install 
 
cd ../gst-plugins-good-1.2.0
export PKG_CONFIG_PATH=$BUILD/lib/pkgconfig:$PKG_CONFIG_PATH; ./configure  --prefix=$BUILD  --enable-orc --with-libv4l2 --with-x
make -j2
make install 
 
cd ../gst-plugins-ugly-1.2.0
export PKG_CONFIG_PATH=$BUILD/lib/pkgconfig:$PKG_CONFIG_PATH; ./configure  --prefix=$BUILD  --enable-orc 
make -j2
make install
 
cd ../gst-plugins-bad-1.2.0
export PKG_CONFIG_PATH=$BUILD/lib/pkgconfig:$PKG_CONFIG_PATH; ./configure  --prefix=$BUILD  --enable-orc
make -j2
make install
 
cd ../gst-libav-1.2.0
export PKG_CONFIG_PATH=$BUILD/lib/pkgconfig:$PKG_CONFIG_PATH; ./configure  --prefix=$BUILD  --enable-orc
make -j2
make install
 
 
echo
echo "GStreamer 1.2.0 installed sucessfully!"
echo
 
# to completly remove gstreamer, simpely delete the two directories:
# rm -rf $SOURCE
# rm -rf $BUILD
 
# to use this version of gstreamer, add it to your PATH:
# echo -e "\n\n#Path for a local version of gstreamer\nPATH=\"$BUILD/bin:\$PATH\"" >> $HOME/.profile

Quick overview over nearby wireless lan hotspots

Thursday, March 6th, 2014

Here is a useful little command to get a quick overview over nearby hotspots:

 iw dev wlan0 scan  | grep 'SSID\|signal\|primary channel'
        SSID: 5g_station
                 * primary channel: 36
        signal: -42.00 dBm
        SSID: 2g_station
                 * primary channel: 6
        signal: -72.00 dBm

vimrc for latex

Wednesday, March 5th, 2014

Ah yes – finally – blog post time again :)

Since I am currently writing a lot of latex with vim I thought I backup share my ~/.gvimrc on my blog:

1
2
3
4
5
6
7
8
9
:setlocal spell spelllang=en_us " enable spell checking (Ctrl x + s for suggestions)
:set wrap			" wrap too long lines
:set guioptions-=m 		" disable menu bar
:set guioptions-=T		" disable toolbar
:set spellfile=/path/to/spellfile-en.utf-8.add
:set colorcolumn=80		" show a red bar in column 80
:set textwidth=80		" automatically break after column 80
:set encoding=utf-8  		" The encoding displayed.
:set fileencoding=utf-8  	" The encoding written to file. Use file -bi  <file> to verify