Awesome
Download latest Nightly Build SDK from sourceforge or github actions(not always latest)
Sourceforge Github Releases NuGet
Features
- Simple and powerful API set
- Cross platform: Windows(x86, arm), UWP, Linux, macOS, Android, iOS, tvOS, visionOS, Raspberry Pi
- Hardware accelerated decoders
- 0-copy GPU rendering for all platforms and all renderers(Vulkan is WIP.)
- Dynamic OpenGL
- OpenGL, D3D11, D3D12, Vulkan and Metal rendering w/ or w/o user provided context
- Integrated with any platform native ui apps, gui toolkits or other apps via OpenGL, D3D11/12, Vulkan and Metal (WinUI3, OBS, Flutter, Qt, SDL, GLFW, SFML, .NET Avalonia etc.) easily
- HDR display, HDR to SDR and SDR to HDR tone mapping. You can use HDR display in Qt6(6.6+ for macOS, 6.x for windows), OBS Studio and more.
- Dolby Vision rendering, including Profile 5. Support HEVC and AV1.
- Seamless/Gapless media and bitrate switch for any media
- Optimized Continuous seeking. As fast as mpv, but much lower cpu, memory and gpu load. Suitable for timeline preview
- Subtitle rendering, including ass, plain text, bitmap, closed caption
- Smart FFmpeg runtime, dynamic load, binary compatible with 4.0~7.x
- Professional codecs: GPU accelerated HAP codec rendering, Blackmagic RAW, R3D, nvJPEG2000
Install
CMake
include(${MDK_SDK_DIR}/lib/cmake/FindMDK.cmake)
target_link_libraries(your_target PRIVATE mdk)
Qt qmake
include($$MDK_SDK_DIR/mdk.pri)
CocoaPods
(Objective-)C/C++ Users
pod 'mdk'
Optionally you can use mdk.xcframework directly.
Swift Users
pod 'swift-mdk'
and add
import swift_mdk
Nuget
Install via NuGet in Visual Studio for both Windows desktop and UWP
macOS Hardened Runtime
You may fail to run(or codesign) with default hardened runtime options because there are some dylib files in mdk.framework not signed correctly. You can either select Disable Library Validation
in Hardened Runtime
options, or sign dylib(RECOMMENDED): In Build Phase
, add a New Run Script Phase
with content
[ -n "$CODE_SIGN_IDENTITY" ] && find "$BUILT_PRODUCTS_DIR" -depth -path "*mdk.framework/*" -name "lib*.dylib" -exec codesign -f -vvvv -s"${EXPANDED_CODE_SIGN_IDENTITY}" ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements,flags {} \;
Distribute
- mdk(libmdk.so.0/ibmdk.dylib/mdk.dll) and ffmpeg library(or standard ffmpeg libraries) are always REQUIRED
- libass.dll/libass.dylib/ass.framework/libass.so can be optional if not using subtitle rendering
- mdk-braw.dll/libmdk-braw.{so,dylib}: optional, for blackmagic raw videos
- mdk-r3d.dll/libmdk-r3d.{so,dylib}: optional, for RED raw videos
- mdk.pdb/libmdk.so*.dsym: debug symbols.
- Add libdav1d.dll/libdav1d.dylib/dav1d.framework/libdav1d.so from to support av1 software decoding
Documents
- wiki
- sdk headers
Recommended settings
- macOS, iOS:
player.setDecoders(MediaType::Video, {"VT", "hap", "FFmpeg", "dav1d"});
- Windows:
player.setDecoders(MediaType::Video, {"MFT:d3d=11", "D3D11", "DXVA", "CUDA", "hap", "FFmpeg", "dav1d"});
- Linux:
// XInitThreads(); // If using x11. before any x11 api call. some gui toolkits already call this, e.g. qt, glfw
SetGlobalOption("X11Display", DisplayPtr); // If using x11. Requred by VAAPI, VDPAU
player.setDecoders(MediaType::Video, {"VAAPI", "VDPAU", "CUDA", "hap", "FFmpeg", "dav1d"});
- Raspberry Pi: use mdk-sdk-linux.tar.xz, delete libffmpeg.so.* to use system ffmpeg to support h264, hevc hardware decoder and use OpenGL ES2/3 0-copy rendering
player.setDecoders(MediaType::Video, {"V4L2M2M", "FFmpeg:hwcontext=drm", "FFmpeg"});
- Android:
SetGlobalOption("JavaVM", JvmPtr); // REQUIRED
player.setDecoders(MediaType::Video, {"AMediaCodec", "FFmpeg", "dav1d"});
Open Source
Modules and Dependencies
- License generator and validator
- Android java wrapper and example
- MediaFoundation decoder module
- av1 software decoder module
- sunxi decoder + renderer
- GFX surface and render loop
- JNI C++ api
- Android java and jni APIs in C++
- C++ TLS
- C++ compatibility layer
- cmake tools
- Blackmagic RAW
- R3D RAW
Examples and Plugins for Other Frameworks
- examples for different platforms and gui toolkits
- Swift player and QuickLook plugin for macOS
- obs-studio video source plugin
- as a qtmultimedia plugin
Language Bindings
Sponsors
Users
<a href="https://bigringvr.com"><img src="https://bigringvr.com/images/BR_Logo_only.svg" width=140 height=120 alt="BigRingVR"/></a> <a href="http://1218.io"><img src="https://avatars.githubusercontent.com/u/15963166?v=4" width=120 height=120 alt="Seer"/></a> <a href="https://www.heavym.net/en"><img alt="HeavyM" src="https://eadn-wc04-3624428.nxedge.io/cdn/wp-content/uploads/2020/09/Logo-Verticale-Base-Sans-signature-Small-border.svg" height=120 ></a> <a href="https://sureyyasoft.com"><img class="logo" src="http://sureyyasoft.com/images/s_images/logo_title.png" height=70 alt="SureyyaSoft"></a> <a href="https://www.xnview.com/en/xnviewmp"><img class="logo" src="https://www.xnview.com/img/app-xnviewmp-512.png" height=120 alt="XnViewMP"></a> <a href="https://apps.apple.com/us/app/kalismart/id1530155654"><img src="http://www.kalimind.com/assets/images/kalimind_logo.svg" alt="kalismart" height=120></a> NOTIONTHEORY <a href="https://smartplayer.ru"><img src="https://static.tildacdn.com/tild3437-3132-4139-b365-373030343131/Group_100.svg" alt="smartplayer" width=120 height=120 style="background-color:black"></a> <a href="https://smartplayer.ru"><img src="https://static.tildacdn.com/tild3730-3634-4463-a464-333634323465/Group_20.svg" alt="smartplayer" width=400 height=120 style="background-color:black"></a>
<!-- <a href="https://smartplayer.ru"><img src="https://static.tildacdn.com/tild3431-3533-4461-b365-386335306263/Group_101.svg" alt="smartplayer" width=600 height=120 style="background-color:black"></a> -->! <a href="https://apidash.dev"><img src="https://apidash.dev/media/apidash.png" alt="API Dash" width=120 height=120 style="background-color:black"></a>
License
- Free for opensource projects, QtAV donors and contributors: you can acquire a key from me. Can be commercial software
- Free for Flutter users. A key is already included. Can be commercial softwares.
- Free for other non-commercial users: you can acquire a key from me.
- Commercial license for other users: a key for an app for a single platform or multiple platforms.
- Other users without a key: make sure your sdk is updated, otherwise you may see an QR image in the last frame.
License key generator and validator is open source