Reputation: 482
I had a small JavaFX application to play some GoPro videos on a Windows / Linux client. In the past I had using a GoPro 4. I've downloaded the video to the client and play it from the local storage. Like this:
File file = new File("AnyVideo.MP4");
Media m = new Media(file.toURI().toString());
MediaPlayer mp = new MediaPlayer(m);
mp.setAutoPlay(true);
mediaView.setMediaPlayer(mp);
I'll try to switch to the new GoPro 6 now. But it doesn't worked as expected.
The problem is probably that the JavaFX MediaPlayer did not support the codec from the new GoPro 6.
The JavaFX MediaPlayer supports only the h264 codec.
Did anyone know a way how I can play a h265 HEVC video with my JavaFX application. In the best case a solution which can play the video immediately from the camera without download the video first to the client. The GoPro has a small Media Server to get the video over HTTP. as example: http://10.5.5.9:8080/videos/DCIM/100/GPR10973.MP4
Upvotes: 2
Views: 2567
Reputation: 159416
Native JavaFX Solution
Perhaps this is a duplicate or at least related to:
See my answer to that question for links to related feature requests in the JavaFX bug tracker system.
Solutions using non-JavaFX tech from JavaFX
There are other solutions than those discussed in answers to that question which may work for you. Especially if your primary concern is just getting some kind of playback, even if it doesn't have deep integration with the JavaFX media system.
For instance, other approaches than native JavaFX playback could be:
Xuggler is on hiatus as no one is actively developing it anymore. Sorry. That said, you can always find the source code and start hacking yourself. Good luck!
Of the options outlined above, personally, I would recommend using HostServices to play the video in the native browser if that kind of solution will possibly work for you.
Going into detail on various options is probably out of scope for StackOverflow (even the above list starts looking like a sometimes frowned upon library recommendation).
Upvotes: 3