MPVDemo-macOS
This is a Xamarin macOS Project to example how to Use MPV to play video.
You should find all the reference links from github.com/kevinzhow/MPVDemo-macOS since I can not post Links.
Basic flow
- Finding MPV dylibs
- Using DllImport to bind dylibs
- Play video
Finding MPV Dylibs
The most easiest way is grabbing it from my project and all these libs were modified from
IINA project.
IINA's original dylibs were using @rpath
to solve the Search Path which will cause System.DllNotFoundException
.
You can fix it by install_name_tool
Quick Example:
otool -L libavfilter.6.dylib
install_name_tool -change @rpath/libavutil.55.dylib @loader_path/libavutil.55.dylib libavfilter.6.dylib
DllImport
DllImport is C# way to do dlopen.
You can find the instruction from Xamarin Website.
Quick Example:
c# [DllImport("libmpv.1.25.0.dylib", EntryPoint = "mpv_create")] private static extern IntPtr MpvCreate();