fdkaacdec doesn't support mpegversion 2
Originally reported at https://gitlab.com/goodvibes/goodvibes/issues/107: Goodvibes (a GStreamer-based internet radio player) can't play http://ice2.somafm.com/indiepop-128-aac while running in Flatpak, while it works when running from a Debian package.
Followed-up at https://gitlab.com/freedesktop-sdk/freedesktop-sdk/issues/958. It turns out that the org.freedesktop.Platform//19.08
Flatpak runtime builds ffmpeg with the fdk-aac-free
codec. This is not the default AAC codec in ffmpeg, and additionally they strip out the patented bits.
The comment from Michael Catanzaro sums it all: [...] whether it's GStreamer's fault or fdkaac's, or a problem with the way freedesktop-sdk strips the patented bits out of fdkaac (shared with Fedora and Endless).
.
More investigation, and it seems that the caps of the fdkaacdec
Gstreamer element are the issue. They differ from the caps of avdec_aac
for the mpegversion
:
# Running in the freedesktop runtime
$ gst-inspect-1.0 fdkaacdec | grep mpegver
mpegversion: 4
# Running on Debian Buster
$ gst-inspect-1.0 avdec_aac | grep mpegversion
mpegversion: { (int)2, (int)4 }
The stream I'm trying to play is mpegversion 2.
WARNING: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0:
No decoder available for type 'audio/mpeg, framed=(boolean)true, mpegversion=(int)2,
level=(string)2, profile=(string)lc, rate=(int)44100, channels=(int)2, stream-format=(string)adts'.
Is it just a mistake that the fdkaacdec
only supports mpegversion 4? Or are there reasons for that?
Thanks.
Reproduce the issue in the freedesktop runtime:
RUNTIME_PLATFORM=org.freedesktop.Platform
RUNTIME_SDK=org.freedesktop.Sdk
RUNTIME_VERSION=19.08
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install flathub $RUNTIME_PLATFORM//$RUNTIME_VERSION
flatpak install flathub $RUNTIME_SDK//$RUNTIME_VERSION
flatpak run --devel --command=bash --share=network --socket=pulseaudio $RUNTIME_PLATFORM//$RUNTIME_VERSION
# we're now in the flatpak runtime
gst-launch-1.0 playbin uri='http://ice2.somafm.com/indiepop-128-aac'