Hi,
First of all, I apologize because I didn’t tell you some guideline when you are planning to compile and have JVLC working:
1- You need set setup couple of coffee cubs near you.
2- If you are smoker, then you need to buy some packages for this process.
3- Do the compilation and configuration while you are in closed room, because if any compilation error maybe you will harm one of your family.
Kidding stoped.
Now, if you are interesting of having working JVLC, then it is better to download the current one that is a viable at website
http://phmorin.free.fr/jvlc-win32-060612.zip
This one is working pretty fine in windows (although it has bugs).
I recommend using the latest sun java development kit, the latest one is JDK 6
http://java.sun.com/javase/downloads/index.jsp
Then, the required files from the downloaded package are
1- org directory
2- plugins directory
3- and JVLC.DLL
That is all.
Now you need to have some experience to make and compile java application.
Ok, no problem, I will explain more.
If you are using Netbeans(Netbeans.org) for java development,
Crate new project, for example (jvlcproject). Then this project will be created in the following directory( by default)
C:\Documents and Settings\(your windows user name)\ jvlcproject
Then,
Copy the plugins directory + jvlc.dll to the following directory
C:\Documents and Settings\(your windows user name)\ jvlcproject
Then,
Copy the org directory to the following directory
C:\Documents and Settings\(your windows user name)\ jvlcproject\src\ jvlcproject
Then at your main class, do the following code for example
package jvlcproject;
import java.awt.Frame;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import org.videolan.jvlc.JVLC;
import org.videolan.jvlc.VLCException;
public class Main
{
public Main()
{
}
public static void main( String[] Args )
{
String[] args = new String[1];
args[0] = "-vvv";
boolean videoInput = false;
JVLC jvlc = new JVLC(Args);
try
{
jvlc.playlist.add("file://c:\\a.avi", "a.avi");
jvlc.playlist.add("file://c:\\c.avi", "c.avi");
jvlc.playlist.play( -1 , null );
}
catch (VLCException e)
{
e.printStackTrace();
}
while (! jvlc.isInputPlaying()) ;
while (! jvlc.hasVout() );
try
{
Thread.sleep(2500);
if (jvlc.hasVout()) videoInput = true;
}
catch (InterruptedException e)
{
e.printStackTrace();
}
if (videoInput)
{
try
{
System.out.print(jvlc.video.getWidth());
System.out.print("x");
System.out.println(jvlc.video.getHeight());
}
catch (VLCException e)
{
e.printStackTrace();
}
}
try
{
if (videoInput)
{
System.out.print("Fullscreen... ");
jvlc.video.setFullscreen(true);
Thread.sleep(3000);
System.out.println("real size.");
jvlc.video.setFullscreen(false);
System.out.print("Taking snapshot... ");
jvlc.video.getSnapshot( System.getProperty( "user.dir" ) + "/snap.png");
System.out.println("taken. (see " + System.getProperty( "user.dir" ) + "/snap.png )");
Thread.sleep(2000);
System.out.println("Resizing to 300x300");
jvlc.video.setSize(300, 300);
}
System.out.print("Muting...");
jvlc.audio.setMute(true);
Thread.sleep(3000);
System.out.println("unmuting.");
jvlc.audio.setMute(false);
Thread.sleep(3000);
System.out.println("Volume is: " + jvlc.audio.getVolume());
System.out.print("Setting volume to 150... ");
jvlc.audio.setVolume(150);
System.out.println("done");
Thread.sleep(3000);
System.out.println("INPUT INFORMATION");
System.out.println("-----------------");
System.out.println("Total length (ms) :\t" + jvlc.input.getLength());
System.out.println("Input time (ms) :\t" + jvlc.input.getTime());
System.out.println("Input position [0-1]:\t" + jvlc.input.getPosition());
if (videoInput)
System.out.println("Input FPS :\t" + jvlc.input.getFPS());
}
catch (Exception e)
{
System.out.println("Something was wrong. I die .");
jvlc.destroy();
}
System.out.println("Everything fine ");
System.out.println("Playing next item");
try
{
jvlc.playlist.next();
}
catch (VLCException e)
{
e.printStackTrace();
}
try
{
Thread.sleep(3000);
}
catch (InterruptedException e)
{
e.printStackTrace();
}
jvlc.destroy();
return;
}
}
According these process, the you have successfully using JVLC with your java application.
Regards,
Ahmad.
Hello Ahmad,hi,
first of all, you need to put at your mind that the JVLC is not stable at windows.
for your problem, you need to ensure that the JVLC.DLL and plugins directory is the same directory of your project. and what is the tool you are using to develop Java. some tools they don't consider the classPath correctly.
anyway, for people that interesting in JVLC, i have build stable one, and i am now at testing stage. but i don't know how to uploaded to somewhere to make it a viable for all.
regards,
Ahmad.
Return to “VLC media player for Windows Troubleshooting”
Users browsing this forum: No registered users and 31 guests