JDK-8093236 : GStreamer fails to build on Debian Jessie
  • Type: Bug
  • Component: javafx
  • Sub-Component: media
  • Affected Version: 8u5
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-05-23
  • Updated: 2015-06-12
  • Resolved: 2014-07-18
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
Relates :  
Relates :  
Description
Hi,

I'm trying to package OpenJFX for Debian but I get compilation errors on GStreamer due to the more recent version of libvav used in Debian Jessie (Debian Wheezy isn't affected). If I'm not mistaken this also affects Ubuntu 14.04 LTS which has the same version of libav (>= 9.13).

The changes needed are:
- The CodecID enum becomes AVCodecID
- CODEC_ID_xxx becomes AV_CODEC_ID_xxx
- AVCODEC_MAX_AUDIO_FRAME_SIZE no longer exists (to be replaced with 192000)
- The deprecated avcodec_decode_audio3 method has been removed, avcodec_decode_audio4 should be used instead.
- avcodec_default_free_buffers has been removed
Comments
Changeset: http://hg.openjdk.java.net/openjfx/8u-dev/rt/rev/647fd6fc387c
18-07-2014

You're right. It's indeed libavplugin.so And as far as I can tell it has all necessary dependencies. Were you able to add a MediaError listener and see what it does ?
25-06-2014

The libavcodec55 package is installed (it's a dependency of the libopenjfx-jni package). libav.so is not in ${jre_home}/lib/amd64/, but libavcodec.so.55 is found under /usr/lib/x86_64-linux-gnu/ There is no MediaException thrown, but that's expected if the video plays fine, right?
25-06-2014

Any debugging output any MediaExceptions thrown ? Have you installed libavcodec package ? Can you provide the output of the following command: $ ldd ${jre_home}/lib/amd64/libav.so - path to libav decorers in jre
25-06-2014

There is no libav.so in the build directory. The closest match I found is libavplugin.so in build/linux-sdk/rt/lib/amd64/ and ldd gives: ldd build/linux-sdk/rt/lib/amd64/libavplugin.so linux-vdso.so.1 (0x00007fff89702000) libgstreamer-lite.so => not found libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f253530b000) libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f2535002000) libavcodec.so.55 => /usr/lib/x86_64-linux-gnu/libavcodec.so.55 (0x00007f253412f000) libavformat.so.55 => /usr/lib/x86_64-linux-gnu/libavformat.so.55 (0x00007f2533dfd000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2533a52000) libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f253384a000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f25335ee000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f25333d0000) libavutil.so.53 => /usr/lib/x86_64-linux-gnu/libavutil.so.53 (0x00007f25331a7000) libxvidcore.so.4 => /usr/lib/x86_64-linux-gnu/libxvidcore.so.4 (0x00007f2532e69000) libx264.so.142 => /usr/lib/x86_64-linux-gnu/libx264.so.142 (0x00007f2532ad2000) libvpx.so.1 => /usr/lib/x86_64-linux-gnu/libvpx.so.1 (0x00007f25326f4000) libvorbisenc.so.2 => /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2 (0x00007f2532225000) libvorbis.so.0 => /usr/lib/x86_64-linux-gnu/libvorbis.so.0 (0x00007f2531ff7000) libtheoraenc.so.1 => /usr/lib/x86_64-linux-gnu/libtheoraenc.so.1 (0x00007f2531db7000) libtheoradec.so.1 => /usr/lib/x86_64-linux-gnu/libtheoradec.so.1 (0x00007f2531b9e000) libspeex.so.1 => /usr/lib/x86_64-linux-gnu/libspeex.so.1 (0x00007f2531984000) libschroedinger-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libschroedinger-1.0.so.0 (0x00007f25316b7000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f253149f000) libopus.so.0 => /usr/lib/x86_64-linux-gnu/libopus.so.0 (0x00007f2531256000) libopenjpeg.so.5 => /usr/lib/x86_64-linux-gnu/libopenjpeg.so.5 (0x00007f2531032000) libmp3lame.so.0 => /usr/lib/x86_64-linux-gnu/libmp3lame.so.0 (0x00007f2530da8000) libgsm.so.1 => /usr/lib/x86_64-linux-gnu/libgsm.so.1 (0x00007f2530b9a000) libva.so.1 => /usr/lib/x86_64-linux-gnu/libva.so.1 (0x00007f2530984000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2530681000) librtmp.so.1 => /usr/lib/x86_64-linux-gnu/librtmp.so.1 (0x00007f2530463000) libgnutls.so.26 => /usr/lib/x86_64-linux-gnu/libgnutls.so.26 (0x00007f25301a3000) libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f252ff93000) /lib64/ld-linux-x86-64.so.2 (0x00007f253577c000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f252fd8e000) libogg.so.0 => /usr/lib/x86_64-linux-gnu/libogg.so.0 (0x00007f252fb85000) liborc-0.4.so.0 => /usr/lib/x86_64-linux-gnu/liborc-0.4.so.0 (0x00007f252f8fe000) libhogweed.so.2 => /usr/lib/x86_64-linux-gnu/libhogweed.so.2 (0x00007f252f6cf000) libnettle.so.4 => /usr/lib/x86_64-linux-gnu/libnettle.so.4 (0x00007f252f49e000) libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f252f225000) libgcrypt.so.11 => /lib/x86_64-linux-gnu/libgcrypt.so.11 (0x00007f252efa6000) libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007f252ed91000) libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007f252eb4f000) libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f252e949000)
25-06-2014

Please search for libav.so from the root of your build output directory. It should be somewhere. Maybe in lib/ext/amd64 or something. There should be exception or MediaError being reported if your MediaPlayer can't play a format. As I said error handler should be installed on MediaPlayer/MediaView instances.
25-06-2014

I rebuilt the Debian package today and I'm now able to play h264 videos ('Code Hard' and 'Big Buck Bunny' work well). The package is available for testing from this APT repository: http://87.98.165.193/debian/repo/
24-06-2014

This will open up next week (around 24 June).
17-06-2014

Progress is stopped. Waiting for 8u40 workspace to open. Anyone who needs this use the latest version of the fix: http://cr.openjdk.java.net/~stayer/RT-37256/webrev.01/
17-06-2014

This video worked for me.
17-06-2014

H264 should work. I suppose you have installed libavcodec package ? I'll let you know how this video works for me.
11-06-2014

You are right, I added an error listener to StreamingMediaPlayerApp and now I see the MediaException: Unsupported decoded format. I tried with a h264 video (http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4) but I got the same error. Are there other formats available without the closed part?
11-06-2014

I assume it happens because when you compile OpenJFX you can't build closed part of Oracle JavaFX which also contains VP6 decoder. The default video clips used in Ensemble8 are encoded with VP6. Also you're not getting any notification because there are no error listeners installed on MediaPlayer/MediaView components in Ensemble8. Try using the Hello application - it has all necessary listeners.
11-06-2014

I tried the Ensemble8 demo on Debian Jessie, the audio clip sample with the xylophone played fine, but none of the video samples worked, the display area remains black. There was no error displayed on the console. Is there a way to enable some debugging output?
11-06-2014

Okay. Here is the updated webrev: http://cr.openjdk.java.net/~stayer/RT-37256/webrev.01/ I had to modify audiodecoder's _chain() function because aac is decoded in packed float format. Can you please review it ?
10-06-2014

Also, the Ensemble8 sample application has a few Media samples with audio.
10-06-2014

There is rt/apps/toys/Hello NetBeans project. Run it with HelloMedia main class.
10-06-2014

I built on a headless machine so I couldn't test the sound output. I'll try again in a GUI environment. Could you point me to a sample JavaFX application I could use to test this please?
10-06-2014

Emmanuel, can you make sure some simple sound tests work with libav55 ? We didn't make full scale testing for newer platforms so I can't say we 100% done this issue. My main concern is that they (libav) have changed the way they produce the output audio samples. I spent several days figuring out why sound output was like broken. Now it seems to be ok. Look at the audiodecoder.c lines 727-733 - this is where reformatting is done. It looks correct for 2 channels audio files. Kevin I will check manually that is works fine with MP3, AAC in file, http and hls modes and let you know. Alexander, that for the comments.
10-06-2014

1) http://cr.openjdk.java.net/~stayer/RT-37256/webrev.00/modules/media/src/main/native/gstreamer/plugins/av/decoder.c.frames.html Remove line 172 if not needed. 2) Update copyright year to 2014. Otherwise looks good and approved.
09-06-2014

The repo is open now. This looks like a fairly substantial change, although the code is Linux-specific. How much testing have you done on Ubuntu 13.04 to ensure no regressions? Note also that our build machines are even older than that (Ubuntu 10.04 for 8u20). Given that this will not benefit the 8u20 release (although it will help people build on newer system), you might consider waiting until after the 8u20 fork if you have any doubts about possible regressions. My only concrete comment is the copyright issue I mentioned in my earlier comment: 1) avdefines.h must have a proper copyright header (see videodecoder.h for a good example).
09-06-2014

Two quick comments, then I will look more closely. 1) This cannot be pushed today since we are "locked" for weekly testing / integration 2) The newly added .h file needs a proper copyright header
09-06-2014

+1
09-06-2014

Thank you for the patch Kirill, I confirm it now builds fine on Debian Jessie with libav55.
09-06-2014

Please review the following: http://cr.openjdk.java.net/~stayer/RT-37256/webrev.00/ Reviewers: almatvee, snorthov Please review this fix for openjdk. It resolves compile time errors for libav54 and libav55 and makes sound workable on these two versions of libav.
09-06-2014

It will be both. These systems (Ubuntu 14.04 and others) with libav-54 on board are on the horizon. So we should take care of this issue. It's not extremely urgent but need to be done sooner.
26-05-2014

Kirill: is this just a build time issue or does it also affect running the production build of JavaFX binaries? If the latter then we likely will need to pull this into 8u40.
23-05-2014

You can try to do it for yourself but we won't accept such change in the main code. It's better to use the new existing API.
23-05-2014

I gave it try a try but this isn't enough. avcodec_default_free_buffers has been removed, it's used in plugins/av/decoder.c
23-05-2014

Maybe copying and renaming the decode_audio3 method from FFmpeg would do the trick? https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/utils.c#L2314
23-05-2014

This is not only about some new enums. It's also about preparing arguments for new functions like decode_audio4 and handling their return values if there is something new.
23-05-2014

It may be possible to support both versions with something like this: https://github.com/FreeRDP/FreeRDP/commit/6fe23e1a3860528a8ecdfc8e9ccfdbd0e3945869 The removal of avcodec_decode_audio3 seems to be more annoying though.
23-05-2014

Yes there is such an issue with libav. They just wipe out deprecated methods so libraries different in major version aren't binary compatible. One would need to modify the libav linux plugin such that it compiles and works for both libav-53 and libav-54.
23-05-2014