• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

JavaFX vs H.264 on Linux

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 22796
131
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ricardo Capp
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
mplayer-java.png
[Thumbnail for mplayer-java.png]
Screenshot
 
If somebody says you look familiar, tell them you are in porn. Or in these tiny ads:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic