Compiling VLC from Source on Fedora 29

Abdullah Alansari
4 min readOct 1, 2019

I’m working on fixing an issue with VLC (as of now v3.0.8 and v4.0.0-dev) where some HTTP live-streams playback has a consistent delay of 1minute+. You can easily reproduce this in any platform by opening any YouTube live-stream with a wall-clock time (e.g: vlc <youtuble-live-stream-url-of-a-news-channel>).

The first step to work on VLC is to compile it from source on my dev-environment and I’m writing this post because following all the relevant VLC official docs (I read almost all the dev docs) wasn’t enough to compile it on the Qubes OS Fedora 29 domain/VM I set up for VLC. This is of course to be expected because no project can provide up-to-date instructions for all imaginable dev-environments. However, there are some tools that make it much easier to compile non-trivial projects in many platforms (especially Linux) but they are beyond the scope of this post and deserve their own post if not a series of posts:sweat_smile:.

Before reading on, keep in mind that this is more of a journal entry for me and it’s possible that the official VLC docs are sufficient. In particular, I suspect that only passing the disable--* flags to ./configure may just work. But when I encountered the compilation errors first, I started to install as many optional VLC deps (using make | grep -i warning if you’re wondering).

So let’s start by installing the required packages:

# Enable RPM Fusion repos, assuming they exist in the initial
# fedora-29 setup. Which is the case for the Qubes OS fedora-29
# Template VM.
sudo dnf config-manager --set-enabled rpmfusion-free
sudo dnf config-manager --set-enabled rpmfusion-free-updates
sudo dnf config-manager --set-enabled rpmfusion-nonfree
sudo dnf config-manager --set-enabled rpmfusion-nonfree-updates
# Install VLC as a baseline for the upstream version.
sudo dnf install -y vlc
# Install VLC dev-dependencies. These are only needed for
# development because they're statically-linked to VLC
# (as opposed to dynamically-linked).
sudo dnf install -y git libtool pkgconfig flex bison lua-devel ffmpeg-devel schroedinger qt5-devel qt5-qtquickcontrols2-devel dbus-devel systemd-devel libarchive-devel libdc1394-devel libavc1394-devel zvbi-devel libbluray-devel opencv-devel libsmbclient-devel libssh2-devel libnfs-devel freerdp-devel libsidplayfp-devel libmpg123-devel gstreamer-devel libva-devel libaom-devel libdav1d-devel speexdsp-devel opus-devel libogg-devel x265-devel libmfx-devel fluidsynth-devel libkate-devel libxkbcommon-x11-devel xcb-util-keysyms-devel wayland-protocols-devel librsvg2-devel libvmmalloc-devel soxr-devel libchromaprint-devel protobuf-lite-devel libsrtp-devel libprojectM-devel libmtp-devel libmicrodns-devel libsecret-devel libnotify-devel medialibrary-devel
sudo dnf install -y a52dec a52dec-devel caca-utils expat expat-devel faac faac-devel faad2 faad2-devel ffmpeg ffmpeg-libs flac flac-devel fribidi-devel gettext gnutls gnutls-devel gnutls-utils lame lame-devel live555 live555-devel libass libass-devel libcaca libcaca-devel libcddb libcddb-devel libcdio libcdio-devel libdap libdap-devel libdca-devel libdvbpsi libdvbpsi-devel libdvdnav libdvdnav-devel libdvdread libebml libebml-devel freetype freetype-devel fribidi libgcrypt libgcrypt-devel libgpg-error libgpg-error-devel libjpeg-turbo libmad libmad-devel libmatroska libmatroska-devel libmodplug libmodplug-devel libmpcdec-devel libmpeg2-devel libogg-devel liboil-devel libpng libpng-devel libshout libshout-devel libtheora-devel libtiff libupnp libupnp-devel libvorbis-devel libX11 libX11-devel libxcb libxcb-devel libxml2 libxml2-devel mpeg2dec portaudio-devel qt4 qt4-devel schroedinger-devel SDL-devel SDL_image SDL_image-devel speex speex-devel taglib-devel twolame twolame-devel vcdimager vcdimager-devel vcdimager-libs x264 x264-devel yasm zlib lua xcb-util-devel libsamplerate-devel

Now we need to get the latest code:

# The latest revision was
# `c83a81794c3f974953356b97a8473a61872647dc` as
# of this writing and you can use it as a frame-of-reference
# or if you want things to be as close as possible to this post.
git clone git://git.videolan.org/vlc.git

We can now start getting into the main compilation steps:yum_face::

# This is the first step to make sure everything is set-up
# and produce the `configure` executable.
./bootstrap
# To do even more checking and preparing for the compilation.
# The additional `--disable-*` flags are passed because some
# optional parts of VLC didn't seem to compile. And for
# obvious reasons if you look into the compilation
# errors and the offending code:sweat_smile:.
# This happened with me on the
# `c83a81794c3f974953356b97a8473a61872647dc` revision
# but may be fixed in the future.
./configure --disable-mpc --disable-medialibrary --disable-opencv
# This is it! The actual compilation step. Not really but
# the closest thing if such a thing exists. In case you haven't
# noticed already, the actual compilation is the easiest and
# all the set-up and preparation is the hardest part. Which can
# sometimes include compiling other stuff:sweat_smile:.
make

Now we have a working VLC executable and can run it just using ./vlc in the same directory:smiley:. Note that you can use sudo make install but I personally prefer to keep the original VLC as a baseline and it’s easier to just ./vlc when you’re making changes to the code. More like make && ./vlc whenever you want to test your latest changes.

Finally you can go to the VLC Developers Corner (the main reference for this post) for more details on compiling VLC on many platforms and much more. And if for any reason you didn’t manage to compile VLC, just know that compiling from source can be tricky business. VLC still is one of the easier ones though and why this is the case is its own post too:sweat_smile:.

--

--