Skip to content

Releases: wang-bin/mdk-sdk

v0.31.0

30 Jan 13:32
Compare
Choose a tag to compare
  • API:
  • EGL:
    • Support HDR color spaces. player.set(ColorSpaceUnknown) will switch between HDR and SDR color space depending on current rendering video frame. Tested on android, may work on linux
    • Enable HDR10 metadata pass through, can be disabled by env var EGL_HDR_METADATA=0
    • Prefer rgb10a2 to avoid recreating context when switching between SDR and HDR
    • Support KHR_no_config_context to avoid recreating context when switching between SDR and HDR
  • Subtitle:
    • Fix properties not applied if set before play
    • Support splitting ASS rendered rgba image into several smaller regions when possible to reduce total size and gpu bandwidth. controlled by player property subtitle.ass.regions.max or env ASS_REGIONS_MAX, value is int. use subtitle.ass.regions.debug or env ASS_REGIONS_DEBUG to visualize regions and show debug messages.
    • Keep colorspace the same as video, fix dark in bt2020 pq
    • Add player property subtitle.scale to scale all kind of subtitles. default is 1.0, i.e. no scale
    • Fix subtitle.blur is not applied because of a libass bug
    • Add player property subtitle.size, default value is video to render in video frame size, other values will render in video renderer resolution
    • Redraw subtitle if output resolution changed even if playback is paused, e.g. rendering in renderer resolution, and resize the renderer
    • Redraw subtitle for any subtitle property change even if playback is paused.
    • Render earlier
    • Fix dead lock
    • Fix unexpected null texture for some timestamp values and blinking
    • Set ass storage size
  • Dolby vision: Fix shader error if yuv sampler is used for MediaCodec decoder
  • GL: add glFinish() before context destroyed
  • D3D11: Improve UMA support check. UMA optimized texture download. can be disabled by env GPU_OPTIMAL_DOWNLOAD=0
  • DXGI: Use the 1st screen's HDR capability
  • Metal: Fix rendering mutiple overlayes
  • MFT: return error if output type is not supported
  • Fix wrong start time if record() multiple times.
  • Fix buffered packets out of range of the value set by setBufferRange()
  • Fix audio not decoded after seek if paused and result in a/v desync(apple only).
  • Fix seek(if not started) callback may be called twice.
  • Fix global subtitle options not applied, regression in 0.30.1
  • FFmpeg:
    • Support webvtt in mkv. Patch is from avbuild, not merged by upstream.
    • Workaround aac packets from rtsp have no keyframe if ffmpeg > 7.1

v0.30.1

23 Nov 13:53
Compare
Choose a tag to compare
  • Fix a crash in audio renderer if get delay
  • renderVideo() before the 1st frame will clear render target with background color. useful if render target content is undefined
  • Fix some global options not applied immediately
  • FFmpeg: prefer new avcodec_get_supported_config()

Version 0.30.0

08 Nov 16:52
Compare
Choose a tag to compare
  • API:
    • Add Player.appendBuffer() to play streams with user provided data, for example data is from websocket. media protocol is stream, i.e. player.setMedia("stream:empty_or_any_string"). setTimeout() can abort current playback if timedout to read data from user.
  • Plain text subtitle(srt for example) style can be changed by user via subtitle properties
  • Multi channels audio rendering, no downmix to stereo
  • Support dolby vision in mpeg ts
  • PulseAudio is the default audio render for linux
  • Improve audio renderer delay and AV sync
  • VT: Fix hardware decoder disabled if hvcC has no PS NALUs
  • D3D11:
    • Fix UMA check if run x64 on arm64 and failed to create textures
    • Disable cross context 0-copy for AMD gpus to avoid corrupt result on many gpus
    • Set usage for swapchain, fix back buffer RTV create error on some win7 devices
  • VAAPI:
    • Map YUYV fourcc, fix jpeg yuv 422 rendering
    • Convert to RGB with VPP if DRM to EGLImage is not possible(desktop gl + external only formats)
  • DRM Prime:
    • Error if no OpenGL ES2/3 context for external only formats, then VAAPI can fallback to suboptimal rendering instead of blank
    • Map more formats
  • Player property "audio.tracks", "video.tracks" and "subtitle.tracks" is same as setActiveTracks(), value is a int list string, e.g. "0,1"
  • Reset more callbacks before deleting player object to simplify user code
  • Fix undefined symbol on wayland < 1.10, compatible with more linux distributions, e.g. ubuntu 14.04
  • More packed yuv formats
  • MFT: fix d3d9 not tried if d3d11 is not supported
  • Fix null callback invoked if reset by user
  • Will try to load Ass.framework on apple OS except macOS, to be compatible with media-kit's frameworks
  • FFmpeg: Fix wromg abi version if avfilter is disabled when swresample is loaded and crash, e.g. qt6's ffmpeg dlls
  • Add nvjpeg2000 plugin for windows x64, requires cudart64_12.dll and nvjpeg2k_0.dll
  • Compatible with libc++20

Version 0.29.1

30 Aug 14:04
Compare
Choose a tag to compare
  • Android 64bit is built with 16KB page size support
  • Supprt GL_EXT_EGL_image_storage for drm, via global option "eglimage.storage=1"
  • VAAPI: prefer x11 display to support both EGL and GLX
  • Add privacy manifest for apple platforms
  • Improve demuxer cache
  • Enable http reconnect
  • Fix OpenGL symbols not resolved on android 15 emulator
  • Fix snapshot in OpenGL renderers
  • Fix snapshot callback not invoked if failed
  • Fix muxer write after close
  • Fix a decoder crash when stopping playback
  • Fix waitFor(State::Stopped)
  • Stop demuxer immediately if io is aborted.
  • Apply ffmmpeg muxer options
  • Prefer ffmpeg dynamic library even if statically linked. mainly used by iOS user provided FFmpeg.framework

Version 0.29.0

03 Jul 05:54
Compare
Choose a tag to compare
  • Support demuxer cache for http(s), can be enabled via player.setProperty("demux.buffer.ranges", "8"/*or other positive int*/). {count, "cache.ranges"} event will be triggered when cached time ranges are created, dropped(via LRU cache) or merged. Other protocols can be enabled via player property player.setProperty("demux.buffer.ranges", "http,https,proto1,proto2");.
  • Add Player.bufferedTimeRanges()
  • Dolby vision: support reading metadata from av1 in all decoders, previously only supported by ffmpeg hwaccels and software decoder.
  • Support pause/resume rtsp stream in Player.set(State). Enable via player.setProperty("reader.pause", "1");.
  • Record video from non-key frame if property "reader.starts_with_key" is "0"
  • Support nvJPEG2000 as a plugin
  • Support planar xyz format, produced by nvJPEG2000
  • Support p012, p212, p412, can be produced by VT decoder(can be tested with VT:fourcc=tv20)
  • OpenGL:
    • Detect(guess) invalid foreign context, usually in old OSes(ubuntu 20.04) and with GLRenderAPI.getProcAddress set by user.
    • Fix blank display if failed update textures
  • D3D11: fix crash if decoder and renderer adapters are different
  • Metal:
    • Set layer scale, fix low resolution
    • Build highest shader version
  • VT: support ProRes without fourcc
  • VAAPI:
    • Prefer drm display over x11, less errors, better performance
    • Fix upload unmapped host memory crash
  • Fix wrong channels in recorded pcm
  • Fix prepare callback not invoked if decoder changed
  • Fix rgb48be rendering
  • FFmpeg
    • Improve abi compatibility, found in x86 32bit ffmpeg 4.x
    • Fix flipped frame in avfilter
  • Compatible with msvcp 14.40+

Version 0.28.0

01 Jun 16:10
Compare
Choose a tag to compare
  • Support rendering in a foreign render pass for all renderers. Previously only foreign opengl context are implemented. The performance should be better than rendering to texture. Now it's able to render in a Qt RHI window
  • Support decoding A53 closed caption in all video decoders. Previously only supported by ffmpeg hwaccels and software decoder. Can be disabled by player property "cc=0".
  • Add new player properties: "buffer", "audio.decoders", "video.decoders". Convenient to control player in flutter.
  • Support video frames with negative stride, frames are vertically flipped
  • BRAW: support 4.0 SDK, compatible with 3.0
  • Improve NALU start code and EBP search
  • VT decoder:
    • fix hevc mpegts decode error after seek
    • max continuous session restart on error is 1 by default, controlled by property "error=1"
  • MFT: fix mf shutdown too early and crash when releasing a sample after stop
  • Fix CUDA decoder error after seek. It's a regression in the previous release.
  • OpenGL: Fix UBO error, requires glsl150(OpenGL 3.2, ES 3.0)
  • Fix alpha channel value of render target when blending subtitle, now output alpha >= background alpha
  • Fix multiple frames rendered if prepare() without play
  • Fix wrong position() value after prepare() without play
  • Fix buffering progress value
  • Fix play a new media if previously an individual audio track file/url is used
  • Fix endless wait when buffering on apple
  • Fix audio channels on apple
  • Fix no frame decoded if decoder changed when seeking
  • Vulkan: fix wsi extension check
  • Metal: fix layer colorspace and disable EDR for SDR
  • Fix wrong frame height if copy DX9/11 textures to host memory
  • Fix negative duration and start time for live streams, should be 0

Version 0.27.0

06 May 07:13
Compare
Choose a tag to compare
  • Dolby Vision profile 5 support:
    • Works for all renderers: OpenGL, D3D11/12, Metal, Vulkan
    • Support SDR and HDR10 display
    • Works for all decoders. For ffmpeg software decoder and hwaccels, dolby vision metadata are parsed by ffmpeg. For other decoders including ffmpeg external decoders and mdk hardware decoders, metadata is parsed in mdk
  • AMediaCodec system dolby vision decoder is disabled by default(previously was enabled). Can turn on via property "dv=1".
  • Improve gpu const buffer/uniform update for all renderers
  • OpenGL: Support UBO. Enabled for OpenGLES >= 3.0, OpenGL >= 3.1 or extension GL_ARB_uniform_buffer_object is supported. Can be disabled via global option "gl.ubo=0" or env var "GL_UBO=0"
  • Fix blank display when switching to some videos
  • Fix dx swapchain colorspace support check
  • Reset some callbacks when destroying player
  • Add option "reader.starts_with_key", "0" can decode from non-key. Can be used to reduce latency of network stream
  • C++ API:
    • Fix callbacks are not thread safe
    • Fix MediaStatus callback register only once
    • Fix seek, prepare, snapshot callbacks
  • Fix video with a single frame not decoded until EOS
  • Fix blank display if play another video with only different color primaries
  • Fix packet drop
  • Fix seek after EOS demuxed
  • Use display p3 if hdr10 metadata is invalid
  • Read duration from metadata if stream duration is unknown
  • Set android application context automatically for ffmpeg 7.0+
  • Prefer AudioTrack over OpenSLES
  • FFmpeg: Add avformat.video/audio/subtitle_codec_id options

Version 0.26.0

31 Mar 06:51
Compare
Choose a tag to compare
  • Support WinUI3. updateNativeSurface() accepts SwapChainPanel as surface like UWP
  • Enable UWP features for windows desktop
  • Support visionOS
  • Add metadata change event MediaEvent{.category = "metadata"}, new metadata can be read from Player.mediaInfo().metadata. Useful to get icy metadata for SHOUTcast.
  • D3D11:
    • Support sync via kmt, requires env var D3D11_ZERO_COPY=0 and D3D11_KMT=1
    • Ignore RTV creation error for shader resource, e.g. textures produced by MFT software decoder via d3d=11
  • Vulkan:
    • Enable pipeline cache
    • Select the 1st physical device provided by vulkan by default, previously try to use a discrete device
  • Fix Player.WaitFor() may return wrong value
  • Fix YCgCo rendering
  • Add global option plugins.dir
  • Android: link to libmediandk.so for 64bit targets
  • macOS: fix audio data dropped when paused and results in wrong playback speed
  • BRAW, R3D:
    • Fix a crash when stopped
    • (R3D) Fix crash if seek a video without audio track if the previous media has a audio track
    • Build with R3DSDK 8.5.1
    • Support macOS appex, see the QuickLook plugin. mdk now weak link to r3d and braw to work in sandbox
    • Fix failed to play a normal video after braw/r3d in the same player instance
    • braw sdk now can be loaded from a custom dir from global option BRAWSDK_DIR
    • (BRAW) Fix some memory leaks
  • FFmpeg:
    • Support FFmpeg 7.0, now supported runtime versions are 4.0~7.0. Default build version is 6.1, you can remove bundled ffmpeg and add 7.0 shared library|ies to try the new version.
    • Can use avio directly via global option io.avio=1, default is via a custom avio
  • Swift: support cocoapods and swit package manager

Version 0.25.0

31 Jan 13:59
Compare
Choose a tag to compare
  • D3D11:
    • Improve gpu and cpu 0-copy rendering. Some AMD gpus are disabled because the result is wrong. Can be disabled by environment var D3D11_ZERO_COPY=0
    • Improve sync if copy, decode, draw device contexts are different
    • Enable shader_resource in D3D11 decoder by default to support gpu 0-copy rendering, lower gpu load.
    • limit highest feature level to 12.1 to fix device create error
    • Support global device via SetGlobalOption("d3d11.device", devPtr) for both decoders and renderers, then gpu 0-copy will be enabled without issues found in cross device 0-copy, but performance may be lower than cross device 0-copy(tested 8k 60fps av1 hdr with RTX3050)
  • D3D12: sync between D3D12/MFT:d3d=12 decoder and renderer
  • MFT: shader_resource option default value is 1 for MFT:d3d=11 to support 0-copy rendering
  • VideoFrame can import an existing d3d11 or d3d9 resources
  • Support tvOS
  • VT decoder: enable av1, not tested
  • CUDA decoder: skip av1C header to fix parse error
  • OpenGL: Support GL_EXT_YUV_target, used by android hardware decoder rendering, can be enabled via env var GL_YUV_SAMPLER=1
  • Fix dead lock if output too many frames in 1 decode
  • Fix video size event not triggered for custom readers, e.g. braw and r3d
  • Improve overlay rendering
  • Wayland: support xdg-shell
  • Set subtitle fonts dir and default font file via global option "subtitle.fonts.dir" and "subtitle.fonts.file". Useful for android(lacks of many system fonts). Android subtitle font can be an asset, and then SetGlobalOption("subtitle.fonts.file", "assets://sub_font_path.ttf")
  • Android: add libass.so in sdk, and will be bundled into your app if use FindMDK.cmake. Remove libass.so from sdk if you don't need it
  • Linux: libc++18 compatible

Version 0.24.0

31 Dec 11:44
Compare
Choose a tag to compare
  • OpenGL:
    • GLRenderAPI.getProcAddress now works, can be provided by user. If not provided, will try to use standard GL library names
    • Support hardware decoder rendering in multiple renderers and multiple threads.
  • Vulkan:
    • Support hdr metadata if render context is created in the library via updateNativeSurface
    • Support scRGB swapchain
    • Fix invalid framebuffer after resetting render pass(resize error in qmlrhi example).
  • Ensure swapchain bufferfs are cleared after stop. Previously only clear once, may result in showing blank image and the last frame repeatly.
  • Improve audio/video track switch Player.setActiveTracks(), fast and accurate
  • Improve (mpegts) program switch Player.setActiveTracks(MediaType::Unknown, ), fast and accurate
  • If use updateNativeSurface(), vo_opaque must be the surface parameter.
  • VT: Support mpeg4
  • AMediaCodec/MediaCodec:
    • property "surface" and "window" to enable tunnel mode, the value is Surface jobject and ANativeWindow* value string(Previously "surface" value was ANativeWindow*).
    • Increase image queue size to reduce acquire errors. max images can be set via decoder property "images=N" or player.setProperty("video.decoder", "N"), where N > 1
  • Player.record will choose a suitable format if the format guessed from url does not support all codecs. Select correct format for rtmp and rtsp.
  • Recorded timestamp is continious and monotonicity by default, required by live streaming. Previous behavior can be enabled by Player.setProperty("recorder.copyts", "1")
  • Add MediaEvent{track, "video", "size", {width, height}} to indicate video track size change, MediaInfo.video[track].width/height also change changes
  • Improve decoder change event MediaEvent{track, "decoder.video", decoderName, stream}, decoderName of hardware decoders is the alias name(e.g. VAAPI), software decoder name is always "FFmpeg". Previously hardware decoderName may be FFmpeg
  • Improve packet drop
  • iOS: try to load ass.framework and dav1d.framework instead of .dylib
  • Subtitle: ignore invalid ass images to fix crash
  • Fix crash if audio channels > 8
  • Fix thread safe issues for callback setting apis.
  • Fix scRGB map in DX and apple
  • Fix mpeg4 mosaic after seek
  • Fix cmake3.28 xcframework error
  • FFmpeg:
    • Add D3D12 decoder, alias of FFmpeg:hwcontext=d3d12va
    • D3D12 decoder supports 0-copy rendering in a d3d12 renderer
    • Fix wrong audio time base of filter output
    • Fix a potential crash in hw decoder copy mode
  • New .NET binding and Avalonia example