aspose file tools*
The moose likes Java in General and the fly likes playing video java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "playing video java" Watch "playing video java" New topic
Author

playing video java

Brandon Broschinsky
Ranch Hand

Joined: Aug 21, 2004
Posts: 41
I have an application in which i want to embed a video inside the swing component. I am trying to figure out the best way to play video, I have looked at JMF but am having problems with it not having the right codec for files i can play with vlc, or mplayer. I noticed that vlc does provide ways to embed their player in a java application but can not get it to work, and have not been able to find any resources on the web. I am getting errors with the bindings i believe, any help or suggestions on the best way to play video would be appreciated. I would like to be able to do so in linux and win.

thanks,
Manuel Moons
Ranch Hand

Joined: Mar 05, 2002
Posts: 229
I did this once using JMF. I noticed that I could play everything that my Windows MediaPlayer could play. So on Windows I suppose it uses that Windows Media Player.
Does the video you are referring to play in WMP? Maybe that is your problem.

I suppose the VM on Linux should map the JMF calls to the correct player too but I have never tried that.

As for VLC! I integrated it once in an HTML page using an activex control and that worked perferctly (I addressed it using javascript) but never integrated it in a Java app.
Brandon Broschinsky
Ranch Hand

Joined: Aug 21, 2004
Posts: 41
thanks for the reply, I am using some .avi files from my digicam, and they play fine using wma, mplayer, etc. but JMF says that the header is the wrong size something about only being 48 when 52 was expected, i'm not at that machine right now. When using vlc, I am trying to use the JVLC bindings. But is says that i do not have jvlc in my java path, i have tried compiling them but still have errors, I would prefer to go with JMF as that will allow my application to be more os independant. Any help on how you used vlc in your app would be appreciated.

thanks,
Manuel Moons
Ranch Hand

Joined: Mar 05, 2002
Posts: 229
For the JVLC error you need to add jvlc in your java.library.path
You can do this by passing it to the java command
eg.
java SwingClient -Djava.library.path=D:\jvlc
 
Consider Paul's rocket mass heater.
 
subject: playing video java