RFR: 8273096: Add support for H.265/HEVC to JavaFX Media
Kevin Rushforth
kcr at openjdk.java.net
Wed Nov 3 14:55:13 UTC 2021
On Thu, 21 Oct 2021 07:51:20 GMT, Alexander Matveev <almatvee at openjdk.org> wrote:
> - Added support for H.265/HEVC for all 3 platforms.
> - Support is added only for .mp4 files over FILE/HTTP/HTTPS protocols. HTTP Live Streaming with H.265/HEVC is not supported.
> - On Windows mfwrapper was introduced which uses Media Foundation APIs to decode HEVC.
> - 10 and 12-bit HEVC was tested and also supported, however due to graphics pipeline not supporting 10-bit YUV rendering we will use color converter to convert video frame to 8-bit before sending it for rendering.
> - Resolution upto 4k is supported.
>
> Additional runtime dependency requirements:
> Windows: Windows 10 with HEVC Video Extensions installed.
> macOS: macOS High Sierra and later
> Linux: at least libavcodec56 and libswscale5
>
> Additional build dependency:
> Linux: libswscale-dev
This adds an additional supported encoding type, so we will need a CSR for this. The specification can be the changes to the docs in `javafx/scene/media/package.html`
Sorry for the delay in looking at this.
I get this failure on Ubuntu 20.04 Linux running the oow2010-2.mp4 sample media file:
** (java:72365): WARNING **: 07:18:02.597: Failed to load plugin '.../build/sdk/lib/libavplugin-ffmpeg-58.so':
libswscale.so.5: cannot open shared object file: No such file or directory
Regarding the additional runtime dependencies:
> Additional runtime dependency requirements:
> Windows: Windows 10 with HEVC Video Extensions installed.
> macOS: macOS High Sierra and later
> Linux: at least libavcodec56 and libswscale5
The added dependency on Linux on `libswscale5` is a problem, at least as implemented in the current version of the PR. It's OK to require additional dependencies at runtime in order to play H.265 media files, but we need to continue to be able to play media that doesn't use H.265 without any additional requirements. This means that the loading of `libswscale5.so` needs to be optional; we can't link with it at build time, but need to dynamically load it at runtime, and only use it, or fail if not present, when decoding media formats that require it.
Similarly, it is fine to make the playing of H.265 videos dependent on macOS 10.13 High Sierra or later, but unless we bump our current minimum platform across the board, we need to be able to play videos that don't use H.265 on macOS 10.12 Sierra.
The same thing applies to Windows, where we need to be able to play non-H.265 media without the HEVC Video Extensions.
-------------
PR: https://git.openjdk.java.net/jfx/pull/649
More information about the openjfx-dev
mailing list