gstreamer-java / gst1-java-core

Java bindings for GStreamer 1.x
GNU Lesser General Public License v3.0
188 stars 72 forks source link

How would I extract coverart from a PlayBin? #231

Closed codedcosmos closed 3 years ago

codedcosmos commented 3 years ago

I want to create a BufferedImage from a music files cover/song art.

I can get tag details with this

PlayBin playBin = new PlayBin("AudioPlayer");
playBin.setInputFile(new File("InsertMusicFileHere"));

playBin.getBus().connect((Bus.TAG) (source, tagList) -> {
  for (String tagName : tagList.getTagNames()) {
      // Each tag can have multiple values, so print them all.
      for (Object tagData : tagList.getValues(tagName)) {
          System.out.printf("[%s]=%s\n", tagName, tagData);
      }
  }
});

There is an image tag: [image]=

However I don't think its quite what I want.

Sorry if this is in the wrong place Thanks

neilcsmith-net commented 3 years ago

Yes, please use the mailing list for support queries - https://groups.google.com/forum/#!forum/gstreamer-java If nothing else, you'll reach a lot more people that way! :smile:

Also, can you add this code in a post to the list, along with whether tagData is actually null there or a particular Java type? And what upstream GStreamer / native type it should be if you already know?

Thanks.