aspose file tools*
The moose likes JavaFX and the fly likes JavaFX vs H.264 on Linux Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JavaFX
Bookmark "JavaFX vs H.264 on Linux" Watch "JavaFX vs H.264 on Linux" New topic
Author

JavaFX vs H.264 on Linux

Ricardo Capp
Greenhorn

Joined: Jan 16, 2011
Posts: 4
Hello all,

I've been looking on the Internet for something that could point me to a solution for this small problem. But found nothing so far. I can play H.264 files without any problems on my external player. But inside JavaFX I get the error for a format not supported:




I believe it can find my Gstreamer library because of the first message appearing to be an warning from GStreamer itself. But I may be wrong. How do I know if JavaFX is really finding and using my Gstreamer library?


This is my small code:




Thank you in advance.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19693
    
  20

Welcome to the Ranch!

I think you're right in your conclusion that GStreamer is found properly. It seems like it's throwing the actual error, which is then converted into a Java Exception.
You are able to play a different file. Can you also:
1) play that different file after downloading it and using file:// to reference it?
2) play the problematic file after uploading it to a web server and using http:// to reference it?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ricardo Capp
Greenhorn

Joined: Jan 16, 2011
Posts: 4
Rob Prime wrote:Welcome to the Ranch!

I think you're right in your conclusion that GStreamer is found properly. It seems like it's throwing the actual error, which is then converted into a Java Exception.
You are able to play a different file. Can you also:
1) play that different file after downloading it and using file:// to reference it?


Yes. I can play elephants-dream-640x352.flv using file:// . According to mplayer, this is an VP6 with mp3.



2) play the problematic file after uploading it to a web server and using http:// to reference it?


Using another h.264 video leads to the same problem, with both file:// and http:// :




I tried another container (an avi file. haven't tried ogg) and it can't play it too. As far as I know, JavaFX can only deal with FLV containers, but with your system plugins it can deal with other formats. Correct me if I'm wrong.


Thank you in advance!

Ricardo Capp
Greenhorn

Joined: Jan 16, 2011
Posts: 4
Updating:


We´ve gave up on using JavaFX (deadline was really near) and used an mplayer controller instead. We´ve come to this approach a couple of weeks ago. As soon as possible, I will see if I can post our code or at least how to get trough it.


Cheers and thank you!
Alexandre Eiras
Greenhorn

Joined: May 19, 2011
Posts: 1
Hi Ricardo,

You can post your example with mplayer? I want to use JavaFX, but I have the same problem.

Thank you
Ricardo Capp
Greenhorn

Joined: Jan 16, 2011
Posts: 4
Alexandre Eiras wrote:Hi Ricardo,

You can post your example with mplayer? I want to use JavaFX, but I have the same problem.

Thank you



Hi there, Alexandre. I hope this is still useful for you.

In this example I created a Swing project in Netbeans and used a form to build the interface. This example is really simple and has 3 main files - Player.java, OpenFile.java and the Cointaner.java (for the form)


Here, we will be able only to open the file, not to read any particular information about the media file.




Then, we need the file chooser/"opener" for this basic player:




At last, the Container. I'm ommiting the Conatiner.form.






And if you wish to catch media information, such as duration, you have use something like this:




One thing we found a little hard to implement was the progress bar. For that, we had to create a Listener. If you have some trouble creating it, I can try to help you. I hope this will help you, and I'm sorry for taking too long to answer your post.

Take care,
Ricardo



[Thumbnail for mplayer-java.png]

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JavaFX vs H.264 on Linux