0

In JavaFx we can load images easily from an external server:

imageView.setImage(new Image("http://...File.png"));

But is there a way to load the thumbnail of videos? Something like: imageView.setImage(new Image("http://...File.mp4"));

I'm developing something like a "gallery" and would like to load the thumbnails of videos coming straight from my server, is it possible?

Woton Sampaio
  • 469
  • 6
  • 24
  • This doesn't make a lot of sense. However, the obvious approach would be to capture one frame of the video (hopefully one that makes sense) turn it into an image, and then create a thumbnail for the image. – Stephen C Jan 20 '19 at 12:41
  • @StephenC But how do you make a video that is not local without downloading it altogether? Of course, the way I set an example does not make sense, because it is an EXAMPLE, if that were the case and it worked, I would not have to open an issue here – Woton Sampaio Jan 20 '19 at 15:52

1 Answers1

1

An mp3 or mp4 file can have an embedded thumbnail image as part of its metadata. There are third party libraries for reading mp3 / mp4 metadata. For example:

If the file doesn't have a thumbnail, then you could conceivably pick a frame of the video and use it as a thumbnail, but the chances of picking an appropriate frame (i.e. one that is indicative of the movie) without the assistance of a human being are not great. But here is an example:


But how do you make a video that is not local without downloading it altogether?

Approach #1: pick a 3rd-party metadata extraction library that can operate in stream mode. The metadata should be at / near the start of the stream.

Approach #2: get the server to do the extraction, and present you with the thumbnail separately from the main video.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216