Bug#1033771: libopenjfx-java: javafx.scene.media does not support available libav versions
Owen
owen.riddy+debian at fastmail.com
Sat Apr 1 05:49:18 BST 2023
Package: libopenjfx-java
Version: 11.0.11+1-3
Severity: normal
X-Debbugs-Cc: owen.riddy+debian at fastmail.com
Dear Maintainer,
This problem was found trying to play an mp3 using Clojure (the JVM hosted language). Constructing a javafx.scene.media.MediaPlayer failed with an exception:
com.sun.media.jfxmedia.MediaException
Could not create player!
I have investigated the issue and believe that the problem is due to the version of libavcodec in Debian. At the moment Debian has 2 options:
$ aptitude search "libavcodec[0-9]*$" -F %p
libavcodec58
libavcodec59
libavcodec59:i386
However, OpenJFX only added support for 58 in v13 (https://bugs.openjdk.org/browse/JDK-8215894) and 59 in v20 (https://bugs.openjdk.org/browse/JDK-8294400). Neither option allows mp3 playback.
I changed my project dependencies to use javafx-media version 20 and it worked as expected.
;; deps.edn
org.openjfx/javafx-media {:mvn/version "20"}
;; Code
(import [javafx.scene.media Media MediaPlayer])
(import [javafx.application Platform])
(Platform/startup identity)
(def media (-> "audio/screen-saver.mp3" io/resource .toExternalForm Media.))
(def player (MediaPlayer. media))
(.play player)
-- System Information:
Debian Release: 12.0
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 6.1.0-6-amd64 (SMP w/16 CPU threads; PREEMPT)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), LANGUAGE=en_AU:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages libopenjfx-java depends on:
ii libopenjfx-jni 11.0.11+1-3
libopenjfx-java recommends no packages.
Versions of packages libopenjfx-java suggests:
ii openjfx 11.0.11+1-3
-- no debconf information
More information about the pkg-java-maintainers
mailing list