Page 1 of 1
Java and VLC - JVLC
Posted: 27 Oct 2005 12:01
by spirit110
I'm trying to use the JVLC on Windows, but nothing seems to work. I'm pretty much a newbie when it comes to stuff like this and any help or hints would be most appreciated. I've been using JMF (Java Media Framwork) but it's too slow and on Linux platforms (with slow GPUs) the playback performance is too bad.
JVLC sample
Posted: 18 Nov 2005 09:24
by enlopez
I succeeded in having a running program that uses the java-gcj bindings in vlc 0.8.4 to stream and display a video on the screen. I just added some code to the VlcClient.java program to do my tests. Here is the code:
public class VlcClient {
public static void main(String[] args) {
JVLC vlc = new JVLC(args);
System.out.println(vlc.getVersion());
// Specify streaming options:
// - Use mp4v for video, mp3 for audio, etc.
// - Send the stream via RTP to X.X.X.X:1234
// - Display the stream on the screen also
String[] options = new String[1];
options[0] = ":sout=#transcode{vcodec=mp4v,vb=1024,scale=1,acodec=mp3,ab=192,channels=2}:duplicate{dst=std{access=rtp,mux=ts,url=127.0.0.1:1234},dst=display}";
// Specify the file to stream
String input = "./vts_16_1.vob";
// Add the file to the playlist. See documentation for the
// VLC_AddTarget function in the library libvlc.
vlc.addTarget(input, options, 1, -666);
// Display the inteface and start playing the video
vlc.addInterface(true, true);
vlc.die();
vlc.cleanUp();
}
}
Note that I had to change one line in the JVLC::addTarget function in vlc-glue.cc because I was getting a null pointer exception when calling addTarget:
//char** ppsz_options = NULL;
int options_number = 0;
char* ppsz_options[options_number];
Enrique
Posted: 18 Nov 2005 21:08
by Waruwaru
Hello Enrique,
Good to hear you got the binding to work. What system do you have? I didn't have much luck compiling the binding on Cygwin. Maybe I don't have the proper version of the GCJ/GCC installed or something.
Thanks,
Waruwaru
Posted: 07 Sep 2006 10:19
by spiridonas
hello enlopez
I have a few questions:
1) what OS you are using?, is it possible to do this on windows Platform...I know that for Linux is possible!
2) Can you post the whole project source code or upload it somewhere?
Best Regards
Spirus
Posted: 13 Sep 2006 16:27
by phmorin
Hello,
JVLC is working on both win32 and Linux.
You can get a working copy at the main page of the project.
Check
http://trac.videolan.org/jvlc
This is still a developer release. You must be familiar with Java ( compiling and executing
a program with an installed JDK or JRE) and follow the README instructions for settings
the execution environment.
If you can compile VLC on Cygwin, you can compile JVLC.
You must take care of setting a JAVA_HOME variable before compiling the bindings
and some other little things.
The next version will hopefully be more end-user friendly.
Philippe,
Posted: 14 Sep 2006 09:39
by spiridonas
Hi
I think ypou miss understood....maybe I wasnt clear....my problem comes with the :sout...etc command where I want to stream a file...But as i can understand I smust alter the vlc-glue.cc file as mentioned above....
Thank you for your reply
Best Regards
Spiros