microsoft / FFmpegInterop

This is a code sample to make it easier to use FFmpeg in Windows applications.
Apache License 2.0
1.28k stars 308 forks source link

Error 0xc000a200 when running app with FFmpeg #89

Open manschga opened 7 years ago

manschga commented 7 years ago

Hey, I created an app working with the pre-compiled 64 bit Dev FFmpeg version of zeranoe and with these dlls, the app works fine. But if I try to build FFmpeg by myself, using the compilation guide https://trac.ffmpeg.org/wiki/CompilationGuide/WinRT for Win 10 x64 "The application was unable to start correctly (0xc000a200). Click OK to close the application." occurs when I try to run the recompiled app again with the new dlls. Any suggestions? Please give me detailled informations, I am very new to this.

khouzam commented 7 years ago

Hi @manschga

From a quick internet search, this error is caused by having the DLLs built with the AppContainer flag but run in a process that isn't running in an AppContainer. If you build FFmpeg by following the directions for all other versions of Windows, you should get proper DLLs that work with your applications. The instructions on https://trac.ffmpeg.org/wiki/CompilationGuide/WinRT as used to build a version of FFmpeg that can be run on universal apps that can be shipped through the Windows Store.

manschga commented 7 years ago

Thank you for your response, you think I should compile it for example for Windows 10 x86 or Windows 10 ARM? When I am looking through the configuration settings made by the guide, there is always something with "extra-ldflags" and "appcontainer", so I think that won't help or did I understand it wrong? When I skip the "ld-flags-line" in the configuration process completely, I get an error "cl is unable to create an executable file". Hope that wasn't too confusing.

khouzam commented 7 years ago

Hi,

It really depends on what you're trying to build. For an simple Win32 application, you will probably want to look at the instructions here: https://trac.ffmpeg.org/wiki/CompilationGuide/MSVC instead of the WinRT instructions. This is the set of instructions that we based our work on to get the WinRT instructions.

For a desktop application you would want x86 or x64 (for 64-bit). ARM is really only targeting Windows Phone and IOT at the moment and you cannot run desktop applications on those platforms, that's part of the motivation for the FFmpegInterop project, enable people to more easily integrate FFmpeg with our modern platform.

manschga commented 7 years ago

My application should work on a Windows 10 64 bit tablet, so do I need WinRT or is this also possible with the MSVC guide? Is there a possibility to avoid this appcontainer error with other configuration settings or something similar?

khouzam commented 7 years ago

Hi @manschga

Whether to target WinRT or not will depend on your scenario and what tools and frameworks you might be using to develop your application. You should be writing a UWP if:

You might be better suited with a Desktop application if:

This type of information will be helpful in figuring out the best solution for you. Also, if you hit blockers with the UWP platform, we'd love to hear about it so that we can see what could be done to address those issues.

Thanks

manschga commented 7 years ago

Okay, I fear I will need WinRT for the app. As you said, the error must be somewhere at the "App-Container"-issue, leaving out is not possible with the environment variables set above, because cl is then unable to create an executable file. When I leave out the line where I would set the LIB in the VS2015 x86 x64 Cross Tools Command Prompt and try to compile again without the use of the ldflag, I can compile it, the app can start, but when I want to start streaming with HD Webcam (that´s the app intended for) , "No codec provided to avcodec2()" appears and the app stops working. Thanks for you help.

khouzam commented 7 years ago

Hi @manschga,

I would suggest that you build using the MSVC instructions and not the WinRT instructions. Since the binaries that you've already downloaded work, that means that you need to build a Win32 version of the DLLs and not a WinRT one.

manschga commented 7 years ago

Thanks for your help, I managed to start the application now, but I need Dshow there, so I found that I should ./configure --enable-avisynth, but again there is an Error "LoadLibrary/dlopen not found for avisynth" Can you help me once more?