Giter Club home page Giter Club logo

mpvkit's Introduction

MPVKit

ffmpeg mpv

libmpv bindings for macOS, iOS, iPadOS and tvOS in Swift

Table of content

Features

  • Wrapper of libMPV, the C API of the popular command line media player MPV.
  • Easily integratable via SwiftPM.
  • A basic SwiftUI view and control overlay panel example, you can customied it as you like (WIP)
  • protocol support: http, https, bluray... and more
    • please note only bdmv folder support is available on iOS, tvOS, bluray ISO support is only available on MacOS,
  • codec support: h264, h265, av1, vp9... and more
  • other features: LuaJIT, shaderc, vulkan(MoltenVK)

Use-case

When will you need MPVKit?

Frankly, you will need it whenever you need to play media not supported by QuickTime / AVFoundation or if you require more flexibility.

Here are some other common use-cases:

  • Playing something else besides H264/AAC files or HLS streams.
  • Need subtitles beyond QuickTime’s basic support for Closed Captions.
  • and more!

Requirements

  • iOS 17.0+ / macOS 14.0+ / tvOS 17.0+
  • Xcode 15.0+

Installation

Swift Package Manager

In Xcode:

  • File → Swift Packages → Add Package Dependency…
  • Enter https://github.com/karelrooted/MPVKit in the URL field and click Next.
  • The defaults for the version settings are good for most projects. Click Next.
  • Check the checkbox next to MPVKit.”
    • Also check LibMPV if you want libmpv C Binding.
    • Also check FFmpegKit if you want swift binding of ffmpeg c library.
    • Also check Libffmpeg if you want ffmpeg c library.
  • Click “Finish.”

Usage

MPVKit is a WIP(vo=gpu-next is not production ready), currently you have to use libmpv c binding to build your own

MPVKit is structured mostly like VLCUI, so can be easily imported in project already support VLCUI as a alternative player

import SwiftUI
import MPVKit

struct ContentView: View {
    var body: some View {
        VStack {
            MPVVideoPlayer(url: URL(string: "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4")!)
        }
    }
}

Build

The building script of binary frameworks(libmpv, libffmpeg, etc...) is at : karelrooted/libmpv

Credits

License

MPVKit is under the LGPL 3.0 license. Check mpv and ffmpeg for more license requirement. Please note samba is under GPL v3 license, so if you enable smbclient, this library's license became GPL v3 too

mpvkit's People

Contributors

karelrooted avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.