Installing JVLC on Windows XP
Prerequisites
- Having a Java JRE installed on your system. JRE 1.5 (or better).
- Download JVLC for win32.
- Unzip the zip file in the directory of your choice.
- Patch with the following patch-jvlc-0.9.0-20070310.zip. You will find updated VlcClient classes files.
For this explanation, I suppose that the ZIP file has been unzipped in
C:\jvlc-0.9.0-20070310.
You can safely choose another directory but please be sure to change the paths accordingly
when reading this guide :-).
After unzipping, you can start testing JVLC.
Testing the install
Open a command console.
Start button > Execute > cmd.
Change directory to where JVLC is installed issuing the following command :
cd C:\jvlc-0.9.0-20070310
Then try to launch the VLCExample :
C:\jvlc-0.9.0-20070310>"C:\Program Files\Java\jre1.6.0_01\bin\java.exe" -cp . VLCExample
You should get the following output in your console :
== Starting VLCExample ==
Creating a JVLC instance without args... done.
[00000302] access_directory access error: /home/little/a.avi: No such file or directory
[00000302] access_file access error: cannot open file /home/little/a.avi (No such file or directory)
[00000300] main input error: open of `file:///home/little/a.avi' failed: could not create access
Unfortunately, the input sample file is hardcoded so the example is not working well.
You can quit typing Ctrl C.
Let's try the second example.
In the console, type :
C:\jvlc-0.9.0-20070310>"C:\Program Files\Java\jre1.6.0_01\bin\java.exe" -cp . VlcClient.
The following window should appear.
VlcClient is a very basic player. You enter the location of a file to play using an
URI ( the "file:///home/little/a.avi" ).
Replace the value in the text field with a better one.
For a file on your C: disk, type
file://C:\mydirectory\myvideo.avi
Then you click on Set item. This should start the video.
[Please note the this version seems to have a problem with .mov (Quicktime) files.
Current version of JVLC does not have this problem but you have to compile it
from scratch and this is not part of this document.]
It works fine for an mp3 file.
Developping with JVLC
After testing the installation, you may want to use JVLC to code some more interesting player or
everything else requiring the use of video and/or audio.
You need to create a jar file which contains the classes of JVLC.
It is not distributed in the zip file so you have to build it from class files.
Here is a version of
jvlc.jar.
Open a console.
cd C:\jvlc-0.9.0-20070310
Creating and running a small example with Eclipse 3.2.
Create an empty project named JVLC .
Import
JVLCTest.java. Import jvlc.jar into the project.
Show project Properties and add jvlc.jar to the "Libraries" tab.
Configure Run target of JVLCTest by settings parameters in Arguments tab ( VM arguments ) .
-Djava.library.path=C:\jvlc-0.9.0-20070310
The System.loadLibrary() call seems to be compulsory on Eclipse environment to have it loading the .dll.
This is the way Eclipse works when running programs. Executing java program runs differently in console.
As you can see before, it is optional for running outside Eclipse.
I do not have a better answer for now.
VLM
When playing a video or an audio file (without VLM interface), there is no call to VLM.
What may happen is that you have VLC installed on your computer and you made VLM calls.
As the VLC (libvlc.dll) shipped with JVLC and the one installed on your computer will share
the same configuration file, you should clear it before running you test.
You can use the --reset-config parameter to JVLC.
Windows Vista
Someone told me that a new version of Windows has been released under the name of Windows Vista.
Currently, I only have the laptop lent by my boss which runs under Windows XP Pro.
As a result, I have never tested JVLC on Windows Vista.
What's next ?
We currently do not have a way to build a regular JVLC distribution.
For experimented developer, building an own distribution is the best way to be in touch
with current development.
评论