metadata icon indicating copy to clipboard operation
metadata copied to clipboard

Building on Windows

Open zmwangx opened this issue 7 years ago • 3 comments

pkg-config is probably not the way to go on Windows...

zmwangx avatar Oct 28 '18 08:10 zmwangx

1 install choco: open powershell as administrator:

Set-ExecutionPolicy AllSigned Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

2 install pkg-config by choco: > choco install pkgconfiglite

openersoft avatar Jul 20 '23 09:07 openersoft

Thanks for the precision @openersoft but I struggled a little bit more before I got it to work, so let me add to it if you don't mind.

Please note that I already had both ffmpeg and pkgconfiglite installed with chocolatey at the time I ran into the following issues.

First I kept having the following build error:

error: failed to run custom build command for `ffmpeg-sys-next v6.0.1`
Caused by:
  process didn't exit successfully: `C:\Development\audioware\target\debug\build\ffmpeg-sys-next-b4e1b6120c1ca853\build-script-build` (exit code: 101)
  --- stdout
  Could not find ffmpeg with vcpkg: Could not find Vcpkg tree: No vcpkg installation found. Set the VCPKG_ROOT environment variable or run 'vcpkg integrate install'
  ...

After searching about vcpkg I realized it's an alternative package manager for C++.

NB: I say alternative because chocolatey is also just another package manager.

Well I got it installed by following this gist. Also was very surprised when I realized from the logs that it basically reinstalls everything on my machine (powershell, python, ffmpeg, and a load more), and it also rebuilds ffmpeg from scratch both for release and debug (and it takes a while, so please be patient).

But once it's done, it basically just works ™️. Hope this helps :)

Roms1383 avatar Aug 10 '23 06:08 Roms1383

@zmwangx / @openersoft Is there a way to specify to metadata (with an env var or something) where ffmpeg is installed on the host machine ? Or even better in my own case, to vendor ffmpeg directly in the binary ? (because I'm not sure the users will actually have it installed on their machine).

If not, how much effort is required to retrieve an audio file _duration using simply the std lib ? (if it's even possible, sorry I don't know how it works at all under the hood yet)

Roms1383 avatar Aug 15 '23 06:08 Roms1383