unable to build OpenH264.lib for windows
Asked Answered
T

3

8

I followed all the instruction mentioned in https://github.com/cisco/openh264 but I am unable to get through. The information is cited in link but its quite confusing.

Tropopause answered 5/5, 2015 at 6:5 Comment(0)
M
8

Alternative Way:
You can build Openh264 using visual studio in windows. Here are the steps..

  • i) Download OpenH264 source code provided by cisco (that already you mentioned https://github.com/cisco/openh264).
  • ii) Now you will find two visual studio compatible projects in directory /OpenH264/codec/build/win32/dec and /OpenH264/codec/build/win32/enc.
  • iii) You will need to download NASM software from http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/
  • iv) Install NASM software on the directory C:\NASM or wherever you like.
  • v) Then Add NASM executable path to all these visual studio projects. enter image description here
  • vi) Then You can either select static or dynamic library in general options.enter image description here
  • vi) If you are able to perform all these operations successfully, you will have 5 different .lib or .dll files named welsdcore, welsdecplus, welsecore, welsencplus, welsvp and those are usable in any visual studio projects.

Now if you want to get openh264 features, just add all these libraries to your project and enjoy. Hope it will help you.. :)

Mccloskey answered 21/7, 2016 at 4:54 Comment(3)
Since it's a few years later I'd like to report that this solution worked with VS 2019.Throat
RajibTheKing's answer perfectly worked. But I get a warning message that caused me to try a few things before I decided to take the risk. I hope this helps someone else and save their time. - When you try to open the OpenH264 solution in VS2013 or above, you will get a message of an irreversible upgrade. Simply proceed. - follow RajibTheKing`s answer - Build the solution to get the dll files you needDakotadal
for openh264 console encoder one needs to build WelsEncCore, WelsEncPlus, WelsVP libraries and then encConsole, the exe-file is generated at bin\x64\Release\encConsole.exeWeiman
K
1

I also had some difficulty building openh264 on Windows using the recommended mingw approach.

In my case make crashed for all configurations I tried:

bash -c "make OS=msvc  ARCH=x86_64 USE_ASM=No BUILDTYPE=Debug clean"
bash -c "make OS=msvc  ARCH=x86_64 USE_ASM=No BUILDTYPE=Debug"
  0 [main] make 3888 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
564 [main] make 3888 open_stackdumpfile: Dumping stack trace to make.exe.stackdump
  0 [main] make 5448 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
561 [main] make 5448 open_stackdumpfile: Dumping stack trace to make.exe.stackdump
copying dll files to destination folder...
FullDestDir is E:\projects\openh264\bin\x64\Debug
current dir is:
E:\projects\openh264
DestDir is bin/x64/Debug
cp: cannot stat `openh264.dll': No such file or directory
cp: cannot stat `openh264.lib': No such file or directory
cp: cannot stat `openh264.pdb': No such file or directory
cp: cannot stat `codec_unittest.exe': No such file or directory
cp: cannot stat `h264enc.exe': No such file or directory
cp: cannot stat `h264dec.exe': No such file or directory
 BuildDebugFlag   =1
 BuildReleaseFlag =0
 BuildDebugInfo   ="build debug--failed"
 BuildReleaseInfo =NULL
 aBuildFlagList is 1  0
 ReturnCode is 1

I resorted to converting the existing solution/projects (VS2008) to VS2013 and linking/building with the created .lib files.

You can find the solutions in {openh264_dir}\codec\build\win32\enc and {openh264_dir}\codec\build\win32\dec. Building the solution will create .libs and .dlls in {openh264_dir}\bin\Win32\Release

To link to the lib, you need to link to welsenc.lib.

When running, you need to have both the welsenc.dll and welsvp.dll in your application directory. So far it seems to have worked fine for my usage. I'm assuming that building the decoder will be similar.

Kenna answered 14/10, 2015 at 15:38 Comment(0)
J
0

As of now 2024, I would like to report, the given steps in Openh264 official github repo are working, and you can easily compile it for windows by following below:

  1. Get cygwin, and isntall it with latest version of make package
  2. Get latest version of NASM
  3. Install NASM in some directory (say C:/NASM)
  4. Add installation directory path in envrionment variables
  5. Run nasm command in cygwin to make sure path has been set correctly
  6. Go to openh264 source code /build directory
  7. Run installation script with these parameters based on system type:
`AutoBuildForWindows.bat Win32-Release-ASM` for x86 Release build  
`AutoBuildForWindows.bat Win64-Release-ASM` for x86_64 Release build  
`AutoBuildForWindows.bat ARM64-Release-ASM` for arm64 release build
  1. Wait for installation to finish.

Note: If you want Debug build, just replace Release with Debug in installation command

Jaquiss answered 20/4 at 13:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.