Media API question regarding metadata retrieval
Scott Palmer
swpalmer at gmail.com
Wed Apr 1 20:50:44 UTC 2015
I seems like a decent compromise to defer to the native platform code that
will ultimately be used to process the file anyway. It seems a little
heavy, but the alternative is perhaps bloating the JavaFX API.
It likely makes more sense to use the MediaInfo project with some JNA
bindings (you can probably find either JNI or JNA bindings on the web) if
you need access to the metadata:
https://mediaarea.net/nn/MediaInfo
I keep thinking a pure java port of MediaInfo would be cool... but probably
not worth the time :-)
Scott
On Wed, Apr 1, 2015 at 3:48 PM, David DeHaven <david.dehaven at oracle.com>
wrote:
>
> > I was a bit surprised that the metadata retrieval functionality
> > of javafx.scene.media.Media is only usable in conjunction with a player,
> so
> > if I want to retrieve the dimensions of a video file I have to
> instantiate
> > a player and wait for it to reach ready state? That's how I read the
> > javadoc. Is this a misunderstanding?
>
> Nope, currently you have to create a player. Once a player is created it
> kicks off a parser to grab metadata or waits for the underlying native
> player to parse.
>
>
> > If not is there a specific reason not
> > to offer this functionality independently of a player?
>
> There were plans, there were also issues as we don't have a Java based mp4
> parser so we're relying on the underlying platforms (e.g. QTKit,
> AVFoundation, etc..) to provide that data, which basically means we're
> creating a player at the native level anyways. If you're using the horribly
> outdated FXM format you get the benefit of a Java based parser, but
> honestly, who's using that these days?
>
> -DrD-
>
>
More information about the openjfx-dev
mailing list