xpra icon
Bug tracker and wiki

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#253 closed task (fixed)

upgrade libav for win32

Reported by: Antoine Martin Owned by: ahuillet
Priority: major Milestone: 0.9
Component: platforms Version: trunk
Keywords: Cc:

Description

Now that we support the latest libav and include it in the static builds for CentOS / old distros, it would be nice to upgrade the win32 builds to something recent and supported (my win32 build machine is at 2012-07-08 git-299387e). Especially since trunk does not build without the old-libav.patch.

Unfortunately:

  • the http://win32.libav.org/win32/ libraries build OK and without as much as a single warning (since r2692 for a warning and r2694 to fix some paths) and without the old-libav patch which is nice, but give a DLL error at runtime about some missing functions (not telling us which one - how helpful! grrr crappy win32 dev platform)
    cannot load vpx codec: DLL load failed: The specified procedure could not be found.
    cannot load x264 codec: DLL load failed: The specified procedure could not be found.
    
  • the http://ffmpeg.zeranoe.com/builds/win32/shared/ libraries (ie: version 1.1.1) require the old-libav patch and fail at runtime with the same DLL message..

Even better would be to build this ourselves so we can get rid of 90% of the compile flags for libav (as per #103).

Change History (10)

comment:1 Changed 8 years ago by Antoine Martin

See also #168 and #159

Last edited 8 years ago by Antoine Martin (previous) (diff)

comment:2 Changed 8 years ago by ahuillet

Building following instructions in #168 with latest git ffmpeg (as of this writing) seems to produce DLLs correctly. Attaching produced binaries so that you can test (I haven't set up a windows build env yet).

comment:3 Changed 8 years ago by ahuillet

http://serv.agoctrl.org/~arthur/up/ffmpeg_for_xpra_2013-02-16.tar.bz2

Includes .a files which must be usable for a static build, which is what we're trying to achieve. libavcodec is still huge - I'll trim the unneeded decoders once we confirm that the build works.

comment:4 Changed 8 years ago by Antoine Martin

I was hoping you could try the 2 options above (and now possibly the third one you've posted here in comment:3) to see if the resulting codec shared object does load properly or not.

Producing libav/ffmpeg DLLs is not the immediate problem (though if we could use the minimal build instructions from #103, then we can also save space - which is a bonus).

I would really like to understand why the ones I built would not load, preferably with instructions on how to figure this out in case it occurs again in the future.

comment:5 Changed 8 years ago by ahuillet

depends.exe is going to help a lot, I believe.

As I explained on IRC I do think it's better to produce static builds.

Last edited 8 years ago by ahuillet (previous) (diff)

comment:6 Changed 8 years ago by ahuillet

According to depends.exe's output, codec.pyd tries to import Python-related symbols from all the libav's libs in addition to python27.dll, and it doesn't actually try to import the libav-related functions at all.

The description of the problem matches that at http://ffmpeg.zeranoe.com/forum/viewtopic.php?f=5&t=796&start=10 and http://forum.videolan.org/viewtopic.php?f=32&t=98097

I've manually verified that adding /OPT:NOREF on the linker commandline generates a codec.pyd that looks fine in depends.exe.

comment:7 Changed 8 years ago by Antoine Martin

Excellent! Based on this, here is the suggested patch:

--- src/setup.py	(revision 2734)
+++ src/setup.py	(working copy)
@@ -430,6 +430,7 @@
             add_to_keywords(kw, 'libraries', "swscale", "avcodec", "avutil")
             add_to_keywords(kw, 'extra_link_args', "/LIBPATH:%s" % ffmpeg_lib_dir)
             add_to_keywords(kw, 'extra_link_args', "/LIBPATH:%s" % ffmpeg_bin_dir)
+            add_to_keywords(kw, 'extra_link_args', "/OPT:NOREF")
         elif "vpx" in packages[0]:
             add_to_PATH(ffmpeg_bin_dir)
             add_to_keywords(kw, 'include_dirs', "win32", vpx_include_dir, ffmpeg_include_dir)
@@ -438,6 +439,7 @@
             add_to_keywords(kw, 'extra_link_args', "/LIBPATH:%s" % vpx_lib_dir)
             add_to_keywords(kw, 'extra_link_args', "/LIBPATH:%s" % ffmpeg_lib_dir)
             add_to_keywords(kw, 'extra_link_args', "/LIBPATH:%s" % ffmpeg_bin_dir)
+            add_to_keywords(kw, 'extra_link_args', "/OPT:NOREF")
         elif "pygobject-2.0" in packages[0]:
             add_to_keywords(kw, 'include_dirs', python_include_PATH,
                             pygtk_include_dir, atk_include_dir, gtk2_include_dir,

comment:8 Changed 8 years ago by ahuillet

Yes, this is the exact patch I independantly tried, and I confirm that it works.

Bug: SQUISHED.

comment:9 Changed 8 years ago by ahuillet

Resolution: fixed
Status: newclosed

comment:10 Changed 8 years ago by Antoine Martin

related: #270 (minimal libav win32 build)

Note: See TracTickets for help on using tickets.