Skip to content

Instantly share code, notes, and snippets.

@jonathondgebhardt
Forked from ePirat/VLCWinCompile.md
Last active March 16, 2025 01:37
Show Gist options
  • Save jonathondgebhardt/5c83f17898e823b899ebec95be4727b9 to your computer and use it in GitHub Desktop.
Save jonathondgebhardt/5c83f17898e823b899ebec95be4727b9 to your computer and use it in GitHub Desktop.
Building VLC for Windows using Docker

Compile for Windows (64bit)

Configure the Docker container

Pull the VideoLAN Docker container and run it in interactive mode with bash:

(The -v ~/docker:/root/shared maps /root/shared in the container to ~/docker on your machine to easily obtain the build results, so make sure ~/docker exists.)

docker pull registry.videolan.org:5000/vlc-debian-win64
docker run -v ~/docker:/root/shared -it registry.videolan.org:5000/vlc-debian-win64 /bin/bash

Docker for Windows

If you're using Docker in Windows, you should apt-get update and apt-get upgrade before attempting to clone the VLC repository. Additionally, you should edit /etc/apt/sources.list as necessary. By default, sources.list is pointing at French servers. For example, if you want to use servers in the United States: sed 's/fr/us/' /etc/apt/sources.list | tee /etc/apt/sources.list.

Clone the VLC git

cd && git clone https://github.com/videolan/vlc.git

Add the mingw tools to the PATH

PATH="/opt/gcc-x86_64-w64-mingw32/bin:$PATH"

Build tools

cd ~/vlc/extras/tools
./bootstrap && make

Add tools to PATH

PATH="$(pwd)/build/bin:$PATH"

Fetch prebuilt contribs

(To find prebuild contribs, check https://nightlies.videolan.org/build/win64/last-3/)

cd ~/vlc/contrib
wget CONTRIB_URL

Extract the contribs

tar xfjv CONTRIB_NAME.tar.bz2
cd x86_64-w64-mingw32

To make the prebuilt contribs usable, run the change_prefix script

../src/change_prefix.sh
cd ..

Build the lua compiler

mkdir contrib-extras && cd contrib-extras
../bootstrap
make .luac
cd ../bin && mv x86_64-linux-gnu-luac x86_64-w64-mingw32-luac

Build VLC

cd ~/vlc
./bootstrap
mkdir -p build && cd build
../extras/package/win32/configure.sh --disable-nls --host="x86_64-w64-mingw32"
make
make package-win32-exe

Build NSIS

This usually is not necessary, unless you know what you are doing, skip this!

cd && mkdir -p nsis && cd nsis
apt-get remove nsis nsis-common
apt-get update && apt-get install scons libz-dev
wget https://download.sourceforge.net/project/nsis/NSIS%203/3.02.1/nsis-3.02.1-src.tar.bz2
tar xfjv nsis-3.02.1-src.tar.bz2 && cd nsis-3.02.1-src
scons VER_MAJOR=3 VER_MINOR=2 SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA=no PREFIX=/usr/local/ install-compiler
cd ..
wget https://download.sourceforge.net/project/nsis/NSIS%203/3.02.1/nsis-3.02.1.zip
unzip nsis-3.02.1.zip
cp -R nsis-3.02.1 /usr/local/share/nsis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment