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

upgrade libvpx to 1.2.0 on win32 #440

Closed
totaam opened this issue Oct 14, 2013 · 7 comments
Closed

upgrade libvpx to 1.2.0 on win32 #440

totaam opened this issue Oct 14, 2013 · 7 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Oct 14, 2013

Issue migrated from trac ticket # 440

component: packaging | priority: major | resolution: fixed | keywords: win32

2013-10-14 09:21:50: totaam created the issue


  • The static builds (ie: CentOS) have been updated without too many problems, just removing --enable-onthefly-bitpacking to workaround this build bug.

So we end up with:

./configure --enable-pic --disable-install-docs  --enable-shared \
   --enable-static --enable-vp8 --enable-realtime-only \
   --enable-runtime-cpu-detect
  • on OSX we get this build failure in the tests:
    [LD] test_libvpx
Undefined symbols:
  "_vp8_post_proc_down_and_across_mb_row_c", referenced from:
      _vp8_post_proc_down_and_across_mb_row_c$non_lazy_ptr in pp_filter_test.cc.o
  "_vp8_post_proc_down_and_across_mb_row_sse2", referenced from:
      _vp8_post_proc_down_and_across_mb_row_sse2$non_lazy_ptr in pp_filter_test.cc.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [test_libvpx] Error 1
make: *** [.DEFAULT] Error 2

So we have to add the undocumented --disable-unit_tests:

./configure --libdir=${JHBUILD_PREFIX}/lib --prefix=${JHBUILD_PREFIX} \
    --enable-vp8 --target=x86-darwin8-gcc --disable-install-docs \
    --enable-runtime-cpu-detect --disable-unit_tests --enable-pic

But for win32, the problems are deeper: the build files have been modified and I cannot find the vpxmt and vpxmtd libraries we want to link against. There are no binary downloads either.. Time to fire up Visual Studio :(

@totaam
Copy link
Collaborator Author

totaam commented Oct 18, 2013

2013-10-18 07:41:39: totaam changed owner from antoine to smo

@totaam
Copy link
Collaborator Author

totaam commented Oct 18, 2013

2013-10-18 07:41:39: totaam commented


Here's how we upgrade the win32 build (edit: requires r4548 for better backwards build compatibility):

  • untar libvpx-1.2.0 somewhere
  • create a "build" directory next to it
  • from a mingw32 shell:
cd build
../libvpx-1.2.0/configure --target=x86-win32-vs8 \
    --enable-vp8 --enable-realtime-only --enable-runtime-cpu-detect
make

(make only creates the build files - I couldn't get it to build everything)

  • if not installed already, download yasm for win32 and install it in Visual Studio's VC\bin tool directory (the exe file must be renamed to yasm.exe)
  • fire up Visual Studio 2008 (your mileage may vary with other versions)
  • load the solution which has been created in the build directory: build\vpx.sln
  • change the vpx project's build properties to "Release" (instead of "Debug")
  • rebuild the solution - there should be no errors
  • create the installation directory structure that the xpra build file expects to find:
C:\vpx-1.2
C:\vpx-1.2\include
C:\vpx-1.2\lib
C:\vpx-1.2\lib\Win32
  • copy the static library vpxmd.lib from build\Win32\Release\ to c:\vpx-1.2\lib\Win32
  • copy all the header files (*.h) from libvpx-1.2.0\vpx\ to C:\vpx-1.2\include

Verify that we can build the vpx codec against the new version and that it loads OK (requires r4547 or later):

  • build the win32 installer
  • install xpra
  • run Encoding_info.exe from xpra's installation directory, you should see:
(...)
* vpx            : 1.2.0

Optional steps for building a DLL. For reference only as we do not use the DLL ourselves:

  • In Visual Studio, change the build from "Static Library (.lib)" to "Dynamic Library (.dll)"
  • Build vpx only (or rebuild the solution and ignore other errors?)
  • the resulting DLL can be found in build\Win32\Release\vpx.dll

Please confirm that this all works and close this ticket.

@totaam
Copy link
Collaborator Author

totaam commented Dec 6, 2013

2013-12-06 21:05:16: smo changed status from new to closed

@totaam
Copy link
Collaborator Author

totaam commented Dec 6, 2013

2013-12-06 21:05:16: smo changed resolution from ** to fixed

@totaam
Copy link
Collaborator Author

totaam commented Dec 6, 2013

2013-12-06 21:05:16: smo commented


Followed all the steps and found one error.

When building it looks for the header files in include\vpx so I just had to move them to that directory

Xpra built fine afterwards and ran Encoding_info.exe and got the desired result

Closing ticket

@totaam totaam closed this as completed Dec 6, 2013
@totaam
Copy link
Collaborator Author

totaam commented Jan 16, 2014

2014-01-16 10:47:37: antoine commented


Building libvpx-v1.3.0 is hard on win32 and probably not worth the effort right now. It would have been nice if it had been just a matter of adding --enable-vp9... but no.

I had to fix build issues, which I have documented here and ended up using visual studio to build the DLL (pretty much as per the instruction above, but with the extra patches and somehow ended up having to edit the project files by hand to fix some paths - just horrible)

@totaam
Copy link
Collaborator Author

totaam commented Dec 9, 2014

2014-12-09 22:46:53: antoine commented


I couldn't find it documented anywhere and it is painful to build, so here it is (libvpx 1.3.0 and ffmpeg 2.4.4) from a mingw shell:

  • libvpx:
cd libvpx-v1.3.0
./configure --target=x86-win32-gcc \
    --enable-vp8 --enable-vp9 \
    --enable-realtime-only --enable-runtime-cpu-detect \
    --prefix=/c/mingw
make
make install

See above for the strip and strtok problem (my answer from stackoverflow).

  • ffmpeg 2.4.4:
./configure \
    --enable-swscale --cpu=i686 --enable-runtime-cpudetect \
    --enable-static --enable-shared --enable-gpl --enable-memalign-hack \
    --disable-avdevice --disable-decoders --disable-dxva2 --disable-encoders \
    --enable-decoder=h264 --enable-decoder=vp8 --enable-libvpx \
    --enable-libx264 --disable-devices --disable-muxers --disable-demuxers \
    --disable-postproc --disable-avfilter  --disable-filters --disable-protocols \
    --disable-bsfs --disable-parsers \
    --prefix=/c/ffmpeg-2.4.4-win32-bin
make
make install

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

1 participant