mpvnet-player / mpv.net

🎞 mpv.net is a media player for Windows with a modern GUI.
GNU General Public License v2.0
3.2k stars 156 forks source link

Support for Windows on ARM64 #221

Open bdr99 opened 3 years ago

bdr99 commented 3 years ago

I have a Surface Pro X running Windows 10 on ARM64, and there aren't many good video player applications compiled natively for ARM64. There's an experimental build of VLC Player, but it hasn't been updated in over 2 years. It would be awesome if mpv.net could support Windows on ARM64!

stax76 commented 3 years ago

mpv.net uses shinshiro libmpv builds, he's not making ARM builds, and I don't know if there is anybody else making ARM builds. Making my own builds would likely be difficult.

mpv.net also uses the media info library which also does not offer ARM builds.

Furthermore, .NET Framework might not support ARM, a .NET 5 port might be necessary, this would be a huge task due to various dependencies like powershell.

I hope it will happen, but unlikely soon.

stax76 commented 2 years ago

I think there aren't hard issues on my side, ARM64 support for the .Net Framework was announced, and a .Net 6.0 port is also realistic since it still supports Win 7, and isn't much different compared to .Net Framework. Also, mpv.net can since the last release operate without MediaInfo, so an ARM64 MediaInfo build isn't really necessary. The biggest issue might be getting Arm64 libmpv builds for Windows, you can ask for that on the mpv tracker.

minnyres commented 6 months ago

@stax76 I am able to compile mpv for Windows ARM64 with GitHub actions: https://github.com/minnyres/mpv-windows-arm64/blob/main/.github/workflows/release.yml This is the pre-built binary file: https://github.com/minnyres/mpv-windows-arm64/releases/download/v0.37.0/mpv_v0.37.0_arm64-llvm-mingw.7z

Can you consider add support for Windows ARM64 now?

stax76 commented 6 months ago

The Visual Studio solution of mpv.net v7 has 3 projects and all of them are configured as Any CPU, that means it's already supposed to run on any CPU. Please try mpv.net v7 and see if it runs.

minnyres commented 5 months ago

I can confirm mpv.net runs on Windows ARM64. In Visual Studio, publish the build with runtime win-arm64. Then drop libmpv-2.dll and vulkan-1.dll to the location of mpv.net.

stax76 commented 5 months ago

.NET .exe and .dll files contain platform-agnostic byte code, that is later JIT compiled to machine code by the runtime, this means you can use the released files and don't have to compile it yourself, you only have to replace the native libraries libmpv and mediainfo. Please note, mpv.net has an option to use mpv instead of mediainfo to retrieve media information, so it does not strictly need the mediainfo library, but it's necessary to set the option as there is no detection if the library exists.

minnyres commented 5 months ago

The releases on GitHub will ask to install x64 .Net desktop runtime even if I have arm64 .Net desktop runtime installed. After install x64 .Net desktop runtime it runs with x64 libmpv by emulation. However after replace with native libmpv it throws BadImageFormatException.

屏幕截图 2024-01-09 230914

屏幕截图 2024-01-09 232801

stax76 commented 5 months ago

I thought it would work.

shinshiro build will support aarch64 soon

In that case, I can rewrite my release script to support it too.

ScottRFrost commented 2 weeks ago

WIndows on ARM is really being pushed by Microsoft. I love my new ARM laptop but I hate using VLC instead of MPV.NET since there aren't any native bins.

minnyres commented 2 weeks ago

@ScottRFrost Here is my ARM64 build for mpv.net. 7-Zip 23.01 or later is required to extract the archive. https://mega.nz/file/pEB3jaAC#ii4_9iIRd36VbAjysup_ETnRASpCbyrwrZMeB7W36T8