You can build VLC with only certain Deinterlace methods if you don't want the rest.
It really seems compile-it-yourself is the only way to get things done. Since this reply, I've found a couple of other messages about what is essentially the same problem:
viewtopic.php?f=14&t=55181&p=202365
http://trac.videolan.org/vlc/ticket/2451
I've been putting this off, since although VLC is one of my favourite video players, I don't like to compile my own version of if any more than I want to compile my own version of OpenOffice: It takes time to set things up, more time to figure out what needs to be changed, even more time to compile, recompilation when there's a version update and ultimately the benefits are small. In other words, a fix perfectly suited for the regular codebase maintainers. However, since nothing has happened and I'm tired of wading through multiple sub-menus every other time I play something, it seems there's no other choice.
As expected, setting up a compile environment for a complex project like this always has issues. If users are expected to do this kind of thing in a regular basis, there should be clear, up-to-date, step-by-step instructions for setting up the environment. As it is, the instructions have too many choices that require background knowledge and too many vague spots.
I've documented the process here, in case someone needs to do the same.
----------------------------------------------------
Issues encountered are marked in
red.
The goaI was to cross-compile for Windows using Ubuntu 9.10 x86. The installation used was updated from 9.04 (due to the mingw32-runtime >= 3.15 requirement for FFmpeg) and had a few extra packages installed, but hopefully the following will work as-is for a clean install as well.
The guide
http://wiki.videolan.org/Win32Compile was used as a basis.
After installing Ubuntu, first we need the build tools:
sudo apt-get install mingw32 mingw32-binutils
Here are
the rest of the packages I eventually found are needed, so one might as well install them now:
sudo apt-get install autoconf libtool libgcrypt11-dev
sudo apt-get install gettext cvs tofrodos
Next we download the source from
http://www.videolan.org/vlc/download-sources.html :
vlc-1.0.5.tar.bz2
Then we check which version of MinGW is installed:
i586-mingw32msvc-gcc --ver
In my case, this returned "gcc version 4.2.1-sjlj (mingw32-2)". From
http://people.videolan.org/~jb/Contribs/ we now choose and download a file that matches that one:
contrib-20091208-win32-bin-gcc-4.2.1-sjlj-runtime-3.15.2-only.tar.bz2
We need to make a new directory for the project. Since we're cross compiling we might as well be put everything under one directory (in this case, under 'home') so as not to affect the rest of the system.
sudo mkdir /home/vlc
sudo chown $(whoami):$(whoami) /home/vlc
First we extract the pre-built libraries. These are contained under directory path 'usr/win32/' and we strip the unnecessary 'usr'-part:
tar jxf contrib-20091208-win32-bin-gcc-4.2.1-sjlj-runtime-3.15.2-only.tar.bz2 -C /home/vlc --strip 1
Here we set the base directory location to where we extracted the files and modify some paths accordingly. Modification only needs to be done once, but exported variables are only valid per shell session, i.e. only in the same tab until it's closed. Btw,
the 'export' keyword was missing from the script in the original guide, which caused some head-scratching later on:
export CONTRIBS=/home/vlc/win32
for file in $CONTRIBS/bin/*-config $CONTRIBS/lib/*.la ; do perl -i.bak -p -e 's|/usr/win32|$ENV{"CONTRIBS"}|g' $file ; done
Afterwards, I found the replacement was incomplete and by doing a search (grep /usr/win32 * -R -l | less)
the rest of the files that need to be modified were found:
for file in $CONTRIBS/bin/autopoint $CONTRIBS/bin/gettextize $CONTRIBS/lib/pkgconfig/*.pc ; do perl -i.bak -p -e 's|/usr/win32|$ENV{"CONTRIBS"}|g' $file ; done
Now we extract the source, contained under directory path 'vlc-1.0.5/' which will be stripped:
tar jxf vlc-1.0.5.tar.bz2 -C $CONTRIBS --strip 1
After this we get into the source directory:
cd $CONTRIBS
First we run bootstrap and set the variables:
./bootstrap
export PKG_CONFIG_LIBDIR=$CONTRIBS/lib/pkgconfig PKG_CONFIG_PATH=$CONTRIBS/lib/pkgconfig \
CPPFLAGS="-I$CONTRIBS/include -I$CONTRIBS/include/ebml" CXXCPP=i586-mingw32msvc-cpp \
LDFLAGS=-L$CONTRIBS/lib CC=i586-mingw32msvc-gcc CXX=i586-mingw32msvc-g++
Next, the source is configured. This is basically the example configuration, except for things that caused warnings. Those were
removed and
Fluidsynth was disabled, since it didn't compile:
./configure --host=i586-mingw32msvc --build=i386-linux \
--enable-nls --enable-sdl --with-sdl-config-path=$CONTRIBS/bin \
--enable-faad --enable-flac --enable-theora \
--with-libgcrypt-prefix=$CONTRIBS \
--enable-live555 --with-live555-tree=$CONTRIBS/live.com \
--enable-caca \
--with-dvdnav-config-path=$CONTRIBS/bin \
--disable-cddax --disable-vcdx --enable-goom \
--enable-twolame --enable-dvdread \
--enable-debug --disable-fluidsynth
Now we can finally compile and be fairly confident of success:
make
make package-win32-zip && rm -R symbols-1.0.5
After a while the compiled package vlc-1.0.5-win32.zip is ready.
When compiling for the second time,
you might run into an error "qplatformdefs.h not found", described here:
viewtopic.php?f=32&t=70101 . In that case you have to download
ftp://ftp.videolan.org/pub/videolan/con ... in.tar.bz2 . Now run these two commands when the error occurs:
rm -R $CONTRIBS/include/qt4
tar jxf qt4-4.6.0-win32-bin.tar.bz2 --strip 1 -C $CONTRIBS --wildcards qt4-4.6.0-win32-bin/include/qt4/*
and continue with 'make'.
If you need to start over, you can simply remove the created directories:
rm -R /home/vlc/win32
----------------------------------------------------
After all of this, there's still the issue of fixing the original problems. Using flags like "--disable-telx" or "--disable-zvbi" didn't do anything, so after a few attempts I ended up modifying one of the source files:
perl -i.bak -p -e 's|PMTSetupEsTeletext\( p|\/\/ PMTSetupEsTeletext\( p|g' $CONTRIBS/modules/demux/ts.c
This disables the pesky teletext subtitle support once and for all.
I haven't really gotten around looking into the second problem, since there doesn't seem to be any obvious way to select the deinterlacing modes to compile. This problem actually contains a bug as well, after all the deinterlace hotkey doesn't really cycle the deinterlace modes like it did in the old version, just alternates between 'Discard' and 'Disable'.