个人资料

跳过导航链接首页 > 博客列表 > 博客正文

Win10 uwp使用FFmpeg播放视频[软件开发向]

分类:

首先微软的github地址

https://github.com/microsoft/FFmpegInterop

拿微软的sample稍微改造就可以用了

-------

不过原版的MediaPlayerElement控件本身可以播放的视频种类就挺多的

经过实验

至少可以播放
// mp4 mp3 wmv avi m4v webm mkv 3gp mts vob

另外还有MPEG,会提示补充安装转换码,安装之后也是可以播放的.

只有flv不能播放.
使用FFmpeg之后,flv也成功播放了.

==============

简单方法:使用vcpkg获得ffmpeg

https://github.com/microsoft/FFmpegInterop/issues/136

This is because the scripts haven't been updated for VS2017.

I've been investigating a new package manager that Microsoft is developing and it does make things a lot easier to get started and works great for both VS2015 and VS2017. That's partly why it's taken me longer to get the scripts updated to VS2017.

The project is vcpkg and it already supports a bunch of different projects with both VS2015 and VS2017. They have already added support for FFmpeg and I've issued a pull request to add the UWP version of FFmpeg.

To try it out is quite simple:

  • Clone the repo (for now use my fork until my code is merged upstream)
    git clone https://github.com/khouzam/vcpkg -b ffmpeg-uwp
  • Bootstrap the tool:
    cd vcpkg
    bootstrap-vcpkg.bat
  • Build the flavors of FFmpeg that you need for example if your want x86, x64 and arm (the -uwp will build for store whereas -windows will build for desktop).
    vcpkg install ffmpeg:x86-uwp ffmpeg:x64-uwp ffmpeg:arm-uwp
    Let this run for a while and you will endup with FFmpeg built and available for use (noticed that msys, and all the tools are automatically installed and configured for you.

Now comes the even more interesting part, the integration with VS.

  • From an elevated command prompt run
    vcpkg integrate install
    This configures VS to automatically reference the packages that you have built and have installed. So any project can now reference the FFmpeg headers without having to modify the include path and manually adding references to the dlls. Building a store app will automatically include the required files in the package.

You can see how this has simplified the projects with the vcpkg branch that I just updated.

I would love to hear people's thoughts on this approach, personally I found this to be much easier to setup.

---

错误定位

https://blog.csdn.net/sdsabc2000/article/details/80049622

====



songshizhao
最初发表2019/11/13 1:19:33 最近更新2019/11/27 0:52:12 2173
为此篇作品打分
10
   评论