[graalvm-users] Creating maven artifacts for native libs

Johan Vos johan.vos at gluonhq.com
Wed Nov 27 00:21:12 PST 2019


Hi,

At this moment, there is no built-in support for H.265 in the JavaFX media
API's. It sounds doable though, if there is time and interest.
In that case, we can start a discussion about it at
openjfx-dev at openjdk.java.net ?

- Johan

On Tue, Nov 26, 2019 at 7:12 AM Samuel Audet <samuel.audet at gmail.com> wrote:

> +Johan Vos
>
> JavaCV doesn't have a video player per se. It's meant more for image
> analysis and such than anything else. JavaFX is the one with a proper
> video player: https://urldefense.proofpoint.com/v2/url?u=https-3A__openjfx.io_&d=DwIBaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=CUkXBxBNT_D5N6HMJ5T9Z6rmvNKYsqupcbk72K0lcoQ&m=PQkEL5H7d_3R8XKmyLxgs0mWipp75yAshPm3CwtzR3I&s=iKkRWM5v4HmHz7Guz3RkyKZQj_Nl1K8h3czTZj54kxo&e= 
>
> Johan, does it support playback of HEVC media?
>
> Samuel
>
> On 11/26/19 2:43 PM, Ramsey Gurley wrote:
> > I think you may have saved me a lot of work :) I'll also check out
> > javacv-platform, since I see you have a swing component to play video in
> > that as well.
> >
> > Thank you!
> >
> > Ramsey
> >
> > On 11/26/19 1:25 PM, Samuel Audet wrote:
> >> Hi,
> >>
> >> In theory, Sulong can compile x265 to fully portable bytecode, and
> >> these files can be packaged into Maven artifacts like any other Java
> >> classes, but the performance that we would get from that may not be
> >> satisfactory. It would probably be around 10x slower than native
> >> binaries since Java bytecode isn't able to accommodate for native
> >> assembly instructions that are used heavily in encoders such as x265.
> >> Also, we may need dependencies on GraalVM, Truffle, and Sulong, so we
> >> wouldn't get a small independent package that could run on the JDK,
> >> but I'm not entirely sure about that. Those projects are still pretty
> >> experimental, so that's probably why I'm not finding a friendly way to
> >> try it out. :)
> >>
> >> Because of these kinds of limitations, what everyone does, including
> >> very official projects from OpenJDK like JavaFX, is simply to package
> >> native libraries in JAR files and access them with JNI. It works fine
> >> for multiple platforms as well. For example, I'm making packages for
> >> FFmpeg (which include x265) available here:
> >> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_bytedeco_javacpp-2Dpresets_tree_master_ffmpeg&d=DwIBaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=CUkXBxBNT_D5N6HMJ5T9Z6rmvNKYsqupcbk72K0lcoQ&m=PQkEL5H7d_3R8XKmyLxgs0mWipp75yAshPm3CwtzR3I&s=UINC3Ai8f3nUmMC0bMTwzAdk-mxSZAkccWhMyqFHieY&e= 
> >>
> >> There are binaries for Android (ARM, ARM64, x86, x86_64), Linux (ARM,
> >> ARM64, POWER, x86, x86_64), Mac (x86_64), and Windows (x86 and
> >> x86_64), all accessible from a single Maven artifact named
> >> "ffmpeg-platform", but we can create builds easily for more platforms.
> >> To get smaller JAR files, we can also limit the scope of the builds to
> >> small libraries such as only x265 itself.
> >>
> >> Samuel
> >>
> >> On 11/25/19 4:47 PM, Ramsey Gurley wrote:
> >>> Hi all,
> >>>
> >>> I'd like to compile a native lib with graal to be distributed as a
> maven
> >>> artifact. I have a few questions.
> >>>
> >>> Are native libraries platform specific if compiled with graalvm's llvm
> >>> tools? Let's say I want to compile x265. Do I need one artifact per
> >>> arch? Per os?
> >>>
> >>> Once created, can the graal compiler used by OpenJDK make use of them?
> >>> Or is a graalvm with llvm tools installed a requirement?
> >>>
> >>> Basically, I want to fill a gap in Java, which is video codecs and a
> >>> swing component to use them. I'm hoping graalvm is a good way to do
> >>> this.
> >>>
> >>> Thank you,
> >>>
> >>> Ramsey
> >>>
> >>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/graalvm-users/attachments/20191127/184168a2/attachment.html 


More information about the GraalVM-Users mailing list