Giter Site home page Giter Site logo

Comments (6)

 avatar commented on August 11, 2024

CC @niksedk @rossy

from mpv-examples.

niksedk avatar niksedk commented on August 11, 2024

It seems this commit gives the blue screen: 0cfb5ea
To make it work, just add this line again: _mpvSetOptionString(_mpvHandle, GetUtf8Bytes("vo"), GetUtf8Bytes("direct3d"));
(also, sometimes video will not display when debugging with visual studio)

@rossy: Apparently libmpv cannot pick a default "Video Output driver", so what is the correct way of doing this?
It would also be nice to have a dot net OpenGL sample...

from mpv-examples.

rossy avatar rossy commented on August 11, 2024

Sorry for the late response. A common cause for the "blue screen" is a missing d3dcompiler_43.dll. It seems like this DLL is missing from the "Dev" packages on https://mpv.srsfckn.biz/, but it can be found inside the normal 32 and 64-bit builds. Unzipping it alongside mpv-1.dll should fix the problem. If you have Windows 8.1 or 10, you can also copy d3dcompiler_47.dll from your system32 directory and rename it to d3dcompiler_43.dll (the "version" of the DLL doesn't seem to matter.)

Apparently libmpv cannot pick a default "Video Output driver", so what is the correct way of doing this?
It would also be nice to have a dot net OpenGL sample...

I think mpv will fall back to --vo=direct3d if it can't create a suitable OpenGL context. In this case, I guess the problem is that mpv doesn't find out the OpenGL context is bad until it tries to create a shader and finds out that the shader compiler DLL is missing, at which point the OpenGL backend has already been chosen.

from mpv-examples.

niksedk avatar niksedk commented on August 11, 2024

I think we should add this line back again - perhaps with opengl as first choice:
_mpvSetOptionString(_mpvHandle, GetUtf8Bytes("vo"), GetUtf8Bytes("opengl,direct3d"));
See https://mpv.io/manual/stable#video-output-drivers
What do you think @rossy? (I cannot make it work without this line - can you?)
This code has also be really well tested via https://github.com/SubtitleEdit/subtitleedit

Off topic: "OpenGL embedding" with ODS control would be a nice sample - https://github.com/mpv-player/mpv-examples/tree/master/libmpv#user-content-opengl-embedding

from mpv-examples.

FlyingCircus- avatar FlyingCircus- commented on August 11, 2024

Thank for all your replies. As @rossy suggested, the missing d3d3compiler_43.dll file solved my problem. I didn't have any trouble without the "_mpvSetOptionString..." line.
Keep up the good work guys.

from mpv-examples.

rossy avatar rossy commented on August 11, 2024

@FlyingCircus- Nice. Glad it's fixed.

@niksedk Yeah, the OpenGL VO worked for me. Problem is, the Direct3D VO is not really recommended for normal use. It has poor performance and inaccurate rendering, and it should only be used as a last resort. The GL VO, however should work on all hardware that supports D3D feature level 9_3 or PS 3.0 (through ANGLE,) and for unsupported hardware, it should fall back to software rendering through WARP.

Are you getting the blue screen error or something else? Unfortunately this stuff is hard to debug, since the .NET example doesn't have a way to get log output (yet.) Depending on where you got your libmpv-1.dll, you might need to put d3dcompiler_47.dll or d3dcompiler_43.dll alongside it.

Off topic: "OpenGL embedding" with ODS control would be a nice sample - https://github.com/mpv-player/mpv-examples/tree/master/libmpv#user-content-opengl-embedding

+1. Though it might be difficult to integrate libmpv with a managed OpenGL toolkit. It might require a more low-level solution.

from mpv-examples.

Related Issues (20)

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.