GithubHelp home page GithubHelp logo

blackcz2015 / libmpv-darwin-build Goto Github PK

View Code? Open in Web Editor NEW

This project forked from media-kit/libmpv-darwin-build

0.0 0.0 0.0 170 KB

libmpv for macOS & iOS.

License: MIT License

Shell 34.95% Go 9.09% Makefile 39.52% Meson 16.43%

libmpv-darwin-build's Introduction

libmpv build

Provides builds of libmpv for macOS & iOS, used by media_kit, compatible with commercial use.

Heavily inspired by Homebrew and IINA.

Usage

$ brew install cmake golang meson ninja
$ VERSION=v0.0.1 make
$ ls build/output
libmpv-libs_v0.0.1_ios-arm64-audio-default.tar.gz
libmpv-libs_v0.0.1_ios-arm64-audio-full.tar.gz
libmpv-libs_v0.0.1_ios-arm64-video-default.tar.gz
libmpv-libs_v0.0.1_ios-arm64-video-full.tar.gz
libmpv-libs_v0.0.1_iossimulator-universal-audio-default.tar.gz
libmpv-libs_v0.0.1_iossimulator-universal-audio-full.tar.gz
libmpv-libs_v0.0.1_iossimulator-universal-video-default.tar.gz
libmpv-libs_v0.0.1_iossimulator-universal-video-full.tar.gz
libmpv-libs_v0.0.1_macos-universal-audio-default.tar.gz
libmpv-libs_v0.0.1_macos-universal-audio-full.tar.gz
libmpv-libs_v0.0.1_macos-universal-video-default.tar.gz
libmpv-libs_v0.0.1_macos-universal-video-full.tar.gz
libmpv-xcframeworks_v0.0.1_ios-universal-audio-default.tar.gz
libmpv-xcframeworks_v0.0.1_ios-universal-audio-full.tar.gz
libmpv-xcframeworks_v0.0.1_ios-universal-video-default.tar.gz
libmpv-xcframeworks_v0.0.1_ios-universal-video-full.tar.gz
libmpv-xcframeworks_v0.0.1_macos-universal-audio-default.tar.gz
libmpv-xcframeworks_v0.0.1_macos-universal-audio-full.tar.gz
libmpv-xcframeworks_v0.0.1_macos-universal-video-default.tar.gz
libmpv-xcframeworks_v0.0.1_macos-universal-video-full.tar.gz

Naming convention

libmpv-<format>_<version>_<os>-<arch>-<variant>-<flavor>.tar.gz
Component Notes Value
format Output format of built files libs, xcframeworks
version Semantic version v0.0.1, …
os Operating system ios, iossimulator, macos
arch Architecture arm64, amd64, universal
variant Usage context audio, video
flavor Number of available decoders, … default, full

Minimum versions

Platform Arch Min Version Notes
macOS amd64 10.9 Required by uchardet
arm64
iOS arm64 9.0 Required by ffmpeg
iOS Simulator amd64 9.0 Required by ffmpeg
arm64 12.0 Required by xcodebuild -create-xcframework

Dependencies

flowchart LR

A(mpv) --> B(ffmpeg)
A(mpv) -.-> C(libass)
A(mpv) -.-> D(uchardet)

B -.-> H(dav1d)
B -.-> I(libressl)
B -.-> J(libxml2)

C --> E(freetype)
C --> F(harfbuzz)
C --> G(fribidi)

E -.-> F
Loading
  • ffmpeg: A cross-platform solution for converting, streaming, and recording audio and video, with support for a wide range of codecs and formats

  • libass(optional): A library for rendering subtitles in videos, with support for advanced text formatting and positioning features (made optional with a patch)

  • fribidi: A library for handling bidirectional text (such as Arabic or Hebrew) in Unicode strings, with support for complex shaping and layout

  • freetype: A library for rendering high-quality text in graphics applications, with support for a wide range of font formats and glyph rendering techniques

  • harfbuzz: A library for shaping and laying out text in multiple languages and scripts, with support for advanced typography features such as ligatures and kerning

  • dav1d (optional): A library for cross-platform AV1 decoding

  • libressl (optional): A fork of OpenSSL that aims to provide a more secure and auditable implementation of the SSL/TLS protocols

  • libxml2 (optional): A library for processing XML data, used by ffmpeg to support the Dash protocol

  • uchardet (optional): A C++ port of the Universal Character Encoding Detector (used by Mozilla Firefox and Thunderbird) for detecting the encoding of input text

Commercial use

Dependency Licence Commercial use
mpv LGPL-2.1 (-Dgpl=false)
ffmpeg LGPL-2.1 (--enable-gpl & --enable-nonfree omitted)
libass ISC
freetype FreeType
harfbuzz MIT
fribidi LGPL-2.1
libressl Apache-1.0, BSD-4-Clause, ISC, public domain
uchardet MPL-1.1, GPL-2, LGPL-2.1
libxml2 MIT
dav1d BSD-2-clause

Notes

  • Some dependencies, which are not needed at the moment, may be added in the future:

    • libbluray: A library for reading and parsing Blu-ray discs, with support for advanced features such as BD-J menus and seamless branching

    • libarchive: A library for reading various archive formats, including tar and zip, with support for compression and metadata, and a flexible API for reading and extracting archive contents

  • We use meson as much as possible in order to simplify cross-compilation, at the cost of some heaviness regarding legacy packages

  • If the build freezes, reboot macOS

  • Command to visualize the workflow of a Makefile:

    $ make -Bnd | make2graph | dot -Grankdir=LR -Tpng -o graph.png
    

Project layout

.
├── ...
├── cmd                                   # golang scripts
├── pkg                                   # golang packages
├── downloads.lock                        # lock file of dependencies archives
├── Makefile                              # main build script
├── scripts                               # build scripts
├── cross-files                           # cross build files used by meson
├── build
│   ├── intermediate                      # intermediate build artifacts
│   │   ├── tool-versions.lock            # versions of tools used during build
│   │   ├── downloads                     # dependencies archives files
│   │   ├── links                         # symbolic links to host binaries
│   │   ├── <rule>_<os>-<arch>-<variant>
│   │   └── ...
│   ├── tmp
│   │   ├── <rule>_<os>-<arch>-<variant>
│   │   └── ...
│   └── output
│       ├── debug.zip                     # zip containing locks and logs
│       ├── libmpv-<format>_<version>_<os>-<arch>-<variant>.tar.gz
│       └── ...
└── ...

How the libass optional patch was created

As the dependency of mpv on libass is deeply embedded in the code, the simplest solution was to:

  1. Remove the dynamic linking in meson.build.
  2. Include the ass/ass.h and ass/ass_types.h headers directly in the code
  3. Remove the call to ass_library_version in player/command.c
  4. Remove the calls to ass_library_init, called by mp_ass_init, in sub/osd_libass.c and sub/sd_ass.c

Resources

libmpv-darwin-build's People

Contributors

birros avatar alexmercerind avatar 23doors 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.