Dec 21, 2008

HOWTO: compiling VLC + live555 + all major codecs on Ubuntu

[Updated on 2009/04/03] VLC 0.9.9 is out. Here is the updated tutorial.

In yesterday's post, I showed you how to build a pretty complete ffmpeg.

Today, let's build the latest VLC from source on Ubuntu 8.04.

VLC is the best audio / video player there is, but just like ffmpeg, the binary found in Linux distributions is often outdated and incomplete... and we all know that it's quite frustrating to get stuck with files that you can't play.

For starters, you have to go through yesterday's post:
  1. we need the build directories of ffmpeg and x264 for the VLC build,
  2. up to date versions are required anyway,
  3. building and installing them will take care of a number of dependencies.
Once you've done that, there are additional dependencies to take care of.

1) Installing libmad

MAD is a high-quality MPEG audio decoder. At the time of this writing, the latest version is 0.15.1b. Let's get the source, build it and install it:

ubuntu% wget
ubuntu% tar xvfz libmad-0.15.1b.tar.gz
ubuntu% cd libmad-0.15.1b
ubuntu% ./configure --prefix=/usr/local
ubuntu% make
ubuntu% sudo make install

[Updated on 2009/01/04] If you try to compile libmad with gcc 4.3, you will get the following error: cc1: error: unrecognized command line option "-fforce-mem". To correct this, just remove the -fforce-mem flags from the CFLAGS list in the Makefile.

2) Installing libdca

libdca is a free library for DTS audio. At the time of this writing, the latest version is 0.0.5. Let's get the source, build it and install it:

ubuntu% wget
ubuntu% bzip2 -d
ubuntu% tar xvf libdca-0.0.5.tar
ubuntu% cd libdca-0.0.5
ubuntu% ./configure --prefix=/usr/local
ubuntu% make
ubuntu% sudo make install

3) Installing libmpeg2

libmpeg2 is a free library for MPEG streams. At the time of this writing, the latest version is Let's get the source, build it and install it:

ubuntu% wget
ubuntu% tar xvfz libmpeg2-0.5.1.tar.gz
ubuntu% cd
ubuntu% ./configure --prefix=/usr/local
ubuntu% make
ubuntu% sudo make install

4) Installing TagLib

TagLib is is a library for reading and editing the meta-data of several popular audio formats (MP3, FLAC, etc). At the time of this writing, the latest version is 1.5. Let's get the source, build it and install it:

ubuntu% wget
ubuntu% tar xvfz taglib-1.5.tar.gz
ubuntu% ./configure --prefix=/usr/local
ubuntu% make
ubuntu% sudo make install

5) Installing live555

live555 is a set of libraries for multimedia streaming (RTP/RTCP, RTSP, SIP).

ubuntu% wget
ubuntu% tar xvfz live555-latest.tar.gz
ubuntu% cd live
ubuntu% ./genMakefiles linux
ubuntu% make

There is no installation procedure for live555. You have to copy the full directory somewhere safe, like /usr/lib.

ubuntu% sudo cp -r live /usr/lib

6) Installing everything else

Now, let's use APT to fetch all the remaining libraries needed by VLC, as well as the Qt4 packages required by the GUI:

ubuntu% sudo apt-get install libavc1394-dev libraw1394-dev libdc1394-dev libdvdread-dev libdvdnav-dev libdvdcss2-dev libfaad-dev libtwolame-dev liba52-dev libvcdinfo-dev libiso9660-dev libcddb2-dev libflac-dev libschroedinger-dev liba52-dev libogg-dev libvorbis-dev liblua5.1-0-dev libgnomevfs2-dev libtag1-dev libqt4-dev

That should really be it...

7) Fetching VLC

Stable sources can be downloaded as a tarball from the VLC download page. At the time of this writing, the latest version is VLC 0.9.8a. If you want to try development snapshots, be my guest but YMMV!

ubuntu% wget
ubuntu% bzip2 -d vlc-0.9.8a.tar.bz2
ubuntu% tar xvf vlc-0.9.8a.tar

8) Adding ffmpeg, x264 and live555 to the mix

For the sake of convenience, let's copy the three build directories into the VLC tree:

ubuntu% cd vlc-0.9.8a
ubuntu% cp -r $YOUR_FFMPEG_BUILD_DIR extras
ubuntu% cp -r $YOUR_X264_BUILD_DIR extras
ubuntu% cp -r $YOUR_LIVE555_BUILD_DIR extras
ubuntu% ls extras
analyser buildsystem contrib ffmpeg live misc package x264

9) Building VLC

Let's go! Don't forget to check your configure output for possible errors.

[Updated on 2009/02/23: added support for XVID & FLV formats through ffmpeg]

./configure --prefix=/usr/local --with-ffmpeg-tree=extras/ffmpeg --with-x264-tree=extras/x264 --with-live555-tree=extras/live --enable-release --enable-switcher --enable-shout --enable-dc1394 --enable-dv --enable-dvdread --enable-v4l --enable-pvr --enable-gnomevfs --enable-vcdx --enable-faad --enable-twolame --enable-real --enable-realrtsp --enable-flac --enable-tremor --enable-tarkin --enable-theora --enable-ogg --enable-vorbis --enable-a52 --enable-gnomevfs --enable-dca --with-ffmpeg-flv --with-ffmpeg-xvid
UNIX-related output removed
checking for SHOUT... no
configure: WARNING: libshout library not found
checking for LUA... yes
checking proxy.h usability... no
checking proxy.h presence... no
checking for proxy.h... no
checking for NOTIFY... no
checking for TAGLIB... yes
checking for liveMedia/libliveMedia.a in extras/live... /home/julien/tmp/vlc-0.9.8a/extras/live/liveMedia/libliveMedia.a
checking /home/julien/tmp/vlc-0.9.8a/extras/live/liveMedia/include/liveMedia_version.hh usability... yes
checking /home/julien/tmp/vlc-0.9.8a/extras/live/liveMedia/include/liveMedia_version.hh presence... yes
checking for /home/julien/tmp/vlc-0.9.8a/extras/live/liveMedia/include/liveMedia_version.hh... yes
checking for liveMedia version >= 1214895600 ... yes
checking libraw1394/raw1394.h usability... yes
checking libraw1394/raw1394.h presence... yes
checking for libraw1394/raw1394.h... yes
checking for raw1394_get_nodecount in -lraw1394... yes
checking libdc1394/dc1394_control.h usability... yes
checking libdc1394/dc1394_control.h presence... yes
checking for libdc1394/dc1394_control.h... yes
checking for libraw1394/raw1394.h... (cached) yes
checking libavc1394/avc1394.h usability... yes
checking libavc1394/avc1394.h presence... yes
checking for libavc1394/avc1394.h... yes
checking dvdread/dvd_reader.h usability... yes
checking dvdread/dvd_reader.h presence... yes
checking for dvdread/dvd_reader.h... yes
checking for dvdnav-config... /usr/local/bin/dvdnav-config
checking libsmbclient.h usability... no
checking libsmbclient.h presence... no
checking for libsmbclient.h... no
checking for struct _SMBCCTX.close_fn... no
checking for dvbpsi/dr.h... yes
checking for dvbpsi_GenSDTSections in -ldvbpsi... yes
checking linux/videodev.h usability... yes
checking linux/videodev.h presence... yes
checking for linux/videodev.h... yes
checking alsa/asoundlib.h usability... yes
checking alsa/asoundlib.h presence... yes
checking for alsa/asoundlib.h... yes
checking for main in -lasound... yes
checking linux/videodev2.h usability... yes
checking linux/videodev2.h presence... yes
checking for linux/videodev2.h... yes
checking for LIBV4L2... no
configure: WARNING: LibV4L2 support disabled because libv4l2 development headers were not found
checking for new linux/videodev2.h... yes
checking for GNOMEVFS... yes
checking for LIBCDIO... yes
checking for VCDINFO... yes
checking for LIBCDIO... yes
checking for cdrom_msf0 in linux/cdrom.h... yes
checking for scsireq in sys/scsiio.h... no
checking for ioc_toc_header in sys/cdio.h... no
checking for LIBCDDB... yes
checking linux/dvb/version.h usability... yes
checking linux/dvb/version.h presence... yes
checking for linux/dvb/version.h... yes
checking linux/dvb/frontend.h usability... yes
checking linux/dvb/frontend.h presence... yes
checking for linux/dvb/frontend.h... yes
checking X11/Xlib.h usability... yes
checking X11/Xlib.h presence... yes
checking for X11/Xlib.h... yes
checking for inet_pton... yes
checking for inet_ntop... yes
checking ogg/ogg.h usability... yes
checking ogg/ogg.h presence... yes
checking for ogg/ogg.h... yes
checking for oggpack_read in -logg... yes
checking ebml/EbmlVersion.h usability... no
checking ebml/EbmlVersion.h presence... no
checking for ebml/EbmlVersion.h... no
checking libmodplug/modplug.h usability... no
checking libmodplug/modplug.h presence... no
checking for libmodplug/modplug.h... no
checking mpcdec/mpcdec.h usability... no
checking mpcdec/mpcdec.h presence... no
checking for mpcdec/mpcdec.h... no
configure: WARNING: only static linking is available, you must provide a gme-tree
checking mad.h usability... yes
checking mad.h presence... yes
checking for mad.h... yes
checking for mad_bit_init in -lmad... yes
checking id3tag.h usability... no
checking id3tag.h presence... no
checking for id3tag.h... no
configure: WARNING: --with-ffmpeg-tree is deprecated. Use PKG_CONFIG_PATH instead.
checking for AVCODEC... yes
checking libavcodec/avcodec.h usability... yes
checking libavcodec/avcodec.h presence... yes
checking for libavcodec/avcodec.h... yes
checking ffmpeg/avcodec.h usability... no
checking ffmpeg/avcodec.h presence... no
checking for ffmpeg/avcodec.h... no
checking libavutil/avutil.h usability... yes
checking libavutil/avutil.h presence... yes
checking for libavutil/avutil.h... yes
checking ffmpeg/avutil.h usability... no
checking ffmpeg/avutil.h presence... no
checking for ffmpeg/avutil.h... no
checking for AVFORMAT... yes
checking libavformat/avformat.h usability... yes
checking libavformat/avformat.h presence... yes
checking for libavformat/avformat.h... yes
checking ffmpeg/avformat.h usability... no
checking ffmpeg/avformat.h presence... no
checking for ffmpeg/avformat.h... no
checking for libavutil/avutil.h... (cached) yes
checking for ffmpeg/avutil.h... (cached) no
checking for SWSCALE... yes
checking libswscale/swscale.h usability... yes
checking libswscale/swscale.h presence... yes
checking for libswscale/swscale.h... yes
checking ffmpeg/swscale.h usability... no
checking ffmpeg/swscale.h presence... no
checking for ffmpeg/swscale.h... no
checking for POSTPROC... yes
checking libpostproc/postproc.h usability... no
checking libpostproc/postproc.h presence... no
checking for libpostproc/postproc.h... no
checking postproc/postprocess.h usability... no
checking postproc/postprocess.h presence... no
checking for postproc/postprocess.h... no
checking faad.h usability... yes
checking faad.h presence... yes
checking for faad.h... yes
checking for faacDecOpen in -lfaad... no
checking for NeAACDecOpen in -lfaad... yes
checking twolame.h usability... yes
checking twolame.h presence... yes
checking for twolame.h... yes
checking for twolame_init in -ltwolame... yes
checking for zlib.h... (cached) yes
checking sysfs/libsysfs.h usability... no
checking sysfs/libsysfs.h presence... no
checking for sysfs/libsysfs.h... no
checking libtar.h usability... no
checking libtar.h presence... no
checking for libtar.h... no
checking a52dec/a52.h usability... yes
checking a52dec/a52.h presence... yes
checking for a52dec/a52.h... yes
checking for a52_free in -la52... yes
checking for DCA... yes
checking FLAC/stream_decoder.h usability... yes
checking FLAC/stream_decoder.h presence... yes
checking for FLAC/stream_decoder.h... yes
checking for LIBMPEG2... yes
checking vorbis/codec.h usability... yes
checking vorbis/codec.h presence... yes
checking for vorbis/codec.h... yes
checking vorbis/vorbisenc.h usability... yes
checking vorbis/vorbisenc.h presence... yes
checking for vorbis/vorbisenc.h... yes
checking tremor/ivorbiscodec.h usability... no
checking tremor/ivorbiscodec.h presence... no
checking for tremor/ivorbiscodec.h... no
checking speex/speex.h usability... yes
checking speex/speex.h presence... yes
checking for speex/speex.h... yes
checking for speex_decode_int in -lspeex... yes
checking theora/theora.h usability... yes
checking theora/theora.h presence... yes
checking for theora/theora.h... yes
checking for theora_granule_time in -ltheora... yes
checking for SCHROEDINGER... yes
checking png.h usability... yes
checking png.h presence... yes
checking for png.h... yes
checking for png_set_rows in -lpng... yes
checking for x264.h in /home/julien/tmp/vlc-0.9.8a/extras/x264... yes
checking for X264... yes
checking for FLUIDSYNTH... no
checking for ZVBI... no
configure: WARNING: ZVBI library not found. Enabling the telx module instead
checking for KATE... no
checking kate/kate.h usability... no
checking kate/kate.h presence... no
checking for kate/kate.h... no
checking for X11/extensions/dpms.h... yes
checking for DPMSInfo in X11/extensions/dpms.h... yes
checking for X11/Xlib.h... (cached) yes
checking for XShmAttach in -lXext... yes
checking X11/extensions/Xv.h usability... yes
checking X11/extensions/Xv.h presence... yes
checking for X11/extensions/Xv.h... yes
checking for XvPutImage in -lXv... yes
checking for X11/Xlib.h... (cached) yes
checking GL/glu.h usability... yes
checking GL/glu.h presence... yes
checking for GL/glu.h... yes
checking GL/glx.h usability... yes
checking GL/glx.h presence... yes
checking for GL/glx.h... yes
checking X11/extensions/Xinerama.h usability... yes
checking X11/extensions/Xinerama.h presence... yes
checking for X11/extensions/Xinerama.h... yes
checking for XineramaQueryExtension in -lXinerama_pic... no
checking for XineramaQueryExtension in -lXinerama... yes
checking for X11/extensions/xf86vmode.h... no
checking GL/gl.h usability... yes
checking GL/gl.h presence... yes
checking for GL/gl.h... yes
checking for GL/glu.h... (cached) yes
checking for sdl12-config... no
checking for sdl11-config... no
checking for sdl-config... /usr/bin/sdl-config
checking SDL/SDL.h usability... yes
checking SDL/SDL.h presence... yes
checking for SDL/SDL.h... yes
checking SDL/SDL_image.h usability... no
checking SDL/SDL_image.h presence... no
checking for SDL/SDL_image.h... no
checking SDL_image.h usability... no
checking SDL_image.h presence... no
checking for SDL_image.h... no
configure: WARNING: The development package for SDL_image is not installed.
You should install it alongside your SDL package.
checking for FREETYPE... yes
checking fontconfig/fontconfig.h usability... yes
checking fontconfig/fontconfig.h presence... yes
checking for fontconfig/fontconfig.h... yes
checking Carbon/Carbon.h usability... no
checking Carbon/Carbon.h presence... no
checking for Carbon/Carbon.h... no
checking for FRIBIDI... yes
checking for xml2-config... /usr/bin/xml2-config
checking for xmlTextReaderConstName in -lxml2... yes
checking cascade/graphics/CascadeScreen.h usability... no
checking cascade/graphics/CascadeScreen.h presence... no
checking for cascade/graphics/CascadeScreen.h... no
configure: WARNING: Not building Roku HD1000 compatible video output
checking cascade/graphics/CascadeBitmap.h usability... no
checking cascade/graphics/CascadeBitmap.h presence... no
checking for cascade/graphics/CascadeBitmap.h... no
configure: WARNING: Not building Roku HD1000 compatible video output
checking linux/fb.h usability... yes
checking linux/fb.h presence... yes
checking for linux/fb.h... yes
checking soundcard.h usability... no
checking soundcard.h presence... no
checking for soundcard.h... no
checking sys/soundcard.h usability... yes
checking sys/soundcard.h presence... yes
checking for sys/soundcard.h... yes
checking for main in -lossaudio... no
checking machine/soundcard.h usability... no
checking machine/soundcard.h presence... no
checking for machine/soundcard.h... no
checking for PULSE... no
configure: WARNING: pulseaudio library not found
checking for alsa/asoundlib.h... (cached) yes
checking for main in -lasound... (cached) yes
checking deschutes/libraries/hdmachinex225/PCMAudioPlayer.h usability... no
checking deschutes/libraries/hdmachinex225/PCMAudioPlayer.h presence... no
checking for deschutes/libraries/hdmachinex225/PCMAudioPlayer.h... no
checking for UpnpInit in -lupnp... no
checking for QT4... yes
checking for moc-qt4... /usr/bin/moc-qt4
checking for rcc... /usr/bin/rcc
checking for uic-qt4... /usr/bin/uic-qt4
checking Ph.h usability... no
checking Ph.h presence... no
checking for Ph.h... no
checking for BONJOUR... yes
checking for BONJOUR... yes
checking for libgcrypt-config... /usr/bin/libgcrypt-config
checking for LIBGCRYPT - version >= 1.1.94... yes (1.4.1)
checking LIBGCRYPT API version... okay
checking for GNUTLS... yes
checking whether byte ordering is bigendian... no
checking for osso_display_blanking_pause in -losso... no
checking for XSPSetPixelDoubling in -lXsp... no
configure: creating ./
configure: creating ./config.status
config.status: creating extras/package/win32/vlc.win32.nsi
config.status: creating extras/package/macosx/Info.plist
config.status: creating extras/package/macosx/Resources/English.lproj/InfoPlist.strings
config.status: creating extras/package/macosx/plugin/Info.plist
config.status: creating extras/package/macosx/plugin/InstallerInfo.plist
config.status: creating extras/package/macosx/plugin/English.lproj/InfoPlist.strings
config.status: creating Makefile
config.status: creating projects/activex/Makefile
config.status: creating projects/activex/axvlc.inf
config.status: creating doc/Makefile
config.status: creating extras/package/ipkg/Makefile
config.status: creating libs/loader/Makefile
config.status: creating libs/srtp/Makefile
config.status: creating modules/Makefile
config.status: creating projects/mozilla/Makefile
config.status: creating m4/Makefile
config.status: creating po/
config.status: creating projects/activex/axvlc_rc.rc
config.status: creating projects/mozilla/npvlc_rc.rc
config.status: creating share/Makefile
config.status: creating share/vlc_win32_rc.rc
config.status: creating share/libvlc_win32_rc.rc
config.status: creating src/Makefile
config.status: creating src/test/Makefile
config.status: creating bin/Makefile
config.status: creating test/Makefile
config.status: creating modules/access/Makefile
config.status: creating modules/access/bda/Makefile
config.status: creating modules/access/dshow/Makefile
config.status: creating modules/access/dvb/Makefile
config.status: creating modules/access/mms/Makefile
config.status: creating modules/access/cdda/Makefile
config.status: creating modules/access/rtsp/Makefile
config.status: creating modules/access/rtmp/Makefile
config.status: creating modules/access/v4l2/Makefile
config.status: creating modules/access/vcd/Makefile
config.status: creating modules/access/vcdx/Makefile
config.status: creating modules/access/screen/Makefile
config.status: creating modules/access_filter/Makefile
config.status: creating modules/access_output/Makefile
config.status: creating modules/audio_filter/Makefile
config.status: creating modules/audio_filter/channel_mixer/Makefile
config.status: creating modules/audio_filter/converter/Makefile
config.status: creating modules/audio_filter/resampler/Makefile
config.status: creating modules/audio_filter/spatializer/Makefile
config.status: creating modules/audio_mixer/Makefile
config.status: creating modules/audio_output/Makefile
config.status: creating modules/codec/Makefile
config.status: creating modules/codec/avcodec/Makefile
config.status: creating modules/codec/cmml/Makefile
config.status: creating modules/codec/dmo/Makefile
config.status: creating modules/codec/subtitles/Makefile
config.status: creating modules/codec/spudec/Makefile
config.status: creating modules/codec/xvmc/Makefile
config.status: creating modules/control/Makefile
config.status: creating modules/control/http/Makefile
config.status: creating modules/demux/Makefile
config.status: creating modules/demux/asf/Makefile
config.status: creating modules/demux/avformat/Makefile
config.status: creating modules/demux/avi/Makefile
config.status: creating modules/demux/mp4/Makefile
config.status: creating modules/demux/mpeg/Makefile
config.status: creating modules/demux/playlist/Makefile
config.status: creating modules/gui/Makefile
config.status: creating modules/gui/beos/Makefile
config.status: creating modules/gui/pda/Makefile
config.status: creating modules/gui/macosx/Makefile
config.status: creating modules/gui/minimal_macosx/Makefile
config.status: creating modules/gui/qnx/Makefile
config.status: creating modules/gui/qt4/Makefile
config.status: creating modules/gui/skins2/Makefile
config.status: creating modules/gui/wince/Makefile
config.status: creating modules/meta_engine/Makefile
config.status: creating modules/misc/Makefile
config.status: creating modules/misc/dummy/Makefile
config.status: creating modules/misc/lua/Makefile
config.status: creating modules/misc/memcpy/Makefile
config.status: creating modules/misc/notify/Makefile
config.status: creating modules/misc/testsuite/Makefile
config.status: creating modules/misc/playlist/Makefile
config.status: creating modules/misc/osd/Makefile
config.status: creating modules/misc/stats/Makefile
config.status: creating modules/misc/xml/Makefile
config.status: creating modules/misc/probe/Makefile
config.status: creating modules/mux/Makefile
config.status: creating modules/mux/mpeg/Makefile
config.status: creating modules/packetizer/Makefile
config.status: creating modules/services_discovery/Makefile
config.status: creating modules/stream_out/Makefile
config.status: creating modules/stream_out/transrate/Makefile
config.status: creating modules/video_chroma/Makefile
config.status: creating modules/video_filter/Makefile
config.status: creating modules/video_filter/atmo/Makefile
config.status: creating modules/video_filter/dynamicoverlay/Makefile
config.status: creating modules/video_output/Makefile
config.status: creating modules/video_output/msw/Makefile
config.status: creating modules/video_output/qte/Makefile
config.status: creating modules/video_output/x11/Makefile
config.status: creating modules/visualization/Makefile
config.status: creating modules/visualization/visual/Makefile
config.status: creating modules/visualization/galaktos/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing po-directories commands
config.status: creating po/POTFILES
config.status: creating po/Makefile
config.status: creating vlc-config
Enabled modules: a52 a52tofloat32 a52tospdif access_dv access_filter_bandwidth access_filter_dump access_filter_record access_filter_timeshift access_gnomevfs access_mmap access_realrtsp adjust adpcm alphamask alsa aout_file aout_sdl araw asf atmo audio_format audioscrobbler avcodec avformat avi bandlimited_resampler blend blendbench bluescreen bonjour canvas cc cdda cdg chain cinepak clone cmml colorthres converter_fixed converter_float crop croppadd cvdsub dbus dc1394 deinterlace dolby_surround_decoder dts dtstofloat32 dtstospdif dummy dvb dvb dvbsub dvdnav dvdread dynamicoverlay equalizer erase export extract faad fake fb flac float32_mixer folder freetype gaussianblur gestures glx gnutls gradient grain grey_yuv h264 hal headphone_channel_mixer hotkeys http i420_rgb i420_rgb_mmx i420_rgb_sse2 i420_ymga i420_ymga_mmx i420_yuy2 i420_yuy2_mmx i420_yuy2_sse2 i422_i420 i422_yuy2 i422_yuy2_mmx i422_yuy2_sse2 image inhibit invert libmpeg2 linear_resampler live555 logger logo lpcm m4a m4v magnify marq memcpy memcpy3dn memcpymmx memcpymmxext mono mosaic motion motionblur motiondetect mp4 mpeg_audio mpga mpgatofixed32 mpgv mux_ogg mux_ts noise normvol nsc ogg opengl opengl osd_parser osdmenu oss panoramix param_eq playlist png podcast postproc probe_hal ps psychedelic puzzle pvr qt4 rawvideo rc realaudio realvideo remoteosd ripple rotate rss rv32 sap scale scaletempo schroedinger screen screensaver sharpen shout showintf signals simple_channel_mixer skins2 spatializer spdif_mixer speex spudec stats subsdec subsusf svcdsub swscale t140 taglib telepathy telnet telx theora transform trivial_channel_mixer trivial_mixer trivial_resampler ts twolame ugly_resampler v4l v4l2 vcd vcdx visual vmem vorbis vout_sdl wall wave x11 x264 xml xtag xvideo yuy2_i420 yuy2_i422

libvlc configuration
version : 0.9.8a
system : linux
architecture : i686 mmx sse sse2
build flavour : release
vlc aliases : cvlc rvlc svlc qvlc
plugins/bindings :

You can tune the compiler flags in vlc-config.
To build vlc and its plugins, type `./compile' or `make'.

All right, let's run make and get some coffee while VLC is building:

ubuntu% make
lots of output removed
make[2]: Leaving directory `/home/julien/tmp/vlc-0.9.8a'
make[1]: Leaving directory `/home/julien/tmp/vlc-0.9.8a'

We're done! Let's check our new VLC before we install it.

7) Checking VLC

ubuntu% ./vlc --version
VLC media player 0.9.8a Grishenko
[00000001] main libvlc debug: VLC media player - version 0.9.8a Grishenko - (c) 1996-2008 the VideoLAN team
[00000001] main libvlc debug: libvlc was configured with ./configure '--prefix=/usr/local' '--with-ffmpeg-tree=extras/ffmpeg' '--with-x264-tree=extras/x264' '--with-live555-tree=extras/live' '--enable-release' '--enable-switcher' '--enable-shout' '-enable-dc1394' '--enable-dv' '--enable-dvdread' '--enable-v4l' '--enable-pvr' '--enable-gnomevfs' '--enable-vcdx' '--enable-faad' '--enable-twolame' '--enable-real' '--enable-realrtsp' '--enable-flac' '--enable-tremor' '--enable-tarkin' '--enable-theora'
'--enable-ogg' '--enable-vorbis' '--enable-a52' '--enable-gnomevfs' '--with-ffmpeg-flv' '--with-ffmpeg-xvid'
[00000001] main libvlc debug: translation test: code is "C"
VLC version 0.9.8a Grishenko
Compiled by julien@ubuntu.
Compiler: gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute it under the terms of the GNU General Public License;
see the file named COPYING for details.
Written by the VideoLAN team; see the AUTHORS file.

Looks good. You can verify that your favorite codecs are supported with 'vlc --list', e.g.:

ubuntu% ./vlc --list|grep -i h264
output removed
h264 H264 video demuxer
packetizer_h264 H.264 video packetizer
h264 H264 video demuxer
packetizer_h264 H.264 video packetizer

Let's also run a quick transcoding test:

ubuntu% ./cvlc file:// --sout="#transcode{vcodec=h264,vb=1024,acodec=mpga,ab=128}:std{access=file,mux=mp4,dst=clip.mp4}" vlc://quit
VLC media player 0.9.8a Grishenko
output removed
x264 [info]: using SAR=53889/54000
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
x264 [info]: profile Main, level 5.1
x264 [info]: slice I:141 Avg QP:20.66 size: 14629
x264 [info]: slice P:4027 Avg QP:24.82 size: 8194
x264 [info]: mb I I16..4: 46.2% 0.0% 53.8%
x264 [info]: mb P I16..4: 19.5% 0.0% 23.0% P16..4: 18.3% 11.5% 2.4% 0.0% 0.0% skip:25.4%
x264 [info]: kb/s:1009.4
[00000499] dummy demux: command `quit'
ubuntu% ls -l clip*
-rw-r--r-- 1 julien julien 91322704 2008-12-25 22:08
-rw-r--r-- 1 julien julien 39719104 2008-12-25 22:17 clip.mp4

And since VLC can play that new mp4 clip, I declare this a good build :) Let's install it:

ubuntu% sudo make install

We're done. Now you can enjoy all your media files with a single player!


  1. If you try to compile libmad with gcc 4.3 you will get the following error:

    cc1: error: unrecognized command line option "-fforce-mem"

    To correct this, just open up Makefile and remove -fforce-mem from the CFLAGS list.

  2. @Dave: right. I'll update the entry. Cheers!

  3. JS:
    Would the flag for dc1394 create some issues as written? It's the only option that is -enable-dc1394 instead of --enable-dc1394. I'm having problems transcoding and receiving a dc1394 error...

  4. @Igloo: right. Just fixed the typo. Cheers!

  5. I got the following error after running make during vlc installation:

    /home/travis/vlc-0.9.8a/extras/live/UsageEnvironment/libUsageEnvironment.a: could not read symbols: Bad value

    The line above it makes reference to compiling live555 with fpic so that's what I did. It is a similar issue when installing nut (ffmpeg tutorial). I think they both have to do with x86_64 arch. Add

    CFLAGS += -fPIC

    to the Makefile for live555.

    So it will look like:

    CFLAGS += -fPIC

    It is write protected so chmod 644 Makefile, then chmod 444 Makefile when you are done. Recompile, copy to /usr/lib (or wherever you put it) AND copy it to the extras directory in the vlc source directory. Make sure you remove the old live directories in each location first. I did a make distclean in vlc source and ran the ./configure command again. make worked fine this time. Might be obvious to some but it tripped me up for about 30 minutes.

    Awesome how-tos by the way.

  6. Excellent instructions, thanks!

    Can you add AMR codec to the mix as well? has some instructions.

  7. @Arie: ok, I'll check it out. I did include AMR in the ffmpeg how-to, though ;)

    @Travis: thanks for the additional info. And I'm glad this is useful to you :)


  8. Hi,

    Thanks very much for posting these HOWTOs. I breezed through them. However I keep getting problems when I try playing and streaming video. It says that it can't find the encoder "ffmpeg", which seemed strange, because we've gone to the hassle of compiling it from scratch.

    Looking back through the configure output, it says that --with-ffmpeg-tree is deprecated, and to use PACKAGE_CONFIG_PATH instead. Its not obvious how, and I tried the obvious to no avail.

    Also - I noticed on your page, there's a typo in the configure command: --with-ffmpeg-tree=extras/ffmeg

    I'm guessing you meant =extras/ffmpeg, so are you sure it configured correctly for you?

    If you could attached your configure output, that might be very handy.

    And thanks again. Very helpful. :)

  9. Whoops, I mean PKG_CONFIG_PATH.

    I tried adding PKG_CONFIG_PATH=extras/ffmpeg

    but this didnt help.

  10. @Quenten: I fixed the typo and included the configure output in the post.

    Regarding PKG_CONFIG, try this :

    cat config.log | grep "No package"

    and that will tell you what packages you need to download. Make sure they are the development ones (i.e. libxyz-dev, not libxyz)

  11. @Arie: as it turns out, this VLC build can play AMR :) I took a very quick look at the VLC source and did not find any reference to AMR, so maybe this works because the underlying ffmpeg build does have AMR support...

  12. I just updated the post and added support for libdca (decoding of DTS audio).

  13. Hi,

    I'm trying to understand why I get the error in vlc that it cant find the decoder "ffmpeg". Its certainly installed. Can I ask why we need to reference the ffmpeg build tree when we compile vlc? In your configure output, like mine, it says that --with-ffmpeg-tree is deprecated, so I guess it isnt using the ffmpeg directory you added to extras.

    However, your compile output says that it finds the ffmpeg/avcodec, ffmpeg/avutil (though not ffmpeg/avformat or ffmpeg/swscale). Does that mean that your configure is getting to them some other way?

    Something I tried was to make my own ffmpeg directory in /usr/local/include. In it, I put the contents of /usr/local/libavcodec, usr/local/libavformat, etc.

    This made configure give me yesses, but when I compiled later, I still got the same error: cannot find encoder "ffmpeg"...

    Can you shed any light on this? I'd really like to get this working, but its been very frustrating.

    BTW I'm using Debian... Does that make a big difference?


  14. Good news,

    I've finally got my vlc to work properly. I am a relative linux newbie, but I hope these comments might help other newbies.

    For me, there were a few extra prerequisites. My friend had just installed a new debian system, so I used it as a guinea pig and it was good to see what needed to be added to get vlc to work. Also, some of these things might be more applicable to the ffmpeg compile. Sorry if they're in the wrong place.

    First, g++ wasn't installed by default on my friends box, and we needed that. There was also libgsm-dev, fribidi-dev, and quite importantly for MPEG, libdvbpsi-dev. I had the option of installing versions 3,4,5 and chose libdvbpsi5-dev. This worked for me.

    The problems from my previous post comes from the fact that I was using more than one console and my export of LD_LIBRARY_PATH was not set in all of them. I added

    export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

    to my ~/.bashrc file. This sets it for all bash sessions. Vlc needed it set to find all the codec libraries (configure liked it set too). While compiling, I also set PKG_CONFIG_PATH:

    export PKG_CONFIG_PATH=/usr/local/lib:/usr/lib:$PKG_CONFIG_PATH

    That can go in the ~/.bashrc too.

    One last thing was that configure would not work with --enable-dc1394, unless I used version 13. I had the option of using 13, 20 or 22. But the versions after libdc1394-13-dev seem to name their header files differently so only 13 actually had dc1394_control.h in /usr/include/libdc1394. The others just called it control.h, so compile failed.

    I may have done some of these things badly... If so, can someone please correct me? It is working for me though.

  15. Hey Quenten,

    all right, you did good :) With a different distribution, some libraries could be missing from the default install, but as you found out, it's usually not too difficult to fix that.


  16. Hi,

    Thanks for your amazing how-tos, I followed them to build the vlc-0.9.8a. However, I failed at the step 9 (Building VLC). When I try to "make" it, it gives me the error:

    x264.c: In function ‘Open’:
    x264.c:962: error: ‘x264_param_t’ has no member named ‘b_pre_scenecut’
    x264.c:1127: error: ‘struct anonymous’ has no member named ‘i_direct_8x8_inference’
    make[5]: *** [libx264_plugin_la-x264.lo] Error 1
    make[5]: Leaving directory `/home/ims06/vlc-0.9.8a/modules/codec'
    make[4]: *** [all-recursive] Error 1
    make[4]: Leaving directory `/home/ims06/vlc-0.9.8a/modules/codec'
    make[3]: *** [all] Error 2
    make[3]: Leaving directory `/home/ims06/vlc-0.9.8a/modules/codec'
    make[2]: *** [all-recursive] Error 1
    make[2]: Leaving directory `/home/ims06/vlc-0.9.8a/modules'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/ims06/vlc-0.9.8a'
    make: *** [all] Error 2

    Do you have any idea on it? Thanks.

  17. @christy : thats why you are using a newly release of the x264.

    Get a old snapshot like this.


    and do the same steps, you should now not receive that error.

  18. @maurixio: thanks! I successfully "make" the vlc by using the source you provided. Thanks.

  19. @Travis I could not successfully resolve my -fPIC error using your method. (adding it to CFLAGS += variable under the C_FLAGS variable.

    I also tried appending it to the C_FLAGS variable without luck. vlc also failed in make.

    However, I did add it to the C_OPTIONS and was able to successfully build vlc with this method.

  20. Could you please upload a .deb package?

  21. hi julien,

    I have just installed opensolarisx86.In that i got Rhythmbox music player, with this i am not able to play mp3 audio.And with the Totem movie player i am not able to play video files. Can you give me a link using which i can configure my system to play most of the audio and video files. Is there any other media player that i can install which can play most of the audio and video files on my opensolaris.

    I have little knowledge of unix environment operating systems.

    Please tell me the process...

  22. Hi got error debian bug site on compile removed libavutil (+ all it required synaptic) then went back to your compile and all worked well brilliant.

  23. sorry installed libavuti thus removing other on the dependancy (synaptic)then back to your ./configure blahhhhh ect stuff sorry but its happy now.

  24. more info i'm on ubuntu 904 great post used it with 804 also thanks brilliant lets you understand the workings. xxx then as i say back to your ./configure
    BRILLIANT .......

  25. Hi I followed your step to install live555, but I failed. My system is Ubuntu Hardy. When I issue teh command make it says CC: command not found and also
    [rtcp_from_spec.o] error 127

    What shall I modify.

    Thank you

  26. I guess you'd better skip building from source and installing via Korn's PPA: