Table of Contents

Nickvision.MPVSharp

Use MPV in your C# apps

MPVSharp provides C# bindings for libmpv, a library for embedding amazing MPV player into another apps.

Installation

MPVSharp - main package, requires libmpv to be installed on the user system or provided together with your application (works on Windows and Linux).

MPVSharp.Bundled - has libmpv built-in (Windows 64-bit only, the build is from this repo).

How to use

There are 2 namespaces:

  • Nickvision.MPVSharp.Internal provides objects and methods that closely follow libmpv C API. You can find functions from client.h in MPVClient.cs and functions from render.h in MPVRenderContext.cs
  • Nickvision.MPVSharp gives you another objects that work on top of Internal counterpart, but provides you with various helpers and convenience functions. They are easier to use, but the API is slightly different than in Internal, so you will probably want to read docs for Client class to find what methods you can use.

Look at the examples to get the basic idea how to use MPVSharp.

There are comments in the code, but they are mostly an adaptation of some parts of comments from libmpv, which is very well documented:

Refer to MPV documentation to find the list of options, commands and properties.

Examples

GirCore Example

GirCore example playing Charge - Blender open movie, licensed under CC BY 4.0

  • Simple - basic program playing your file/link. If the file is video, a window will be created by MPV itself.
  • GirCore - GTK4 application playing a video from youtube. Made with GirCore. Requires GTK4 to be installed.
  • OpenGL - OpenTK application playing a video from youtube.

Chat

Join our room

Dependencies

Code of Conduct

This project follows the GNOME Code of Conduct.