# Download msys2 from https://www.msys2.org/ and open ucrt64 terminal
TARGET=$(pwd)/rust-ffmpeg1
REPO=https://github.com/zmwangx/rust-ffmpeg
FFMPEG_NAME=ffmpeg-n6.1-latest-win64-gpl-shared-6.1
FFMPEG_SRC_PREFIX=latest
FFMPEG_SRC=https://github.com/BtbN/FFmpeg-Builds/releases/download/$FFMPEG_SRC_PREFIX/$FFMPEG_NAME.zip
git clone $REPO $TARGET
if [ ! -d $TARGET/$FFMPEG_NAME ]; then
wget -q --show-progress $FFMPEG_SRC -O $TARGET/$FFMPEG_NAME.zip
unzip $TARGET/$FFMPEG_NAME.zip -d $TARGET
rm $TARGET/$FFMPEG_NAME.zip
fi
export FFMPEG_DIR="$TARGET/$FFMPEG_NAME"
# rename .dll.a to .a so it will link it
for file in $FFMPEG_DIR/lib/*.dll.a; do mv "$file" "${file%.dll.a}.a"; done
echo "\$FFMPEG_DIR is $FFMPEG_DIR"
cd $TARGET
rustup override set stable-x86_64-pc-windows-gnu # very important!!
cargo build --release --example transcode-audio
$TARGET/target/release/examples/transcode-audio.exe
ldd $TARGET/target/release/examples/transcode-audio.exe # check dependenciesCARGO_FEATURE_STATIC=yes cargo build --release -vv 2>&1 | grep "avutil"