Audacity Bug Summary
••• Introduction •••
••• Keywords •••
    Audacity 3.0.3 development began 19th April 2021

Audacity Bugzilla



Bug 540 - Linux: Audacity does not build against FFmpeg SVN
Linux: Audacity does not build against FFmpeg SVN
Status: CLOSED NOT-A-BUG
Product: Audacity
Classification: Unclassified
Component: Formats
2.0.1
Other Linux
: P3 Repeatable
Assigned To: Default Assignee for New Bugs
http://audacity.238276.n2.nabble.com/...
: FFmpeg
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-30 01:23 UTC by Gale Andrews
Modified: 2019-06-14 10:18 UTC (History)
4 users (show)

See Also:
Steps To Reproduce:
* Dynamic loading (as in default ./configure) requires building against the FFmpeg project - it will not build against the libav project. * Compiling Audacity against self-compiled FFmpeg 2.2.2 on Ubuntu 13.10 with --disable-dynamic-loading the only argument (i.e. build with FFMPEG=system) fails with: audacity-FFmpeg.o: In function `import_ffmpeg_decode_frame(_streamContext*, bool)': /home/gale/audacity/src/FFmpeg.cpp:364: undefined reference to `av_frame_alloc' /home/gale/audacity/src/FFmpeg.cpp:414: undefined reference to `av_frame_free' export/audacity-ExportFFmpeg.o: In function `encode_audio': /home/gale/audacity/src/export/ExportFFmpeg.cpp:520: undefined reference to `av_frame_alloc' /home/gale/audacity/src/export/ExportFFmpeg.cpp:592: undefined reference to `av_frame_free' export/audacity-ExportFFmpegDialogs.o: In function `ExportFFmpegOptions::FetchCodecList()': /home/gale/audacity/src/export/ExportFFmpegDialogs.cpp:1281: undefined reference to `av_codec_is_encoder' export/audacity-ExportFFmpegDialogs.o: In function `ExportFFmpegOptions::FetchCompatibleCodecList(wchar_t const*, AVCodecID)': /home/gale/audacity/src/export/ExportFFmpegDialogs.cpp:1525: undefined reference to `av_codec_is_encoder' /home/gale/audacity/src/export/ExportFFmpegDialogs.cpp:1540: undefined reference to `av_codec_is_encoder' /home/gale/audacity/src/export/ExportFFmpegDialogs.cpp:1560: undefined reference to `av_codec_is_encoder' collect2: error: ld returned 1 exit status Configuring with --disable-dynamic-loading and --with-lib-preference="local" (i.e. with FFMPEG=local) does build.
Release Note:
GROUP:Compiling *(Linux) Audacity may not always compile against supported versions of libav or FFmpeg. Audacity 2.0.6 and later supports FFmpeg 1.2 to 2.3.x (or libav 0.8 to 0.10.x). ** Dynamic loading (as in default Audacity ./configure) requires building against the FFmpeg project - it will not build against the libav* headers from the libav project. '''Workarounds:''' Configure Audacity with --disable-dynamic-loading. If dynamic loading is required, build against FFmpeg instead of libav, or you can build against libav if you remove the "#define IS_FFMPEG_PROJECT 1" line in src/FFmpeg.h. ** Audacity may still build against no-longer-supported FFmpeg versions (such as FFmpeg 0.8 which is system-installed on Debian Wheezy), but configuring with --disable-dynamic-loading will be necessary. FFmpeg 0.8 has at least one known issue in Audacity 2.0.6 or later: mono WMA files export with no audio data. This issue will not be fixed given FFmpeg 0.8 is no longer supported by Audacity 2.0.6. ** Building against self-compiled FFmpeg 2.2.2 with --disable-dynamic-loading the only argument fails on Ubuntu 13.10 with "undefined reference to 'av_codec_is_encoder'". '''Workaround:''' Configuring with --disable-dynamic-loading and --with-lib-preference="local" (or at least --with-ffmpeg="local") may build successfully, but may not disable Libraries Preferences. The best solution may be not to disable dynamic loading.
First Git SHA:
Group: FFmpeg
Workaround:
Closed: 2019-06-14 00:00:00


Attachments
make error compiling with FFmpeg 11 and FFmpeg SVN (10.68 KB, text/plain)
2012-06-30 01:23 UTC, Gale Andrews
Details
make log Ubuntu 13.10 with --disable-dynamic-loading (663.49 KB, text/plain)
2014-06-14 04:57 UTC, Gale Andrews
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gale Andrews 2012-06-30 01:23:22 UTC
Created attachment 276 [details]
make error compiling with FFmpeg 11 and FFmpeg SVN
Comment 1 Richard Ash 2012-06-30 05:19:27 UTC
We should put a check into configure that disables FFmpeg if the available version is too new, or rather if it doesn't have the symbols we need available. Could be a bit of a pain to write and maintain however.
Comment 2 Gale Andrews 2014-06-09 01:28:00 UTC
Fixes have recently been committed to support libav 0.8 to 0.10 and FFmpeg 1.2 to 2.2. There are still known issues, see Steps to Reproduce.
Comment 3 Gale Andrews 2014-06-14 04:57:02 UTC
Created attachment 492 [details]
make log Ubuntu 13.10 with --disable-dynamic-loading

(In reply to comment #2)
@Benjamin, Audacity compiles for me at r13196 against self-compiled FFmpeg 2.2.2 on Ubuntu 14.04 with --disable-dynamic-loading. --disable-dynamic-loading still fails to compile on Ubuntu 13.10 against self-compiled FFmpeg 2.2.2 (even on fresh Audacity checkout). I attach the make log, but it shows similar "undefined reference to `av_codec_is_encoder'" errors as before.  

However there is a problem running my self-compiled FFmpeg standalone at the command-line on 13.10 (I can use FFmpeg in Audacity GUI if I perform default ./configure of Audacity). Running ffmpeg shows this terminal error:

relocation error: /usr/local/lib/libavfilter.so.4: symbol sws_isSupportedEndiannessConversion, version LIBSWSCALE_2 not defined in file libswcale.so.2 with link time preference.

Please advise if you think this error is causing Audacity not to compile with --disable-dynamic-loading.
Comment 4 Gale Andrews 2014-08-22 01:20:48 UTC
(In reply to comment #3)
Gale wrote:
>  --disable-dynamic-loading still fails to compile on Ubuntu 13.10 against 
> self-compiled FFmpeg 2.2.2 (even on fresh Audacity checkout). 
That is, it fails with --disable-dynamic-loading the only argument, so using FFMPEG="system".   

Configuring with --disable-dynamic-loading and --with-lib-preference="local" (i.e. with "FFMPEG=local") does build, but the Libraries Preferences are not disabled.
Comment 5 Benjamin Drung 2014-08-25 19:26:11 UTC
The relevant part of the build log is:

audacity-FFmpeg.o: In function `import_ffmpeg_decode_frame(_streamContext*, bool)':
/home/gale/audacity/src/FFmpeg.cpp:364: undefined reference to `av_frame_alloc'
/home/gale/audacity/src/FFmpeg.cpp:414: undefined reference to `av_frame_free'
export/audacity-ExportFFmpeg.o: In function `encode_audio':
/home/gale/audacity/src/export/ExportFFmpeg.cpp:520: undefined reference to `av_frame_alloc'
/home/gale/audacity/src/export/ExportFFmpeg.cpp:592: undefined reference to `av_frame_free'
export/audacity-ExportFFmpegDialogs.o: In function `ExportFFmpegOptions::FetchCodecList()':
/home/gale/audacity/src/export/ExportFFmpegDialogs.cpp:1281: undefined reference to `av_codec_is_encoder'

I failed to reproduce the build failure. My guess is that the header files used mismatch with the avcodec library that should be linked against. What FFmpeg libraries do you have installed and where? Can you run these commands to shed some light on it?

find /usr/ -name avcodec.h
find /usr/ /lib -name 'libavcodec*.so*'
grep -H av_codec_is_encoder $(find /usr/ -name avcodec.h)
Comment 6 Gale Andrews 2014-08-28 01:07:52 UTC
(In reply to comment #5)
> What FFmpeg libraries do you have installed and where? 
2.2.2 installed in /usr/local/lib.

> Can you run these commands to shed some light on it?
> find /usr/ -name avcodec.h

/usr/include/libavcodec/avcodec.h
/usr/local/include/libavfilter/avcodec.h
/usr/local/include/libavcodec/avcodec.h


> find /usr/ /lib -name 'libavcodec*.so*'

/usr/lib/vlc/plugins/codec/libavcodec_plugin.so
/usr/lib/i386-linux-gnu/libavcodec.so
/usr/lib/i386-linux-gnu/libavcodec.so.53
/usr/lib/i386-linux-gnu/libavcodec.so.53.35.0
/usr/lib/i386-linux-gnu/i686/cmov/libavcodec.so
/usr/lib/i386-linux-gnu/i686/cmov/libavcodec.so.53
/usr/lib/i386-linux-gnu/i686/cmov/libavcodec.so.53.35.0
/usr/local/lib/libavcodec.so
/usr/local/lib/libavcodec.so.55
/usr/local/lib/libavcodec.so.55.52.102

> grep -H av_codec_is_encoder $(find /usr/ -name avcodec.h)

/usr/local/include/libavcodec/avcodec.h:int av_codec_is_encoder(const AVCodec *codec);


Thanks!
Comment 7 Benjamin Drung 2015-10-16 17:56:01 UTC
Gale, do you still have an issue?
Comment 8 Gale Andrews 2015-10-16 20:30:57 UTC
(In reply to Benjamin Drung from comment #7)
Don't know at the moment, Benjamin, I am on Ubuntu 14.04 now on the 32-bit machine, and I don't have a problem with compiling Audacity against self-built FFmpeg 2.2.2 installed into /usr/local and using dynamic loading (i.e. default Audacity ./configure).

It will be a while before I can test with dynamic loading disabled.
Comment 9 Peter Sampson 2019-06-14 10:13:10 UTC
Steve wrote in email to me as we discussed this:

>It's been a long time since I attempted to build against the libav project, 
>but I've never managed to get this to work, even when carefully following 
>our documentation and using the versions stated.
>
>I have always disagreed with Gale's assertion that users should manually build
>and install an obsolete version of FFmpeg in order to use FFmpeg with Audacity.
>If Audacity is to remain a mainstream application on Linux, it must work 
>against system library versions that are commonly found in current versions of
>Linux. For common libraries, distribution maintainers will attempt to build 
>Audacity against system libraries. If Audacity does not work when built that 
>way, it will be dropped from their repository, and Audacity will no longer be 
>a mainstream application for Linux, and would essentially become 
>Windows / Mac only.
>
>Currently, Audacity builds against the system version of FFmpeg on Ubuntu 16.04.
>The last time I checked, it also worked with Ubuntu 18.04, so both of the 
>current "LTS" versions of Ubuntu appear to be covered for now.

I agree with Steve's assertion:  
>I have always disagreed with Gale's assertion that users should manually build
>and install an obsolete version of FFmpeg in order to use FFmpeg with Audacity.

Accordingly I shall close this as not a bug
Comment 10 James Crook 2019-06-14 10:18:51 UTC
Why do we keep FFmpeg in the lib-src build tree if this is not-a-bug?