Friday, August 29, 2008

Compiling VLC in 64 Bit Ubuntu 8.04.1

If you haven't compiled VLC recently then you may be caught off guard by a couple changes made. The --with-ffmpeg-tree is now deprecated because ffmpeg started using the pkg-config system. Also the version of live555 in the Ubuntu repositories is currently too old - you will have to compile that yourself as well.

Hopefully, since you are trying to compile something, you are tech savvy enough to understand a shell script just about as well as my ramblings, so I'll just paste that:


#!/bin/bash

#get dependencies
sudo apt-get install cvs build-essential subversion git git-core automake1.9 libtool libgcrypt-dev libfaad-dev libtwolame-dev libqt4-dev libjack-dev libfaac-dev liblame-dev libxpm-dev libcddb2-dev liblua5.1-0-dev libzvbi-dev libshout-dev wget

#get the latest live555
wget http://www.live555.com/liveMedia/public/live555-latest.tar.gz
tar -xzvf live555-latest.tar.gz live
cd live
#modify config.linux to add -fPIC to the first line (for 64bit only)
mv config.linux config.linux.orig
echo `head -1 config.linux.orig` -fPIC > config.linux
tail -16 config.linux.orig >> config.linux
./genMakefiles linux
make -j 8

#get vlc
cd ~
git clone git://git.videolan.org/vlc.git
cd vlc/
./bootstrap

#git x264
cd ~/vlc/extras/
git clone git://git.videolan.org/x264.git
cd x264
./configure --enable-pic --disable-asm
make -j 8
sudo make install

#ffmpeg (need amr?)
cd ~/vlc/extras/
svn co svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-postproc --enable-pthreads --enable-libmp3lame --enable-libfaac --enable-swscale --disable-static --enable-shared
make -j 8
sudo make install

# this is for that pkg-config system ffmpeg now uses
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"

#build
cd ~/vlc
mkdir build
cd build


#originally I had this configured for no gui - you may need to play with it.
#watch for warnings - it will still compile with missing functionality if you are missing needed libraries
../configure --prefix=/usr \
--enable-snapshot --enable-debug \
--enable-dbus --enable-dbus-control --disable-musicbrainz \
--enable-shared-libvlc --disable-mozilla \
--enable-lirc \
--enable-x264 --with-x264-tree=../extras/x264 \
--enable-shout --disable-taglib \
--enable-v4l \
--enable-dvb \
--enable-realrtsp --enable-real --disable-xvmc \
--enable-svg --enable-dvdread \
--enable-dc1394 --enable-dv \
--enable-theora --enable-faad \
--enable-twolame --enable-real \
--enable-flac --enable-tremor \
--enable-skins2 --enable-qt4 --enable-x11 --enable-xvideo\
--enable-ncurses \
--enable-aa --enable-caca \
--enable-esd --disable-portaudio \
--enable-jack --disable-xosd \
--enable-galaktos --enable-goom \
--enable-ggi \
--disable-cddax --disable-vcdx \
--disable-qte --disable-quicktime --disable-lua \
--with-live555-tree=~/live \
--enable-libmpeg2 --enable-mkv \
--enable-ogg --enable-vorbis --enable-release --disable-hd1000v > config.out

make -j 8



Note that I use make -j 8 rather than just make because I am compiling with multiple cores (in this case it was 6 - it is usually good to start a couple more threads than the number of cores you have).

I had to add "--disable-static --enable-shared" to the ffmpeg or else it wouldn't compile - I think it had to do with some 64 bit PIC problems.

Notice the --disable-asm in the x264 config. This is BAD. The latest version of yasm in the Ubuntu repositories is not new enough for x264. This will be fixed in the next release of Ubuntu, but if I get around to it I will post an update before then.

Security

Most people, tech and non-tech alike, have some very basic, easily correctable, user created security holes. Here are the most common I run in to:


1. If you use Firefox to store your passwords and don't set a master password then anyone who uses your computer can view your password in clear text with about 5 clicks - or about three seconds. Either don't use Firefox to store your passwords or set a master password. Be aware that other browsers have similar security issues when storing passwords.

2. Do not use the same password for everything. If someone manages to hack, crack, steal, or find out your password any way then they will have access to all of your accounts that use that password. Anyone who runs a website has access to the password you use at their website; do you trust them? Also many sites do not use encryption while authenticating you, thus your password is sent in clear text over the internet for anyone to see.

3. Check to see if a website is using encryption, especially for authentication. (You can check by looking at the url, which should start with https://, and there is usually a padlock in the bottom right corner of your browser.) Gmail by default only uses encryption to authenticate you; all of your email is sent unencrypted - this includes any passwords that are emailed to you by other websites. Last month they (finally) added a setting to always use encryption, but it isn't enabled by default... If a website does not use encryption for authentication then be very, very, sure to use a different password for that website.

4. Your email is a security hole for all the accounts tied to it. Be careful to not leave your email logged on anywhere other people have access to it. If you use email on a mobile phone/device then be sure to that it is protected with a pin or password. (*cough* iPhone *cough*)

5. Anyone with physical access to your computer can access all of your files in the time it takes to reboot the PC, regardless of whether you have it password protected. It is ill-advised to store passwords in a text file on your computer. There are plenty of programs that allow you to store passwords in an encrypted format (including Firefox, if you set a master password). If you have a lot of sensitive data then you may want to look in to full disk encryption, such as LUKS (Linux only...).

Darwin Streaming Server 6.0.3 on Linux

Quick tutorial for installing DSS on Ubuntu 8.04.1 64bit (x86_64).

Most of these details can be found here: http://dss.macosforge.org/trac/ticket/6

Hopefully they will integrate these patches in to the next release, but until then here are the build instructions for Ubuntu:

Download DSS 6.0.3: http://static.macosforge.org/dss/downloads/DarwinStreamingSrvr6.0.3-Source.tar

Download this patch: http://dss.macosforge.org/trac/raw-attachment/ticket/6/dss-6.0.3.patch (Thank you Sverker Abrahamsson!)

And this patch: http://dss.macosforge.org/trac/raw-attachment/ticket/6/dss-hh-20080728-1.patch

Finally get the modified Install script: http://dss.macosforge.org/trac/raw-attachment/ticket/6/Install

The basic process is:

1. Get the build dependencies from the repositories.
2. Set up the qtss user (this is because the Install script does it in a way that is incompatible with Ubuntu)
3. Extract the source code.
4. Apply both patches.
5. Replace the Install script and chmod +x it.
6. Compile.
7. Install.

Notably for ssl admin you need the openssl and libnet-ssleay-perl packages, unfortunately even with these packages I was unable to get ssl admin to work.

I created the modified Install script; you can do a diff with the original if you want to see what I changed. Mostly just the paths were broken, but I am guessing that some other modules and such will probably not work.

Here is the bash script I used to do everything (including automatically download everything):


#!/bin/bash

sudo apt-get install build-essential wget
sudo addgroup --system qtss
sudo adduser --system --no-create-home --ingroup qtss qtss

wget http://static.macosforge.org/dss/downloads/DarwinStreamingSrvr6.0.3-Source.tar
tar -xvf DarwinStreamingSrvr6.0.3-Source.tar
mv DarwinStreamingSrvr6.0.3-Source DarwinStreamingSrvr6.0.3-Source.orig
wget http://dss.macosforge.org/trac/raw-attachment/ticket/6/dss-6.0.3.patch
patch -p0 < dss-6.0.3.patch
mv DarwinStreamingSrvr6.0.3-Source.orig DarwinStreamingSrvr6.0.3-Source
wget http://dss.macosforge.org/trac/raw-attachment/ticket/6/dss-hh-20080728-1.patch
patch -p0 < dss-hh-20080728-1.patch
#need to answer n then y
cd DarwinStreamingSrvr6.0.3-Source
mv Install Install.orig
wget http://dss.macosforge.org/trac/raw-attachment/ticket/6/Install
chmod +x Install
./Buildit
sudo ./Install



Update 2/2/2009: I changed the links to all point to dss.macosforge.org, which is a much more reliable host. Everyone should also take a look at that thread, as there are a lot of updates, including a newer patch from Horace Hsieh. I haven't played with this in a while, but if I get a chance I will try to update this with the newer patch. Please let me know if there are any problems (I just turned comment notifications on :/).