Giter Site home page Giter Site logo

wang-bin / mdk-examples Goto Github PK

View Code? Open in Web Editor NEW
55.0 7.0 20.0 872 KB

media player examples based on mdk sdk. runs on all platforms. sdk download:

Home Page: https://sourceforge.net/projects/mdk-sdk/files/nightly

License: Apache License 2.0

C++ 67.92% C 0.51% QMake 1.63% Objective-C 0.46% Objective-C++ 6.44% CMake 7.61% QML 0.83% Ruby 0.92% Swift 7.96% Kotlin 0.03% Dart 4.10% C# 1.58%
mediaplayer cpp11

mdk-examples's Introduction

media player examples based on mdk sdk. runs on all platforms. Download the latest sdk

About libmdk sdk: https://github.com/wang-bin/mdk-sdk

Flutter

https://github.com/wang-bin/fvp

GLFW

glfwplay

  • has the most features
  • use glfw context as foreign context mode
  • use glfw window to create render loop and gl/d3d11/metal/vulkan context internally

multiplayers

1 player per window

multiwindows

many windows as render targets sharing the same player

PlayListAsOne

Gapless play/seek multiple videos like a single video

simple

minimal glfw example

macOS

  • use CAOpenGLLayer as foreign context
  • use NSView to create render loop and gl context internally

iOS

Legacy Obj-C OpenGLES2 example

Apple

Native

examples without platform specific code

  • mdkplay: a mininal player with internally created platform dependent window/surface and opengl context, also create render loop and gl context
  • DecodeFps: a tool to test decoder performance. `./DecodeFps [-c:v DecoderName] file"
  • offscreen: offscreen rendering guide

Qt

  • Integrate with QOpenGLWindow and QOpenGLWidget. Use gl context provided by Qt.
  • Render on QOpenGLWindow and QOpenGLWidget via gl context provided by Qt
  • QML example via QOpenGLFrameBuffer
  • RHI example: vulkan, d3d11, metal, opengl

SDL

Use gl context provided by SDL

SFML

  • Use gl context provided by SFML
  • Render to SFML texture

WindowsStore

UWP example, supports D3D11, and ANGLE GLES2

CoreWindowCx

  • use Windows::UI::Core::CoreWindow as platform dependent surface to create render loop and gl context internally
  • use App provided gl context

XamlCx

  • Use Windows::UI::Xaml::Controls::SwapChainPanel as platform dependent surface to create render loop and gl context internally
  • Switch between 2 render targets

Avalonia

use gl to render, (Only test on Windows x64).

mdk-examples's People

Contributors

axojhf avatar pplxlee avatar wang-bin avatar wangwenx190 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mdk-examples's Issues

Getting video dimensions before allocating SFML texture

Would you please add a proper texture size initialization in the following code

if (!texture.create(500, 500)) // or use video size, see ../Native/offscreen.cpp

And maybe explain a bit how this callback works, and if It's blocking or not as I would like to reload movies in the main loop without introducing stuttering to all other screen elements.

The videos I'm reloading have various resolutions. I would like to know how it should be handled. Thanks

Qt RHI Crash when using Vulkan backend on Windows

Qt RHI example crashes on Windows, when requesting Vulkan backend.

Tested with 5.15.7 and 6.2.2

Steps to reproduce:

  1. Download qmlrhi example
  2. For Qt 6.2 set QQuickWindow::setGraphicsApi(QSGRendererInterface::Vulkan);. For Qt 5.15 set qputenv("QSG_RHI", "1"); qputenv("QSG_RHI_BACKEND", "vulkan"); in main.cpp
  3. Start with any video file

It then crashes in

1  mdk::abi::VideoPresenter::setRenderAPI VideoPresenter.cpp      358 0x7fffea7a7bb9 
2  MDK_Player_setRenderAPI                Player.cpp              231 0x7fffea74947e 
3  mdk::Player::setRenderAPI              Player.h                434 0x7ff777cd33ca 
4  VideoTextureNodePub::ensureTexture     VideoTextureNodePub.cpp 217 0x7ff777cd1a0d 
5  VideoTextureNode::sync                 VideoTextureNode.cpp    49  0x7ff777ccfc33 
6  VideoTextureItem::updatePaintNode      VideoTextureItem.cpp    55  0x7ff777cc4be9 

Using latest nightly MDK SDK

QML itself with Vulkan backend works as expected

SFML texture example freezes near the end of the video

Hi, When I play any video using your sfml texture example I get a pause a few frames before end of the video. This happens without loop. With looping enabled it also pauses on frame one. The example video I attached has a freeze at frame 288. I was hoping for a seamless infinite loop, but I cannot find a way of making it not freeze. Would you help me solving this problem please

Rename the counter.mp4.txt to counter.mp4
counter.mp4.txt

Add QML example

It would be very nice if you add a simple example of QML to show the basic usage of MDK. Better to make it a QML element.

qmdkqmlplay QML example flickering on top of Qt 3D scene

qmdkqmlplay QML example based on QQuickFramebufferObject works fine as itself.

But if MDKPlayer is on top of Qt Scene3D, there is no video rendered or it is flickering in more complex application (it looks like something clearing item after renderVideo is called). Any other QML Quick items on top of Qt Scene3D are ok. Audio is working.
Example based on qmdkqmlplay + qt3d-scene3d-example for test:
mdk-example.zip

If renderPolicy: RenderSettings.OnDemand for Scene3D is set (uncomment the line in code) video stops flickering and get rendered right when 3d scene is still. Start rotate the 3d camera and MDKPlayer start flickering due to Scene3D updates.

Same behavior Windows 10, android armv7
Qt 5.9.5, MinGW 5.3.0 32bit, android SDK 25.2.5, NDK 16.1.44794999

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.