Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to compile for WinRt and/or DLL versions #30

Closed
mediabuff opened this issue Oct 4, 2017 · 27 comments
Closed

How to compile for WinRt and/or DLL versions #30

mediabuff opened this issue Oct 4, 2017 · 27 comments

Comments

@mediabuff
Copy link

What is an easy way to do this ?

@Sibras
Copy link
Member

Sibras commented Oct 4, 2017

Well Dll's can be be created by selecting the DebugDll or ReleaseDLL configurations. However WinRT specific builds are not currently supported as many of the dependency libraries don't currently have WinRT support.

@mediabuff
Copy link
Author

Thanks for the info. But how does this work ? https://github.com/Microsoft/FFmpegInterop

@Sibras
Copy link
Member

Sibras commented Oct 6, 2017

That works because it does not build FFmpeg with any of the dependencies. The build projects in this repo add additional features by using many dependency projects. As stated previously several off these projects don't have WinRT support so a FFmpeg using them cant have WinRT support until all the used dependencies are updated.
WinRT is support is planned but may take some time as all dependency libraries need to be tested and updated as required.

@mediabuff
Copy link
Author

thanks

@mediabuff mediabuff reopened this May 5, 2018
@mediabuff
Copy link
Author

I would like a further clarification.

That works because it does not build FFmpeg with any of the dependencies.
So how they integrate with these libraries ? does it not use APIs from these dependencies ?

@Sibras
Copy link
Member

Sibras commented May 5, 2018

Yes they disable all dependencies and therefore loose any features provided by those dependencies. So for instance no x264/265/mp3lame encoders etc.

Currently the builds provided here use the following dependencies: bzip2, fontconfig, freetype2, fribidi, game-music-emu, gmp, gnutls, lame, libass, libbluray, libcdio, libcdio-paranoia, libiconv, libilbc, liblzma, libssh, libxml2, libvpx, mfx_dispatch, modplug, opus, sdl, soxr, speex, theora, vorbis, x264, x265, xvid, zlib

I am working on adding WinRT support and have modified many of the dependency projects to compile under winrt but there are still a couple of dependencies that I use that need notable code changes to get them to compile with winrt which is blocking it for the time being.

@mediabuff
Copy link
Author

thanks for background - update on WinRT.

@mediabuff mediabuff reopened this Jun 11, 2018
@mediabuff
Copy link
Author

Any update ? Which libs are causing problems for WinRT ? can I help with the port ?

@Sibras
Copy link
Member

Sibras commented Jun 12, 2018

The current list of projects with completed WinRT porting is:

  • bzip2
  • zlib
  • iconv
  • lzma
  • libxml2
  • fdk
  • modplug (is rather broken under WinRT, Im looking at replacing it with openmpt)
  • lame
  • ogg
  • opus
  • soxr
  • speex
  • vorbis
  • libilbc
  • libgme
  • libvpx
  • theora
  • x264
  • x265
  • xvid
  • freetype
  • fontconfig
  • fribidi
  • harfbuzz
  • libgpgerror
  • libgcrypt
  • libssh
  • gmp
  • nettle
  • gnutls
  • libass
  • libbluray ???
  • libdvdread
  • libdvdnav
  • libcdio
  • libcdioparanoia
  • sdl

@mediabuff
Copy link
Author

Thank you Great. Should you have an initial release without libs for DVD, CD etc. - which are the tricky ones for WinRT.

@ispysoftware
Copy link

Adding an x64 release build for UWP with the available libraries would be epic.

@Sibras
Copy link
Member

Sibras commented Jan 2, 2019

Still working on it. I just have limited time as this is a personal side project (gotta pay the bills first).

The current blockers are gnutls, libbluray, mfx and openmpt. The kodi project has example code for libbluray UWP (also libdvdread, libdvdnav, libdvdcss etc.) in there repo but it disables bdj entirely. A better solution would be to integrate openjdk but that requires alot of work.

@ispysoftware
Copy link

ispysoftware commented Jan 2, 2019

Personally I have no use for the missing stuff, I just want to be able to encode to vp8/ogg. h264/aac and mp3 would be an added bonus. I've spent a few days trying to get it to build without much success.

@mediabuff
Copy link
Author

mediabuff commented Apr 19, 2019

how do build the work in progress for UWP ?

@Sibras
Copy link
Member

Sibras commented Apr 20, 2019

I just pushed an updated FFVSProjectGenerator that can create winrt/uwp configurations.

So if you want to test the winrt support then you need the latest FFVSProjectGenerator from git master. Then pass it the configuration options that you want (making sure they are for dependencies that are supported for winrt) and then make sure to also pass "--enable-winrt". That will generate a new VS project that has configurations for winrt builds.

@mediabuff
Copy link
Author

Thank you, greate Would you be able add this to your pre-build executables?

@mediabuff
Copy link
Author

For the prebuilt, what is the configuration set ? I will mirror that( minus not-supported deps) for uwp

@Sibras
Copy link
Member

Sibras commented Apr 24, 2019

the configure command line used is found in SMP/config.h under FFMPEG_CONFIGURATION

@mediabuff
Copy link
Author

After much agony I got this going - had to individually copy the dependent includes files to msvc/include. I am not sure why. But I did. So, project_generate aborts at the following, any clues ? Attached screen shot
image

@mediabuff
Copy link
Author

Ok, traced it to following:

../msvc/include/windows-config.h(139): error C2371: 'uintptr_t': redefinition; different basic types (compiling source file ffmpeg/libavformat/tls_gnutls.c)

I had copied windows-config.h from ..\source\gnutls\src\libopts\compat\windows-config.h to msvc\include.

Is this correct ?

@Sibras
Copy link
Member

Sibras commented Dec 30, 2019

You shouldn't need to manually copy any include files. The supplied vcxprojs files for each dependency automatically copies the required includes when they are built. So for instance the gnutls project already has a winrt configuration that will copy the required includes when it is built.

@mediabuff
Copy link
Author

thank you. Will save my future efforts. The problem i ran into was I could'nt get the dependent projects vcxprojs generated. I am attempting winrt compile. I was able to get the project generate generate the core. But not the dependency.

  1. how to get project generator do this ?
  2. I assume i run the project generator for the core after I build the dep projects ? (which is after the project gen for dependents)

@Sibras
Copy link
Member

Sibras commented Dec 30, 2019

No, you only need to generate new projects for ffmpeg. All the dependency projects are already created in their corresponding repos and have already got project configurations for WinRT builds in them. Just open the projects in each dependencies SMP folder and youll see that they have WinRT configurations available

@mediabuff
Copy link
Author

Fantastic! Yes, I discovered after I posted. Any reason why the ‘core’ is not winrt enabled? At least from compilation standpoint. Also, found we don’t have winrt configurations for some dependent projects. Also the configuration names are bit confusing - releasedllstaticdeps - for dep projects ???

@Sibras
Copy link
Member

Sibras commented Dec 31, 2019

The winRT builds are only for WinRT/UWP apps. The core builds are not winrt because the winrt builds dont have all the features enabled in some cases due to winrt limitations. And the winrt builds only work on modern OSs in app form where as the default configs work on multiple different OSs.

Not all dependencies have been updated to WinRT yet. See the list further up this page for the ones that are still pending.

@mediabuff
Copy link
Author

mediabuff commented Jan 11, 2020

sibras, please see my travails. ffmpeginteropx/FFmpegInteropX#153 (comment)

Also, I get the following in win32 desktop app, using
https://github.com/ShiftMediaProject/FFmpeg/releases/tag/4.3.r96057.

[mpeg2video @ 0465BDC0] Invalid setup for format d3d11: missing configuration.
[mpeg2video @ 0465BDC0] decoding to AV_PIX_FMT_NONE is not supported.
[mpeg2video @ 0465BDC0] mpeg_decode_postinit() failure

@Sibras
Copy link
Member

Sibras commented Apr 2, 2022

FFmpeg has now had WinRT builds for several releases now, closing this.

@Sibras Sibras closed this as completed Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants