Skip to content

Commit

Permalink
WIP.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed Feb 9, 2024
1 parent da6152b commit 50b19cb
Showing 1 changed file with 55 additions and 51 deletions.
106 changes: 55 additions & 51 deletions bin/compile_ffmpeg_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ fi
#
MSYS_LIBS=1


if [[ $MSYS_LIBS == 1 ]]; then
pacman -Sy --noconfirm

# pacman -Sy meson --noconfirm # @bug: broken

pacman -Sy make wget diffutils yasm nasm pkg-config --noconfirm
fi


has_meson=0
if type -P meson &> /dev/null; then
has_meson=1
Expand All @@ -69,6 +79,24 @@ has_cmake=0
if type -P cmake &> /dev/null; then
has_cmake=1
fi

echo
echo "Installing packages needed to build:"
echo
echo "libvpx"
if [[ $has_meson == 1 ]]; then
echo "libdav1d"
fi
if [[ $has_cmake == 1 ]]; then
echo "libSvtAV1"
fi
if [[ $FFMPEG_GPL == GPL ]]; then
echo "libx264"
fi
echo "FFmpeg"
echo




#
Expand Down Expand Up @@ -111,29 +139,6 @@ BUILD_FFMPEG=1



if [[ $MSYS_LIBS == 1 ]]; then
pacman -Sy --noconfirm

echo
echo "Installing packages needed to build:"
echo
echo "libvpx"
if [[ $has_meson == 1 ]]; then
echo "libdav1d"
fi
if [[ $has_cmake == 1 ]]; then
echo "libSvtAV1"
fi
if [[ $FFMPEG_GPL == GPL ]]; then
echo "libx264"
fi
echo "FFmpeg"
echo

pacman -Sy make wget diffutils yasm nasm pkg-config --noconfirm

fi

mkdir -p $ROOT_DIR

cd $ROOT_DIR
Expand All @@ -148,6 +153,33 @@ mkdir -p build
#############


#
# Build libdav1d decoder
#
ENABLE_LIBDAV1D=""
if [[ $BUILD_LIBDAV1D == 1 ]]; then

cd $ROOT_DIR/sources

if [[ ! -d dav1d ]]; then
git clone --depth 1 https://code.videolan.org/videolan/dav1d.git --branch ${DAV1D_TAG} 2> /dev/null
fi

if [[ ! -e $INSTALL_DIR/lib/dav1d.lib ]]; then
echo
echo "Compiling libdav1d......"
echo
cd dav1d
export CC=cl.exe
meson setup -Denable_tools=false -Denable_tests=false --default-library=static -Dlibdir=$INSTALL_DIR/lib --prefix=$INSTALL_DIR build
cd build
ninja -j ${CPU_CORES}
ninja install
run_cmd mv $INSTALL_DIR/lib/libdav1d.a $INSTALL_DIR/lib/dav1d.lib
fi

ENABLE_LIBDAV1D="--enable-libdav1d"
fi

#
# Build libSvt-AV1 encoder
Expand Down Expand Up @@ -216,34 +248,6 @@ EOF
ENABLE_LIBSVTAV1="--enable-libsvtav1"
fi

#
# Build libdav1d decoder
#
ENABLE_LIBDAV1D=""
if [[ $BUILD_LIBDAV1D == 1 ]]; then

cd $ROOT_DIR/sources

if [[ ! -d dav1d ]]; then
git clone --depth 1 https://code.videolan.org/videolan/dav1d.git --branch ${DAV1D_TAG} 2> /dev/null
fi

if [[ ! -e $INSTALL_DIR/lib/dav1d.lib ]]; then
echo
echo "Compiling libdav1d......"
echo
cd dav1d
meson setup -Denable_tools=false -Denable_tests=false --default-library=static -Dlibdir=$INSTALL_DIR/lib --prefix=$INSTALL_DIR build
cd build
ninja -j ${CPU_CORES}
ninja install
run_cmd mv $INSTALL_DIR/lib/libdav1d.a $INSTALL_DIR/lib/dav1d.lib
fi

ENABLE_LIBDAV1D="--enable-libdav1d"
fi



#
# Build x264
Expand Down

0 comments on commit 50b19cb

Please sign in to comment.