JDK-8098280 : Provide media support for libav version 54 and 55
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: media
  • Affected Version: 8
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-02-10
  • Updated: 2016-02-24
  • Resolved: 2014-07-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8u40Fixed
Related Reports
Blocks :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Running a simple Media/MediaPlayer test program to play mp3 file from disc.

Runs like charm on Java FX runtime version: 2.2.45-b18/jdk1.7.0.45

Changing in Netbeans (7.4) Platform from JDK 7 to JDK 8: Java FX runtime version: 8.0.0-b128

the following exception is thrown:

INFO: [22] playIndefiniteStream: Read file: file:///home/dev/stream.mp3
Exception in thread "JavaFX Application Thread" MediaException: UNKNOWN : com.sun.media.jfxmedia.MediaException: Could not create player! : com.sun.media.jfxmedia.MediaException: Could not create player!
at javafx.scene.media.MediaException.exceptionToMediaException(MediaException.java:146)
at javafx.scene.media.MediaPlayer.init(MediaPlayer.java:511)
at javafx.scene.media.MediaPlayer.<init>(MediaPlayer.java:414)
at pi.util.player.Player$2.changed(Player.java:241)
at pi.util.player.Player$2.changed(Player.java:220)
at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:176)
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
at javafx.beans.property.ObjectPropertyBase.fireValueChangedEvent(ObjectPropertyBase.java:105)
at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:112)
at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:145)
at javafx.concurrent.Task.setState(Task.java:693)
at javafx.concurrent.Task$TaskCallable$1.run(Task.java:1421)
at com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:301)
at com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:298)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$6.run(PlatformImpl.java:298)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication.access$200(GtkApplication.java:48)
at com.sun.glass.ui.gtk.GtkApplication$6$1.run(GtkApplication.java:149)
at java.lang.Thread.run(Thread.java:744)
Caused by: com.sun.media.jfxmedia.MediaException: Could not create player!
at com.sun.media.jfxmediaimpl.NativeMediaManager.getPlayer(NativeMediaManager.java:224)
at com.sun.media.jfxmedia.MediaManager.getPlayer(MediaManager.java:104)
at javafx.scene.media.MediaPlayer.init(MediaPlayer.java:467)
... 19 more

As the MediaPlayer instantiation with JFX 2.2 works fine, I assume all required Linux libraries are present.

Debugger in JFX code does not give any hint.


                        String fileUrl = theStreamPath.toUri().toString();
                        Logger.getLogger("").log(
                                Level.INFO,
                                "playIndefiniteStream: Read file: {0}",
                                new Object[]{fileUrl});
                        final MediaPlayer mediaPlayer = new MediaPlayer(new Media(fileUrl));
                        mediaPlayer.setOnError(new Runnable() {
                            @Override public void run() {
                                Logger.getLogger("").log(
                                        Level.SEVERE,
                                        "playIndefiniteStream: Media Player Error: {0}",
                                        new Object[]{mediaPlayer.getError()});
                            }
                        });
                        mediaPlayer.setAutoPlay(true); 
Comments
I filed JDK-8136920 to add support for libav 56 and to deliver a plugin for libav 55 and 56.
22-09-2015

At least you can give it a try. If you're able to build for 56 please share your patch.
10-03-2015

Ubuntu 14.10 ships with 56 now. Is there any opportunity to make it working? Can recompile be helpful or should wait for jdk 9 release?
08-03-2015

Resolving this issue for libav-54. Once a need arises for 55 reopen this issue. Libav-55 support for openjdk is in the code. So anyone can take the code and compile against 55. See RT-37914 for more details.
28-07-2014

Raising the priority of this issue and targeting to 8u40, since Ubuntu 14.04 ships with libav-54. See RT-37914 which depends on this functionality (note that we might just provide support for libav-54 in 8u40 and libav-55 in 9).
11-07-2014

We should reclassify this as a Feature request to support libav 54 and 55 and target it for 9.
11-02-2014

Good to hear that. And thank you for correcting the summary.
11-02-2014

True, after installing libavcodec.so.53 libavformat.so.53 JavaFX 8 works for me
11-02-2014

We dropped support for 52 in jdk8. Ubuntu is our primary system. in jdk7 we supported Ubuntu 10.xx which had 52. All latest Ubuntu versions have 53. We compile our code with 53 so it's binary incompatible with 54 ad 55. To be able to support 54 or 55 we need some extra effort. So I would say "Will not fix" or defer it to jdk9. Kevin, what do you think ?
11-02-2014

Is 53 mandatory? Seems as if OpenSuse 12.3 ships 52/54/55 ... dev@pcamd:/usr/lib64> rpmquery -qa | grep libavformat libavformat55-2.1.2-2.1.x86_64 libavformat52-0.7.16-3.1.x86_64 libavformat54-1.0.8-3.2.x86_64 dev@pcamd:/usr/lib64> rpmquery -qa | grep libavcodec libavcodec54-1.0.8-3.2.x86_64 libavcodec52-0.7.16-3.1.x86_64 libavcodec55-2.1.2-2.1.x86_64 dev@pcamd:/usr/lib64>
11-02-2014

See what you have: libavcodec.so.53 => not found libavformat.so.53 => not found You should install these libraries. MP3 playback depends on them.
11-02-2014

dev@pcamd:/usr/lib64> ls -l libavcode* lrwxrwxrwx 1 root root 22 5. Feb 22:53 libavcodec.so.52 -> libavcodec.so.52.123.0 -rwxr-xr-x 1 root root 6853072 31. Jan 16:07 libavcodec.so.52.123.0 lrwxrwxrwx 1 root root 23 5. Feb 22:53 libavcodec.so.54 -> libavcodec.so.54.59.100 -rwxr-xr-x 1 root root 8298056 3. Feb 21:19 libavcodec.so.54.59.100 lrwxrwxrwx 1 root root 23 31. Jan 23:49 libavcodec.so.55 -> libavcodec.so.55.39.101 -rwxr-xr-x 1 root root 9301032 28. Jan 17:55 libavcodec.so.55.39.101 dev@pcamd:/usr/lib64> ls -l libavformat* lrwxrwxrwx 1 root root 23 5. Feb 22:53 libavformat.so.52 -> libavformat.so.52.111.0 -rwxr-xr-x 1 root root 1034416 31. Jan 16:07 libavformat.so.52.111.0 lrwxrwxrwx 1 root root 24 5. Feb 22:53 libavformat.so.54 -> libavformat.so.54.29.104 -rwxr-xr-x 1 root root 1327112 3. Feb 21:19 libavformat.so.54.29.104 lrwxrwxrwx 1 root root 24 31. Jan 23:49 libavformat.so.55 -> libavformat.so.55.19.104 -rwxr-xr-x 1 root root 1547752 28. Jan 17:55 libavformat.so.55.19.104
11-02-2014

dev@pcamd:~/install/jdk1.8.0/jre/lib/amd64> ldd libjfxmedia.so linux-vdso.so.1 (0x00007fff799ff000) libgstreamer-lite.so => /home/bi/install/jdk1.8.0/jre/lib/amd64/./libgstreamer-lite.so (0x00007f9b2bd49000) libgobject-2.0.so.0 => /usr/lib64/libgobject-2.0.so.0 (0x00007f9b2badb000) libgmodule-2.0.so.0 => /usr/lib64/libgmodule-2.0.so.0 (0x00007f9b2b8d7000) libgthread-2.0.so.0 => /usr/lib64/libgthread-2.0.so.0 (0x00007f9b2b6d5000) librt.so.1 => /lib64/librt.so.1 (0x00007f9b2b4cc000) libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007f9b2b1d3000) libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f9b2aecd000) libm.so.6 => /lib64/libm.so.6 (0x00007f9b2abce000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f9b2a9b8000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f9b2a79c000) libc.so.6 => /lib64/libc.so.6 (0x00007f9b2a3ed000) libasound.so.2 => /usr/lib64/libasound.so.2 (0x00007f9b2a10c000) libffi.so.4 => /usr/lib64/libffi.so.4 (0x00007f9b29f04000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f9b29cff000) /lib64/ld-linux-x86-64.so.2 (0x00007f9b2c2dd000) libpcre.so.1 => /usr/lib64/libpcre.so.1 (0x00007f9b29aa2000) dev@pcamd:~/install/jdk1.8.0/jre/lib/amd64> ldd libavplugin.so linux-vdso.so.1 (0x00007fff09eed000) libgstreamer-lite.so => not found libgobject-2.0.so.0 => /usr/lib64/libgobject-2.0.so.0 (0x00007f41f3009000) libgthread-2.0.so.0 => /usr/lib64/libgthread-2.0.so.0 (0x00007f41f2e07000) librt.so.1 => /lib64/librt.so.1 (0x00007f41f2bff000) libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007f41f2905000) libavcodec.so.53 => not found libavformat.so.53 => not found libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f41f26e8000) libc.so.6 => /lib64/libc.so.6 (0x00007f41f233a000) libffi.so.4 => /usr/lib64/libffi.so.4 (0x00007f41f2132000) /lib64/ld-linux-x86-64.so.2 (0x00007f41f3482000) libpcre.so.1 => /usr/lib64/libpcre.so.1 (0x00007f41f1ed4000) dev@pcamd:~/install/jdk1.8.0/jre/lib/amd64> ldd libfxplugins.so linux-vdso.so.1 (0x00007fffec435000) libgstreamer-lite.so => not found libgobject-2.0.so.0 => /usr/lib64/libgobject-2.0.so.0 (0x00007f8554f83000) libgthread-2.0.so.0 => /usr/lib64/libgthread-2.0.so.0 (0x00007f8554d81000) librt.so.1 => /lib64/librt.so.1 (0x00007f8554b79000) libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007f855487f000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f8554663000) libc.so.6 => /lib64/libc.so.6 (0x00007f85542b5000) libffi.so.4 => /usr/lib64/libffi.so.4 (0x00007f85540ac000) /lib64/ld-linux-x86-64.so.2 (0x00007f8555411000) libpcre.so.1 => /usr/lib64/libpcre.so.1 (0x00007f8553e4f000) dev@pcamd:~/install/jdk1.8.0/jre/lib/amd64> ldd libgstreamer-lite.so linux-vdso.so.1 (0x00007fffc4fff000) libm.so.6 => /lib64/libm.so.6 (0x00007f9ecb599000) libasound.so.2 => /usr/lib64/libasound.so.2 (0x00007f9ecb2b8000) libgobject-2.0.so.0 => /usr/lib64/libgobject-2.0.so.0 (0x00007f9ecb068000) libgmodule-2.0.so.0 => /usr/lib64/libgmodule-2.0.so.0 (0x00007f9ecae64000) libgthread-2.0.so.0 => /usr/lib64/libgthread-2.0.so.0 (0x00007f9ecac62000) librt.so.1 => /lib64/librt.so.1 (0x00007f9ecaa59000) libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007f9eca760000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f9eca544000) libc.so.6 => /lib64/libc.so.6 (0x00007f9eca195000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f9ec9f91000) /lib64/ld-linux-x86-64.so.2 (0x00007f9ecbc1a000) libffi.so.4 => /usr/lib64/libffi.so.4 (0x00007f9ec9d89000) libpcre.so.1 => /usr/lib64/libpcre.so.1 (0x00007f9ec9b2b000) dev@pcamd:~/install/jdk1.8.0/jre/lib/amd64>
11-02-2014

Did you install libavcodec and libavformat packages ? In Ubuntu these packages are named libavformat53 and libavcodec53. Usually it's necessary to install libavformat53 which pull the other package as a dependency. Also can you provide the output of the following command lines being in jre/lib/amd64: $ ldd libjfxmedia.so $ ldd libavplugin.so $ ldd libfxplugins.so $ ldd libgstreamer-lite.so
11-02-2014

@Kirill or @Alexander : can you think of any other reason why FX 2 would work on OpenSuSE 12 and FX 8 would not? Is there any other information that the bug reporter could provide that would be helpful?
11-02-2014

I am using OpenSuse 12.3. dev@pcamd:/lib> ls -l /usr/lib64/libglib-2.0.so.0* lrwxrwxrwx 1 root root 23 19. Mai 2013 /usr/lib64/libglib-2.0.so.0 -> libglib-2.0.so.0.3400.3 -rwxr-xr-x 1 root root 1017016 27. Jan 2013 /usr/lib64/libglib-2.0.so.0.3400.3 shows that glib 2.34 is installed, requirement to be greater than 2.28 is therefore fulfilled. dev@pcamd:/lib> rpmquery -qa | grep libglib libglib-2_0-0-32bit-2.34.3-2.1.1.x86_64 libglib-2_0-0-2.34.3-2.1.1.x86_64
10-02-2014

This is a duplicate of RT-33546. The system requirements for JDK 8 have been updated to include a dependency on GLIB 2.28, which is not shipped by default on SuSE 10 or 11. See RT-34324 for more information.
10-02-2014

Netbeans 7.4 project test case uploaded to here as zip file: https://anonfiles.com/file/b80b75d25d4cfb65e22ffc3b5e6f5b3f
10-02-2014

By the way, works fine on Windows 7 as well (JDK7 and JDK8 same versions)
10-02-2014