microsoft / FFmpegInterop

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

Is it possible to build ffmpeg with SSL support on Windows Subsystem for Linux (WSL) #138

Open asElhadidy opened 7 years ago

asElhadidy commented 7 years ago

Is it possible to build ffmpeg with SSL support (--enable-openssl) on WSL?

I have tried to install openssl using these commands

sudo apt-get install openssl sudo apt-get install libssl-dev

Modified configure to include --enable-openssl option, but it always gives the error "Error: openssl not found"

Is it possible or I need to build openssl on windows system?

khouzam commented 7 years ago

Hi @asElhadidy,

Funny you should ask. I just did this last night. I'm gathering the steps and will be posting documentation about how to do this.

Unfortunately, getting the Linux openssl implementation doesn't work, you need a windows version of openssl. You can start with our fork for UWP at https://github.com/microsoft/openssl to get the openssl binaries.

I'll gather up the proper patches and push them on a branch shortly.

asElhadidy commented 7 years ago

Hi khouzam,

Great, this will be a very good addition to your excellent work on WSL. I'll try to compile openssl on windows as your suggestion. Hopefully, I can get it to work. If not will definitely wait for your patches :)

I'm not an expert on Linux systems but I thought it is possible to cross compile the full ffmpeg stack (and its external libraries) on Linux, is this technically possible or I have misunderstood something?

ryanwinter commented 7 years ago

Does the current build of ffmpeg interop include ssl support?

asElhadidy commented 7 years ago

Hi ryanwinter ,

No it doesn't include ssl support. Hopefully it will be added shortly.

khouzam commented 7 years ago

I've added a preliminary support for building FFmpeg with OpenSSL through vcpkg a new Microsoft C++ package manager. This is still experimental, but seems to work really well. Please see my last post for issue #136 which talks about it.

If you checkout branch ffmpeg-openssl instead of ffmpeg-uwp, then openssl support will be included in the build of FFmpeg and you'll be able to playback streams over https.

Please try it out and provide feedback.

billvenhaus commented 7 years ago

Hey @khouzam ,

What you wrote in #136 for vcpkg works well for me with ffmpeg-uwp but when doing the build for ffmpeg-openssl I get an error:

fatal error C1107: could not find assembly 'windows.foundation.foundationcontract.winmd': please specify the assembly search path using /AI or by setting the LIBPATH environment variable

This was on a machine with VS 2015 & Windows 10 SDK 10.0.14393.0.

Any chance you know why it's unable to find the file?

Here's my log files: make-openssl-x86-uwp-err.log.txt make-openssl-x86-uwp-out.log.txt

Thanks, Bill

khouzam commented 7 years ago

Hi @bvenhaus .

Can you show the contents of the C:\Program Files (x86)\Windows Kits\10\References\Windows.Foundation.UniversalApiContract folder?

We might have missed a reference version.

billvenhaus commented 7 years ago

Sure. It's got just the one "3.0.0.0" folder

image

billvenhaus commented 7 years ago

Hi @khouzam ,

Is there any chance you can upload or send me the compiled packages from your "ffmpeg-openssl" branch? Today, I installed a fresh copy of Windows 10 with VS 2015 & I'm still seeing the same issue. I am however able to build OpenSSL independently. I'd really like to integrate this into my Home Remote app.

Thanks, Bill

ras0219-msft commented 7 years ago

@bvenhaus I've pushed a branch (ffmpeg-openssl-contract-fix) to the main vcpkg repo that should fix this issue. If it does, @khouzam can pull it back into his branch.

Would you mind trying this out?

git checkout -b ffmpeg-openssl-contract-fix ffmpeg-openssl
git pull https://github.com/Microsoft/vcpkg ffmpeg-openssl-contract-fix
khouzam commented 7 years ago

Thanks @ras0219-msft, I've updated the ffmpeg-openssl branch.

@bvenhaus, can you try it now? I'll build a nuget package but that this will not be an official Microsoft endorsed one.

billvenhaus commented 7 years ago

Thanks guys, still getting the same error though.

@ras0219-msft here's the logs from your branch.

make-openssl-x86-uwp-err.log.txt make-openssl-x86-uwp-out.log.txt

@khouzam here's the logs from your updated branch

make-openssl-x86-uwp-err.log.txt make-openssl-x86-uwp-out.log.txt

Thanks @khouzam That'd be great! I don't mind if it's not an official Microsoft package.

khouzam commented 7 years ago

Ok, here's my personal nuget package link: FFmpeg-OpenSSL nuget.

It contains both the Desktop and UWP versions for x86, x64 and ARM.

With a project open, go to Tools->NuGet Package Manager->Package Manager Console and paste: Install-Package vcpkg-export-20170630-133459 -Source "<download path>"

billvenhaus commented 7 years ago

Thanks!

HppZ commented 3 years ago

Hi @asElhadidy,

Funny you should ask. I just did this last night. I'm gathering the steps and will be posting documentation about how to do this.

Unfortunately, getting the Linux openssl implementation doesn't work, you need a windows version of openssl. You can start with our fork for UWP at https://github.com/microsoft/openssl to get the openssl binaries.

I'll gather up the proper patches and push them on a branch shortly.

PLEASE, I need your documentation about how to build ffmpeg with openssl support.