GNU bug report logs - #53591
Audacity can't find FFmpeg

Previous Next

Package: guix;

Reported by: Leo Famulari <leo <at> famulari.name>

Date: Thu, 27 Jan 2022 23:15:02 UTC

Severity: normal

Done: Leo Famulari <leo <at> famulari.name>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 53591 in the body.
You can then email your comments to 53591 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#53591; Package guix. (Thu, 27 Jan 2022 23:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo Famulari <leo <at> famulari.name>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Thu, 27 Jan 2022 23:15:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: bug-guix <at> gnu.org
Cc: liliana.prikler <at> gmail.com
Subject: Audacity can't find FFmpeg
Date: Thu, 27 Jan 2022 18:14:30 -0500
Although Audacity 3.1.3 includes FFmpeg in its direct dependencies, it
does not keep a reference to it and cannot find it at runtime.

This is a regression from Audacity 2.4.2.

------
$ git describe
v1.3.0-15323-gf00ed43653
$ guix gc --references $(./pre-inst-env guix build --no-grafts audacity) | grep ffmpeg
------




Information forwarded to bug-guix <at> gnu.org:
bug#53591; Package guix. (Thu, 27 Jan 2022 23:44:02 GMT) Full text and rfc822 format available.

Message #8 received at 53591 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: 53591 <at> debbugs.gnu.org
Subject: Re: Audacity can't find FFmpeg
Date: Thu, 27 Jan 2022 18:43:02 -0500
On Thu, Jan 27, 2022 at 06:14:30PM -0500, Leo Famulari wrote:
> Although Audacity 3.1.3 includes FFmpeg in its direct dependencies, it
> does not keep a reference to it and cannot find it at runtime.

One consequence is that Audacity can't read Ogg files containing Opus or
Vorbis audio, or any other format delegated to FFmpeg, for example, this
file:

https://dl.espressif.com/dl/audio/ff-16b-2c-44100hz.ogg <-- downloads
with an ".ogx" extension

VLC, on the other hand, plays it fine.

Testing with the previous version of audacity (2.4.2), the .ogx file is
opened using FFmpeg, as shown in the "opening..." progress dialog box.




Information forwarded to bug-guix <at> gnu.org:
bug#53591; Package guix. (Fri, 28 Jan 2022 03:23:01 GMT) Full text and rfc822 format available.

Message #11 received at 53591 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: 53591 <at> debbugs.gnu.org
Subject: Re: Audacity can't find FFmpeg
Date: Thu, 27 Jan 2022 22:21:52 -0500
Between Audacity 2.4.2 and 3.1.3, upstream changed how Audacity finds
FFmpeg. It no longer links to it but instead loads it at runtime:

https://github.com/audacity/audacity/issues/2161

I detailed my hapless attempts to do that in the upstream bug report:

https://github.com/audacity/audacity/issues/2489

Any advice is most welcome!




Information forwarded to bug-guix <at> gnu.org:
bug#53591; Package guix. (Sat, 29 Jan 2022 18:00:02 GMT) Full text and rfc822 format available.

Message #14 received at 53591 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: 53591 <at> debbugs.gnu.org
Cc: Leo Famulari <leo <at> famulari.name>
Subject: [PATCH] gnu: audacity: Add fallback to locate ffmpeg via pkg-config.
Date: Sat, 29 Jan 2022 18:54:54 +0100
* gnu/packages/patches/audacity-ffmpeg-fallback.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it here.
* gnu/packages/audio.scm (audacity)[patches]: Use it here.
[inputs]: Add back ffmpeg.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/audio.scm                        |  2 +
 .../patches/audacity-ffmpeg-fallback.patch    | 61 +++++++++++++++++++
 3 files changed, 64 insertions(+)
 create mode 100644 gnu/packages/patches/audacity-ffmpeg-fallback.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 96e6cb08f4..898e8e92e3 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -859,6 +859,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/ath9k-htc-firmware-gcc-compat.patch	\
   %D%/packages/patches/ath9k-htc-firmware-objcopy.patch		\
   %D%/packages/patches/atlas-gfortran-compat.patch		\
+  %D%/packages/patches/audacity-ffmpeg-fallback.patch	\
   %D%/packages/patches/audiofile-fix-datatypes-in-tests.patch	\
   %D%/packages/patches/audiofile-fix-sign-conversion.patch	\
   %D%/packages/patches/audiofile-CVE-2015-7747.patch		\
diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index feccf662b0..22dd88ef0c 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -738,6 +738,7 @@ (define-public audacity
        (sha256
         (base32
          "189agx11361k9j958s6q5bngnnfx0rwaf0dwbjxy6fwvsb1wv3px"))
+       (patches (search-patches "audacity-ffmpeg-fallback.patch"))
        (modules '((guix build utils)))
        (snippet
         ;; Remove bundled libraries.
@@ -768,6 +769,7 @@ (define-public audacity
            lame
            linux-libre-headers
            flac
+           ffmpeg
            libid3tag
            libjpeg-turbo
            libmad
diff --git a/gnu/packages/patches/audacity-ffmpeg-fallback.patch b/gnu/packages/patches/audacity-ffmpeg-fallback.patch
new file mode 100644
index 0000000000..9e88973241
--- /dev/null
+++ b/gnu/packages/patches/audacity-ffmpeg-fallback.patch
@@ -0,0 +1,61 @@
+From 3c20057d0cbbbed453a692d4dd4589d865808024 Mon Sep 17 00:00:00 2001
+From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
+Date: Sat, 29 Jan 2022 10:44:44 +0100
+Subject: [PATCH] Add pkg-config fallback for locating ffmpeg.
+
+---
+ libraries/lib-ffmpeg-support/CMakeLists.txt      |  8 ++++++++
+ libraries/lib-ffmpeg-support/FFmpegFunctions.cpp | 12 ++++++++++++
+ 2 files changed, 20 insertions(+)
+
+diff --git a/libraries/lib-ffmpeg-support/CMakeLists.txt b/libraries/lib-ffmpeg-support/CMakeLists.txt
+index 8c5f06d7c..00810e4d0 100644
+--- a/libraries/lib-ffmpeg-support/CMakeLists.txt
++++ b/libraries/lib-ffmpeg-support/CMakeLists.txt
+@@ -1,5 +1,7 @@
+ 
+ if (${_OPT}use_ffmpeg)
++   pkg_check_modules(FFMPEG libavcodec libavformat libavutil)
++
+    set( SOURCES
+       FFmpegTypes.h
+ 
+@@ -100,6 +102,12 @@ if (${_OPT}use_ffmpeg)
+       list(APPEND DEFINITIONS PRIVATE _DARWIN_C_SOURCE )
+    endif()
+ 
++   if (FFMPEG_FOUND)
++      pkg_get_variable(LIBAVCODEC_LIBDIR libavcodec libdir)
++      list(APPEND DEFINITIONS PRIVATE
++                  "-DFFMPEG_PC_LIBDIR=L\"${LIBAVCODEC_LIBDIR}\"")
++   endif()
++
+    audacity_library( lib-ffmpeg-support "${SOURCES}" "${LIBRARIES}"
+       "${DEFINITIONS}" ""
+    )
+diff --git a/libraries/lib-ffmpeg-support/FFmpegFunctions.cpp b/libraries/lib-ffmpeg-support/FFmpegFunctions.cpp
+index 66d085a0b..4eeb4aed3 100644
+--- a/libraries/lib-ffmpeg-support/FFmpegFunctions.cpp
++++ b/libraries/lib-ffmpeg-support/FFmpegFunctions.cpp
+@@ -238,6 +238,18 @@ struct FFmpegFunctions::Private final
+       if (library->IsLoaded())
+          return library;
+ 
++#if defined(FFMPEG_PC_LIBDIR)
++      {
++         static const wxString libdir{FFMPEG_PC_LIBDIR};
++         const wxString fullName = wxFileName(libdir, libraryName).GetFullPath();
++
++         auto library = std::make_shared<wxDynamicLibrary>(fullName);
++
++         if (library->IsLoaded())
++            return library;
++      }
++#endif
++
+       // Loading has failed.
+       // wxLogSysError doesn't report errors correctly on *NIX
+ #if defined(_WIN32)
+-- 
+2.34.0
+
-- 
2.34.0





Information forwarded to bug-guix <at> gnu.org:
bug#53591; Package guix. (Sat, 29 Jan 2022 19:54:02 GMT) Full text and rfc822 format available.

Message #17 received at 53591 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: 53591 <at> debbugs.gnu.org
Subject: Re: [PATCH] gnu: audacity: Add fallback to locate ffmpeg via
 pkg-config.
Date: Sat, 29 Jan 2022 14:53:37 -0500
On Sat, Jan 29, 2022 at 06:54:54PM +0100, Liliana Marie Prikler wrote:
> * gnu/packages/patches/audacity-ffmpeg-fallback.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Add it here.
> * gnu/packages/audio.scm (audacity)[patches]: Use it here.
> [inputs]: Add back ffmpeg.

Well, this is fantastic Liliana! It works great.

Can you add a comment to 'audacity-ffmpeg-fallback.patch' with a link to
<https://issues.guix.gnu.org/53591>?




Reply sent to Liliana Marie Prikler <liliana.prikler <at> gmail.com>:
You have taken responsibility. (Sun, 30 Jan 2022 07:19:02 GMT) Full text and rfc822 format available.

Notification sent to Leo Famulari <leo <at> famulari.name>:
bug acknowledged by developer. (Sun, 30 Jan 2022 07:19:02 GMT) Full text and rfc822 format available.

Message #22 received at 53591-done <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Leo Famulari <leo <at> famulari.name>
Cc: 53591-done <at> debbugs.gnu.org
Subject: Re: [PATCH] gnu: audacity: Add fallback to locate ffmpeg via
 pkg-config.
Date: Sun, 30 Jan 2022 08:18:36 +0100
Am Samstag, dem 29.01.2022 um 14:53 -0500 schrieb Leo Famulari:
> On Sat, Jan 29, 2022 at 06:54:54PM +0100, Liliana Marie Prikler
> wrote:
> > * gnu/packages/patches/audacity-ffmpeg-fallback.patch: New file.
> > * gnu/local.mk (dist_patch_DATA): Add it here.
> > * gnu/packages/audio.scm (audacity)[patches]: Use it here.
> > [inputs]: Add back ffmpeg.
> 
> Well, this is fantastic Liliana! It works great.
> 
> Can you add a comment to 'audacity-ffmpeg-fallback.patch' with a link
> to <https://issues.guix.gnu.org/53591>?
Done and pushed.




Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 04 Feb 2022 22:28:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#53591; Package guix. (Fri, 04 Feb 2022 22:33:01 GMT) Full text and rfc822 format available.

Message #27 received at 53591 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: 53591 <at> debbugs.gnu.org
Cc: liliana.prikler <at> gmail.com
Subject: Re: bug#53591: closed (Re: [PATCH] gnu: audacity: Add fallback to
 locate ffmpeg via pkg-config.)
Date: Fri, 4 Feb 2022 17:32:30 -0500
On Sun, Jan 30, 2022 at 07:19:02AM +0000, GNU bug Tracking System wrote:
> From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
> Am Samstag, dem 29.01.2022 um 14:53 -0500 schrieb Leo Famulari:
> > Well, this is fantastic Liliana! It works great.
> > 
> > Can you add a comment to 'audacity-ffmpeg-fallback.patch' with a link
> > to <https://issues.guix.gnu.org/53591>?
> Done and pushed.

I'm not sure what happened, but it seems I failed to test this fix
properly.

Audacity still does not keep a reference to FFmpeg, and it cannot
Opus-encoded files (among many other types of encodings):

------
$ git describe
v1.3.0-15695-gba60aede97
$ $(./pre-inst-env guix build --no-grafts audacity) | grep ffmpeg 
$
------

This is the file to test with:

https://dl.espressif.com/dl/audio/ff-16b-2c-44100hz.opus

I've reopened this bug.




Reply sent to Leo Famulari <leo <at> famulari.name>:
You have taken responsibility. (Fri, 04 Feb 2022 23:51:01 GMT) Full text and rfc822 format available.

Notification sent to Leo Famulari <leo <at> famulari.name>:
bug acknowledged by developer. (Fri, 04 Feb 2022 23:51:01 GMT) Full text and rfc822 format available.

Message #32 received at 53591-done <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: 53591-done <at> debbugs.gnu.org
Cc: liliana.prikler <at> gmail.com
Subject: Re: bug#53591: closed (Re: [PATCH] gnu: audacity: Add fallback to
 locate ffmpeg via pkg-config.)
Date: Fri, 4 Feb 2022 18:49:58 -0500
On Fri, Feb 04, 2022 at 05:32:30PM -0500, Leo Famulari wrote:
> Audacity still does not keep a reference to FFmpeg, and it cannot
> Opus-encoded files (among many other types of encodings):

On #guix, lilyp found the culprit:

http://logs.guix.gnu.org/guix/2022-02-04.log#235737

... an extra "L" character in the patch file:

https://issues.guix.gnu.org/53591#3-lineno78

Fixed with commit 04cd0ece6219fef2f18ee62442a913a02495fb50




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 05 Mar 2022 12:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 103 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.