Releases: wang-bin/mdk-sdk
Releases Β· wang-bin/mdk-sdk
Version 0.23.1
- HDR
- Fix scRGB white level scale
- Add ColorSpaceExtendedSRGB and ColorSpaceExtendedLinearSRGB. scRGB is used on windows, lumiance is scene referred, while ExtendedLinearSRGB(used on apple) is display referred
- Vulkan:
- Compress built-in spv via smol-v
- Add spv for scRGB output
- Support build shader via shaderc shared library(shaderc_shared.dll, libshaderc_shared.so{,.1}, libshaderc_shared{.1,}.dynamic) if no built-in spv found.
- Add
VideoStreamInfo.image
as audio cover art image - Apply rotation in recorded video
- Add
MediaEvent{track, "decoder.video", "size", {width, height}}
indicates video frame size changed, value inMediaInfo
is also updated - Add
player.setProperty("avcodec.opt_name", "opt_val")
to applyAVCodecContext
options. For video only codecs, you can also useplayer.setProperty("video.decoder", "opt_name=opt_val")
; - Do not sync to audio if no audio decoded
- AMediaCodec: add property "name" to force a codec name, e.g.
AMediaCodec:name=c2.android.hevc.decoder
. - MFT: fix d3d=11 driver bug (receive MF_E_TRANSFORM_STREAM_CHANGE endlessly)
- Fix
setBufferRange()
dropping mode incorrectly drops audio packets - Fix some dead locks
Version 0.23.0
- HDR
- Support scRGB, via
player.set(ColorSpaceSCRGB)
, recommended for windows HDR screen, same experience as system player. You can try it in QtQuick app via env varQSG_RHI_HDR=scrgb
, or in OBS Studio via the plugin - Add global option "sdr.white", SDR white level. Default is 203. Can be a different value, e.g. Qt is 100. OBS Studio default is 300 and can be changed by user in settings dialog.
- Add global option "hdr10.format", Metal only. Metal use rgba16f for HDR10 by default. This can let QtQuick apps support perfect HDR playback on macOS
- Add ColorSpaceSCRGB, ColorSpaceExtendedLinearDisplayP3
- Fix linear target trc
- Support scRGB, via
- Metal: use HLG metadata. use scRGB if requested hdr is not supported.
- Raspberry pi: fix hevc 0-copy OpenGL renderer crash on debian 12. It's a driver bug.
- Decoder options can be set via
player.set("video.decoder", "key1=val1:key2=val2")
- AMediaCodec:
- Fix crash if image=1 on api level < 26
- Do not acquire an image if releaseOutputBuffer error, fix long wait after seek/stop
- Add SeekFlag::SeekFlag for KeyFrame seeking. This can fix EPERM error for some videos.
Player.position()
is the last seek request target position when seeking. Previously if seeking is frequent may go back to a previous seek result position then the final position.- Improve seeking, fix seek request not processed, fix seek callback may be called multiple times
- Fix onFrame() callback sometimes can't get an EOS frame when playback finished or stopped by some reason.
- Fix gpu VideoFrame.to() not in host memory if target format, size is the same as input
- Fix
Player.prepare()
from a position > 0 wrong result if the first decoder fails. - Fix
waitFor()
dead lock - Fix PGS subtitle frame duration
- VAAPI: fix undefined symbol on old systems, e.g. ubuntu 16.04
- FFmpeg:
- Fix audio timestamp if a packet has no pts
- BRAW:
- Fix crash when destroying player if cuda 0-copy is used
- Fix OpenCL pipeline, by AdrianEddy
Version 0.22.1
- VAAPI: document is updated
- Support GLX/EGL texture from dri3 pixmap from drm prime, via option
interop=dri3
, or fallback frominterop=x11
failure. For some drivers(intel iHD driver) it's the only 0-copy solution in GLX context because libva-x11 is broken(vaPutSurface error).VAEntrypointVideoProc
is requred. Recommend to installintel-media-va-driver-non-free
, because i965 and free iHD driver may lack ofVAEntrypointVideoProc
. - Support
GL_TEXTURE_EXTERNAL_OES
fordri3
andx11
interop, via optionexternal=1
- Support GLX/EGL texture from dri3 pixmap from drm prime, via option
- MFT:
- Ignore h264 level by default
- Fix adapter index if
vendor
property is set, e.g.MFT:d3d=9:vendor=nv
- VDPAU:
- Add
interop
property, can bevideo
,output
andpixmap
. Detail: https://github.com/wang-bin/mdk-sdk/wiki/Decoders#vdpau - Use x11 display provided by user except
pixmap
interop
- Add
- DXGI:
- Fix crash in vm, or no gpu driver
- Always try rgba8 if fail to create a rgb10a2 swapchain, fix d3d11 feature level 9.3 create render context error
VideoFrame.timestamp()
is alway readable.TimestampEOS
indicates no more frames- Add global option
demuxer.max_errors
to continue on error if error count is less than this value - Add
mem
scheme to play from memory, url format ismem://addr+size
- FFmpeg: fix crash if a codec is not enabled
- Add
mdk.pri
for qt qmake projects. All you need is including this file - Enable full lto to reduce binary size. Thin lto was used in previous versions.
- Try the next decoder if a decoder does not produce any frame. MFT jpeg decoder may produce nothing but no error.
- CUDA: fix crash for some unsupported streams, e.g. av1 12bit
- Fix decode error if previous decoder in decoder list failed
- Fix open a decoder multiple times before trying the next decoder
- Fix pause at eof then stop dead lock if
keep_open
is set(music with cover art). - Fix incorrect seek request count
Version 0.22.0
- Add
Player.onMediaStatus(MediaStatus oldValue, MediaStatus newValue)
to simplify user code.Player.onMediaStatusChanged
is deprecated. - Add player property
avformat.xxx
,avio.xxx
as as ffmpeg demuxer/io options - C api module is opensource: https://github.com/wang-bin/libmdk-capi
- If
keep_open
property is set, state changes toState::Paused
when reach EOS. Also reduce cpu load - Android:
- Fix x86 relocation
- Fix planar formats in OpenSL
- MFT:
- Support DV video codec
- Continue if no attributes
- OpenGL: Fix crash if failed to create a context, found in flutter android example
- VAAPI: Flush before seek, fix invalid surface id and crash
- VDPAU:
- Interop with output surface by default if not nvidia to workaround hevc crash on amd gpus.
- Prefer interop2 extension
- BRAW:
- Support build with sdk version 2 and 3
- Fix 0-copu glitch
- Dead lock before unloaded
- FFmpeg:
- hw decoders do not fallback to sw decoder by default, so can correctly switch to the next decoders set in
setDecoders()
. propertysw_fallback=1
to use old behavior - Use single thread for hwdec when possible
- Stop decoding ASAP if hwdec, fix multi-thread hwdec crash on unsupported GPUs, e.g. MX940
- hw decoders do not fallback to sw decoder by default, so can correctly switch to the next decoders set in
- Fix 'file://' on windows
- Fix frames drop in decoders
- Fix loop does not work if audio duration is much smaller than video
- Fix seek may fail if audio duration is much smaller than video
- Fix seek callbacks not called
- Fix
prepare()
fails if previous playback is not finished - Fix prepare callback is not called if demuxer open error
- Fix seek error for a music with cover art
- Fix crash if unsupported track type is read
Version 0.21.1
- Fix loop fails in some ranges
- Raspberry pi: enable eglimage reuse by default to improve 0-copy rendering performance
- API: allow construct Player object from existing ptr
- Android: support assets, via url scheme 'assets', for example
player.setMedia("assets://flutter_assets/assets/test.mp4")
- Improve av sync
- Braw:
- upgrade to version 3.1
- Support iOS
- Enable 0-copy for cuda
- FFmpeg:
- Add vulkan decoder
FFmpeg:hwcontext=vulkan:copy=1
, or select another device indexFFmpeg:hwcontext=vulkan:copy=1: hwdevice=1
- Fix hwaccel_flags is not correctly applied
- Add vulkan decoder
- New project: fvp is a plugin for flutter video_player to support all platforms via libmdk. Add
fvp
as a dependency, and add 2 lines of code, then you can benefit from the power of libmdk. You can try prebuilt example from artifacts of github actions
Version 0.21.0
- New D3D12 renderer via
D3D12RenderAPI
. Support all decoders. Performance is similar to D3D11. Optimal texture upload for iGPU, env var "GPU_OPTIMAL_UPLOAD=0" can disale optimal upload to compare performance. You can try Qt6 QML example or./glfwplay -d3d12 video_file
. - D3D11:
- Texture upload optimize for iGPU on win10. env var "GPU_OPTIMAL_UPLOAD", significantly reduce vram usage, about 50~70%, and even more for compressed textures. Software decoders and built-in hap decoder will benifit from it.
- Cache shader binaries
- Fix crash on win7 if default swapchain format is not supported
- DRM Prime:
- Auto detect external texture requirements via modifiers
- Fix fd leak in 0.20.0
- Support reusing EGLImage to improve performance via global option
SetGlobalOption("eglimage.reuse", 1)
, or decoder optionreuse=1
. Known to work for raspberry pi.
- Vulkan:
- Fix
snapshot()
error, a regression in previous release - Fix a crash for Hap videos
- Fix
- Metal:
- Fix BC3CoCgSY
- Support BC formats for iOS 16.4+
- OpenGL: Fix deleting queries without a context, fix potential leaks
- MFT:
- Supports
d3d=12
option to enable d3d12 decoding. Currently 0-copy renderer is only D3D12, requirescopy=1
option to be used in other renderers. d3d=11
is default- Fallback to lower d3d version or software decoder if open error. So now using
MFT
without option as decoder name is enough. - Fix decode error on win7
- Supports
- VAAPI:
- Support windows, backend is d3d12 decoder. Currently only supported by D3D12 renderer 0-copy rendering, or use
copy=1
option for other renderers. Requires dlls from https://www.nuget.org/packages/Microsoft.Direct3D.VideoAccelerationCompatibilityPack can be found byLoadLibrary()
- Fix render error because of drm fd leak
- Support windows, backend is d3d12 decoder. Currently only supported by D3D12 renderer 0-copy rendering, or use
- Raspberry Pi 3/4:
- Perfectly support h264, hevc hardware decoder and 0-copy rendering in Raspberry Pi OS via
Player.setDecoders(MediaType::Video, {"V4L2M2M","FFmpeg:hwcontext=drm"})
. System ffmpeg is required, MUST delete libffmpeg.so.* in mdk sdk package. May also work with https://github.com/jc-kynesim/rpi-ffmpeg . EGL + OpenGL ES2/3 is recommended by hevc. You can test with./glfwplay -c:v V4L2M2M,FFmpeg:hwcontext=drm -gl test.mp4
- Perfectly support h264, hevc hardware decoder and 0-copy rendering in Raspberry Pi OS via
- Android:
- AMediaCodec video decoder enable
image=1
option by default, lower latency - Fix acquiring AImage when it's not ready
- Fix jni env detach
- Add
low_latency
option for AMediaCodec video decoder, default is 0. requires api level 30+
- AMediaCodec video decoder enable
- Fix alpha value for opaque formats in all renderers
- Enable
SeekFlag::InCache
forDefault
flag - Support programs, add
MediaInfo.program
.setActiveTracks(MediaType::Unknown, {N})
will select Nth program and it's audio/video tracks will be active. Useful for mpegts programs - Add
SubtitleStreamInfo.metadata
, subtitle(and other streams) language ismetadata["language"]
- New pixel formats supported by dx, drm
- Fix a/v sync if audio duration is a lot less than video
- Fix BRAW seek
- FFmpeg:
- Improve abi compatibility, better support ffmpeg 4.x and 5.x
Version 0.20.0
- Support R3D raw videos via R3D SDK. Document: https://github.com/wang-bin/mdk-sdk/wiki/Decoders#r3d
- Support decoding closed caption for ffmpeg based decoders(FFmpeg, VideoToolbox, D3D11 etc.) and rendering. Add "cc" event when closed caption is detect
- Add drm prime 0-copy rendering, support multi-layers, multi-planes object, support 2d and external texture. Will be used by ffmpeg rpi v4l2 decoder and rkmpp decoder. It should work but not tested.
- Support QSV decoder via oneVPL
- Add video decoder change event https://github.com/wang-bin/mdk-sdk/wiki/Types#class-mediaevent
- FFmpeg: Support 6.0. now the same binary is compatible with ffmpeg 4.4~6.0 runtime
- Improve log
- Reduce shader update for Vulkan and D3D11 renderer
- Fix CUDA and NVDEC not fully enabled on linux
- Fix incorrect
Player.position
if in paused state for videos with no audio track - Fix incorrect pixel aspect ratio for some videos, prefer the value from decoder(e.g. MFT)
- Fix audio clock not paused if prepare() without play(Apple only).
- BRAW: fix audio not paused if without play
- iOS: fix rejected by app store
- OpenGL: Fix bayer formats not rendered
- VAAPI:
- Fix derive image
- Add property "x11", "drm"(or "device") to set x11 display and drm device path(global option "X11Display", "DRMDevice"). "display" option to use "x11" or "drm" display.
- Improve surface sync
- Support exporting to an drm prime object with a composed layer with multiple planes. decoder option "composed=1"
- Add decoder "VADRM" to test exporting drm prime from vaapi
- VT: Use semi-planar formats for macOS11+ & iOS14+ to fix unsupported default output formats
- Add VC-LTL build for windows desktop
- Support build plugins(braw, r3d) with sdk + abi headers. Add global options "plugins_dir"
Version 0.19.0
- New: support subtitle rendering. Can be embedded or external text/bitmap subtitle tracks. The first embedded subtitle track is enabled by default. Use
setActiveTrack(MediaType::Subtitle, ...)
to switch embedded subtitle track. External subtitle must be explicitly enabled by user viasetMedia(file, MediaType::Subtitle)
, and must call it at some point after main videosetMedia(mainVideoFile)
. Text subtitle is rendered by libass, only windows desktop and macOS prebuilt libass is provided for now. Linux users can install system libass. Text subtitles must be UTF-8 encoded. - API:
- add Player.enqueue(VideoFrame) to draw a frame provided by user
- Change frame timestamp precision from millisecond to microsecond
- Fix wrong display aspect ratio
- Improve redraw for D3D11, Metal and Vulkan
- Reduce frame queue in renderer to fix some decoders(MFT) may fail to output frames
- VT:
- add property "fourcc", "CVPixelFormat" to force an output format
- more pixel formats
- fix color range error
- QSV: support d3d11. add
d3d
option, can be 11(default for ffmpeg5.0+) or 9. - FFmpeg:
- log level for ffmpeg class, for example SetGlobalOption("ffmpeg.log", "trace=tcp")
- Check opt availability before set, no more warnings
- Fix unknown media type crash
Version 0.18.0
- API:
- Add Player.set(ColorSpace), supports auto HDR display, SDR to HDR or HDR to SDR tone mapping. More details
- Support HDR display for D3D11 and Metal. If a swapchain and metal layer is provided in RenderAPI, and Player.setColorSpace(ColorSpaceUnknown), then hdr display will be automatically enabled when possible. You can try glfwplay with d3d11/metal renderer and press key P. For macOS there is another example
- AMediaCodec:
- "surface" property can be ANativeWindow address to decode video into user profided surface from SurfaceView, SurfaceTexture etc.
- Add "image" property to support AHardwareBuffer as output, default is "0", can be enabled by "1". Requires android 8.0+.
- VT:
- Fix frames sorting for some videos
- Ignore reference missing error
- Fix wrong playback rate on apple if replay after playback end
- Fix audio timestamp is not monotonic for some streams and result in playback stuttering
- Fix decoding image is slow
- Fix global options are not correctly applied
- Fix HLG is not correctly set on MFT decoded frames
- Vulkan: fix crash on macOS with new drivers
- BRAW: fix file path encoding
- Fix some crashes
- Increase frame queue size in renderer, drop frames less
- Improve logging
- Global options changes:
- "log" == "logLevel", "ffmpeg.log" == "ffmpeg.logLevel"
- Add "profiler.gpu", shows gpu time for a frame in log
Version 0.17.0
- MFT:
- Support vc1, wmv, opus, amr, wma, dolby audio
- Fix mpeg4, enable mpeg2/4
- Flac partially works, but disabled by property "blacklist=flac"
- Add D3D11RenderAPI.vendor to choose gpu vendor, case insensitive. For example "nv" will select nvidia gpu
- MediaInfo.bit_rate is updated in real time
- Improve audio track switch when playing
- MediaStatus is Invalid if no track found
- D3D11: always flush after renderVideo
- Fix position error if audio has a cover art
- Fix ALSA dead lock if stopping player in paused state
- Pause clock when buffering
- Fix network stream frame update after buffering (apple)
- FFmpeg:
- Fix D3D11 vc1 decoding
- Fix audio decode error when seeking ts
- Fix probing dts audio in ts
- Fix filter is initialized twice
- Fix frame pts abi
- Improve encoder
- New Flutter desktop example