Skip to content

Latest commit

 

History

History
107 lines (78 loc) · 5.89 KB

README.macOS.md

File metadata and controls

107 lines (78 loc) · 5.89 KB

MDK: Multimedia Development Kit

Features

Swift

https://github.com/wang-bin/swift-mdk

About SDK for macOS

  • Support Apple sillicon
  • Support Metal and Vulkan renderer
  • Support VP9 on macOS 11+
  • Support X11 if runtime libraries exist

SDK is built by Xcode 15 with

macOS 10.15+

Executables download from internet are not able to run. Try to run ./mdk-sdk/catalina.sh

Optional:

  • MoltenVK or Vulkan SDK
  • OpenGL ES2/3: via ANGLE project or PowerVR SDK. the default if EGL is available. 0-copy rendering VideoToolbox frames is supported for ANGLE. Can be disabled by environment var GL_EGL=0 or GLRenderAPI.
  • X11 via XQuartz
  • Metal: recommended
  • OpenGL
  • OpenGL ES2/3: via ANGLE or others. The default if EGL runtime is found.
  • Vulkan
  • FFmpeg. Direct rendering via property "pool=CVPixelBuffer"
  • VT: videotoolbox hardware decoder. h264, hevc, vp9 support. propertyes: threads, realTime, async, format, hardware, width, height. e.g. player.setVideoDecoders({"VT:format=nv12:async=1", "FFmpeg"})
  • VideoToolbox: via ffmpeg

VT default use async mode, and the performance is better performance then FFmpeg's sync VideoToolbox

Examples

gapless playback for any audio and video: glfwplay/sdlplay video1 video2 ...

N players for 1 video: multiplayers -share -c:v VideoToolbox -win N url

N videos and N players: multiplayers -share -c:v VideoToolbox url1 url2 ... urlN

N videos renderers for 1 player: multiwidnows url

Use in CMake Projects

	include(mdk-sdk-dir/lib/cmake/FindMDK.cmake)
	target_link_libraries(your_target PRIVATE mdk)

Qt qmake project

include($$MDK_SDK_DIR/mdk.pri)

Recommended settings

  • macOS, iOS: player.setDecoders(MediaType::Video, {"VT", "hap", "FFmpeg", "dav1d"});

Use in Xcode

Choose any of

  • Add mdk.xcframework to your project(Embed & Sign)
  • install via cocoapods pod 'mdk'

Code Sign

Choose any of

  • In Build Settings add --deep to Other Code Signing Flags
  • (Recommended) In Build Phase, add a New Run Script Phase with content [ -n "$CODE_SIGN_IDENTITY" ] && find "$BUILT_PRODUCTS_DIR" -depth -name "libffmpeg*.dylib" -exec codesign -i mdk.framework.ffmpeg -f -vvvv -s"${EXPANDED_CODE_SIGN_IDENTITY}" ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements,flags {} \;

Source code:

Copyright (c) 2016-2024 WangBin(the author of QtAV) Free for opensource softwares, non-commercial softwares, flutter, QtAV donors and contributors.