LibMPV
git clone
the media-autobuild-suite https://github.com/m-ab-s/media-autobuild_suiteRun the bat script
media-autobuild_suite.bat
Press
2
to say no to all of the packages, except for ffmpeg. When ffmpeg comes around choose option4) shared
Let it finish building. It will take a good while.
Locate the file
mpv-2.dll
. It should be located inlocal64/bin-video
Locate the file
mpv.def
. It should be inC:/a/media-autobuild_suite/build/mpv-git/libmpv
or inC:/a/media-autobuild_suite/build/mpv-git/build
.Locate the folder
include/mpv
with the header files for mpv. It should be inlocal64
Create a new directory called
libmpv
. Inlibmpv
, create another directory calledlib
. Copy thedll
and thedef
there.In
libmpv
, create a new directory calledinclude
. Copy the header files there.Edit the
mpv.def
file. Add these two lines to the top of the file:LIBRARY MPV-2 EXPORTS
Open a command line window in the
lib
folder.Run
CALL "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
in the command line. If yourvcvarsall.bat
script is located somewhere else, change the file path.Run
lib /def:mpv.def /name:mpv-2.dll /out:mpv.lib /MACHINE:X64
Now you have created
mpv.lib
! Use the lib file, the include folder and the dll file to link with OpenSpace.Libmpv is dependent on another dll called
libopenh264
. To use libmpv with OpenSpace, locate the filelibopenh264.dll
and put it in the bin folder.