JVLC .jar for windows

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
CamHart
New Cone
New Cone
Posts: 7
Joined: 28 Jul 2008 20:46

JVLC .jar for windows

Postby CamHart » 29 Jul 2008 23:45

Edit: Read further on to see what I've taught myself in the time waiting for you to reply, however I'm still having problems so don't go away :D!

If I'm posting this in the wrong spot I'm sorry, and please feel free to move it. I'm a bit new to this whole thing, probably not qualified enough to be attempting what I'm doing... But I've got the newest .jar file for jvlc downloaded, and I'm trying to get some of the sample code players to run for me but I'm having some problems. My friend says that the .jar file needs to be updated for windows because it's broken atm.

Here's the files I've got.

Complile.bat

Code: Select all

javac -classpath jvlc.jar; *.java pause
Run.bat

Code: Select all

java -cp jvlc.jar; VlcClient Pause
VlcClient.java (this is the sample code)

Code: Select all

import java.awt.Canvas; import java.awt.Frame; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.JPanel; import org.videolan.jvlc.JVLC; import org.videolan.jvlc.Playlist; import org.videolan.jvlc.VLCException; class VLCPlayerFrame extends Frame { private Playlist playlist; public Canvas jvcanvas; public VLCPlayerFrame() { initComponents(); } private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; fullScreenButton = new javax.swing.JButton(); jTextField1 = new javax.swing.JTextField(); setButton = new javax.swing.JButton(); pauseButton = new javax.swing.JButton(); stopButton = new javax.swing.JButton(); jvcc = new JPanel(); jvcanvas = new java.awt.Canvas(); jvcanvas.setSize(200, 200); jvcc.add(jvcanvas); jvlc = new JVLC(); playlist = new Playlist(jvlc); setLayout(new java.awt.GridBagLayout()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = java.awt.GridBagConstraints.CENTER; gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; add(jvcc, gridBagConstraints); fullScreenButton.setText("FullScreen"); fullScreenButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { fullScreenButtonActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; add(fullScreenButton, gridBagConstraints); jTextField1.setText("file://a.avi"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; add(jTextField1, gridBagConstraints); setButton.setText("Set item"); setButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { setButtonActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; add(setButton, gridBagConstraints); pauseButton.setText("Play/Pause"); pauseButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { pauseButtonActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; add(pauseButton, gridBagConstraints); stopButton.setText("Stop"); stopButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { stopButtonActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; add(stopButton, gridBagConstraints); pack(); } private void stopButtonActionPerformed(java.awt.event.ActionEvent evt) { try { playlist.stop(); } catch (Exception e) { e.printStackTrace(); } } private void pauseButtonActionPerformed(java.awt.event.ActionEvent evt) { try { playlist.togglePause(); } catch (Exception e) { e.printStackTrace(); } } private void setButtonActionPerformed(java.awt.event.ActionEvent evt) { try { jvlc.setVideoOutput(jvcanvas); playlist.add(jTextField1.getText(), "a.avi"); playlist.play(); } catch (VLCException e) { // TODO Auto-generated catch block e.printStackTrace(); } } private void fullScreenButtonActionPerformed(java.awt.event.ActionEvent evt) { // jvlc.fullScreen(); } private javax.swing.JButton setButton; private javax.swing.JButton pauseButton; private javax.swing.JButton stopButton; private javax.swing.JButton fullScreenButton; private javax.swing.JTextField jTextField1; private JPanel jvcc; public JVLC jvlc; // MediaControlInstance mci; } public class VlcClient { public static void main(String[] args) { Frame f = new VLCPlayerFrame(); f.setBounds(0, 0, 500, 500); f.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent ev) { System.exit(0); } }); f.setVisible(true); } }
Compiling seems to work just fine. But when I run it it spits out this error

Code: Select all

G:\Documents and Settings\Cameron\Desktop\CHMP>java -cp jvlc.jar; VlcClient Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load librar y 'libvlc': The specified module could not be found. at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:114) at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:157) at com.sun.jna.Library$Handler.<init>(Library.java:123) at com.sun.jna.Native.loadLibrary(Native.java:260) at com.sun.jna.Native.loadLibrary(Native.java:246) at org.videolan.jvlc.internal.LibVlc.<clinit>(LibVlc.java:41) at org.videolan.jvlc.JVLC.<init>(JVLC.java:45) at VLCPlayerFrame.initComponents(VlcClient.java:41) at VLCPlayerFrame.<init>(VlcClient.java:22) at VlcClient.main(VlcClient.java:192)
Any and all help is appreciated.

Edit: Okay so I was talking to another guy and he said I needed to add libvlc.dll file to the directory. So I did, and out comes this shibby.

Code: Select all

G:\Documents and Settings\Cameron\Desktop\CHMP>java -cp jvlc.jar; VlcClient # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x62e5428a, pid=1676, tid=2852 # # Java VM: Java HotSpot(TM) Client VM (1.6.0_03-b05 mixed mode, sharing) # Problematic frame: # C [libvlc.dll+0x9428a] # # An error report file with more information is saved as hs_err_pid1676.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp #
Error log shows this

Code: Select all

# # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x62e5428a, pid=1676, tid=2852 # # Java VM: Java HotSpot(TM) Client VM (1.6.0_03-b05 mixed mode, sharing) # Problematic frame: # C [libvlc.dll+0x9428a] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x002a6400): JavaThread "main" [_thread_in_native, id=2852] siginfo: ExceptionCode=0xc0000005, reading address 0x010a01d3 Registers: EAX=0x03252a78, EBX=0x00000003, ECX=0x00000003, EDX=0x00000003 ESP=0x0090eeac, EBP=0x0090f034, ESI=0x010a01d3, EDI=0x62f49960 EIP=0x62e5428a, EFLAGS=0x00210206 Top of Stack: (sp=0x0090eeac) 0x0090eeac: 62f49963 02dc0178 03254e08 03254de0 0x0090eebc: 00000002 02dc0178 00000008 03254e10 0x0090eecc: 00000000 000a0008 0000000d 02dc0178 0x0090eedc: 03254dd0 0090eef0 02dc0178 7c910098 0x0090eeec: 03254df8 0090ef00 00000000 7c910098 0x0090eefc: 03250fc0 0090efcc 7c910021 02dc0718 0x0090ef0c: 7c91003d 00000002 03250fc8 03250fb0 0x0090ef1c: 006f0072 00720067 006d0061 00460020 Instructions: (pc=0x62e5428a) 0x62e5427a: b9 03 00 00 00 8b 45 0c bf 60 99 f4 62 8b 34 90 0x62e5428a: f3 a6 0f 85 1c 04 00 00 8b 15 48 54 02 63 8b 0d Stack: [0x008c0000,0x00910000), sp=0x0090eeac, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [libvlc.dll+0x9428a] C [libvlc.dll+0x95ad3] C [libvlc.dll+0x72222] C [libvlc.dll+0xe72e] C [libvlc.dll+0x8e501] C [jna59262.tmp+0x9377] C [jna59262.tmp+0x8f49] C [jna59262.tmp+0x2131] C [jna59262.tmp+0x26c0] j com.sun.jna.Function.invokePointer(I[Ljava/lang/Object;)Lcom/sun/jna/Pointer;+0 j com.sun.jna.Function.invoke([Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;+607 j com.sun.jna.Function.invoke(Ljava/lang/Class;[Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;+194 j com.sun.jna.Library$Handler.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+344 j com.sun.jna.Native$2.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+21 j $Proxy0.libvlc_new(I[Ljava/lang/String;Lorg/videolan/jvlc/internal/LibVlc$libvlc_exception_t;)Lorg/videolan/jvlc/internal/LibVlc$LibVlcInstance;+27 j org.videolan.jvlc.JVLC.createInstance([Ljava/lang/String;)Lorg/videolan/jvlc/internal/LibVlc$LibVlcInstance;+16 j org.videolan.jvlc.JVLC.<init>()V+19 j VLCPlayerFrame.initComponents()V+107 j VLCPlayerFrame.<init>()V+5 j VlcClient.main([Ljava/lang/String;)V+4 v ~StubRoutines::call_stub Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j com.sun.jna.Function.invokePointer(I[Ljava/lang/Object;)Lcom/sun/jna/Pointer;+0 j com.sun.jna.Function.invoke([Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;+607 j com.sun.jna.Function.invoke(Ljava/lang/Class;[Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;+194 j com.sun.jna.Library$Handler.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+344 j com.sun.jna.Native$2.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+21 j $Proxy0.libvlc_new(I[Ljava/lang/String;Lorg/videolan/jvlc/internal/LibVlc$libvlc_exception_t;)Lorg/videolan/jvlc/internal/LibVlc$LibVlcInstance;+27 j org.videolan.jvlc.JVLC.createInstance([Ljava/lang/String;)Lorg/videolan/jvlc/internal/LibVlc$LibVlcInstance;+16 j org.videolan.jvlc.JVLC.<init>()V+19 j VLCPlayerFrame.initComponents()V+107 j VLCPlayerFrame.<init>()V+5 j VlcClient.main([Ljava/lang/String;)V+4 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x02b0e800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=3864] 0x02b0d400 JavaThread "AWT-Shutdown" [_thread_blocked, id=1812] 0x02b0b000 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3440] 0x02a6cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=444] 0x02a69c00 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2252] 0x02a66c00 JavaThread "Attach Listener" daemon [_thread_blocked, id=460] 0x02a66000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=3744] 0x02a61800 JavaThread "Finalizer" daemon [_thread_blocked, id=3568] 0x02a5d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=3672] =>0x002a6400 JavaThread "main" [_thread_in_native, id=2852] Other Threads: 0x02a5c000 VMThread [id=3076] 0x02a6e400 WatcherThread [id=2768] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 960K, used 639K [0x22970000, 0x22a70000, 0x22e50000) eden space 896K, 64% used [0x22970000, 0x229ffeb0, 0x22a50000) from space 64K, 100% used [0x22a60000, 0x22a70000, 0x22a70000) to space 64K, 0% used [0x22a50000, 0x22a50000, 0x22a60000) tenured generation total 4096K, used 634K [0x22e50000, 0x23250000, 0x26970000) the space 4096K, 15% used [0x22e50000, 0x22eee8e0, 0x22eeea00, 0x23250000) compacting perm gen total 12288K, used 541K [0x26970000, 0x27570000, 0x2a970000) the space 12288K, 4% used [0x26970000, 0x269f7620, 0x269f7800, 0x27570000) ro space 8192K, 62% used [0x2a970000, 0x2ae714a8, 0x2ae71600, 0x2b170000) rw space 12288K, 52% used [0x2b170000, 0x2b7b7278, 0x2b7b7400, 0x2bd70000) Dynamic libraries: 0x00400000 - 0x00423000 G:\Program Files\Java\jre1.6.0_03\bin\java.exe 0x7c900000 - 0x7c9af000 G:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c8f6000 G:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e6b000 G:\WINDOWS\system32\ADVAPI32.dll 0x77e70000 - 0x77f02000 G:\WINDOWS\system32\RPCRT4.dll 0x77fe0000 - 0x77ff1000 G:\WINDOWS\system32\Secur32.dll 0x7c340000 - 0x7c396000 G:\Program Files\Java\jre1.6.0_03\bin\msvcr71.dll 0x6d7c0000 - 0x6da0a000 G:\Program Files\Java\jre1.6.0_03\bin\client\jvm.dll 0x7e410000 - 0x7e4a1000 G:\WINDOWS\system32\USER32.dll 0x77f10000 - 0x77f59000 G:\WINDOWS\system32\GDI32.dll 0x76b40000 - 0x76b6d000 G:\WINDOWS\system32\WINMM.dll 0x76390000 - 0x763ad000 G:\WINDOWS\system32\IMM32.DLL 0x629c0000 - 0x629c9000 G:\WINDOWS\system32\LPK.DLL 0x74d90000 - 0x74dfb000 G:\WINDOWS\system32\USP10.dll 0x6d310000 - 0x6d318000 G:\Program Files\Java\jre1.6.0_03\bin\hpi.dll 0x76bf0000 - 0x76bfb000 G:\WINDOWS\system32\PSAPI.DLL 0x6d770000 - 0x6d77c000 G:\Program Files\Java\jre1.6.0_03\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 G:\Program Files\Java\jre1.6.0_03\bin\java.dll 0x6d7b0000 - 0x6d7bf000 G:\Program Files\Java\jre1.6.0_03\bin\zip.dll 0x6d000000 - 0x6d1c3000 G:\Program Files\Java\jre1.6.0_03\bin\awt.dll 0x73000000 - 0x73026000 G:\WINDOWS\system32\WINSPOOL.DRV 0x77c10000 - 0x77c68000 G:\WINDOWS\system32\msvcrt.dll 0x774e0000 - 0x7761d000 G:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada8000 G:\WINDOWS\system32\uxtheme.dll 0x73760000 - 0x737ab000 G:\WINDOWS\system32\ddraw.dll 0x73bc0000 - 0x73bc6000 G:\WINDOWS\system32\DCIMAN32.dll 0x6d2b0000 - 0x6d303000 G:\Program Files\Java\jre1.6.0_03\bin\fontmanager.dll 0x10000000 - 0x1000d000 G:\Program Files\FlashGet\fgmgr.dll 0x763b0000 - 0x763f9000 G:\WINDOWS\system32\comdlg32.dll 0x5d090000 - 0x5d12a000 G:\WINDOWS\system32\COMCTL32.dll 0x7c9c0000 - 0x7d1d7000 G:\WINDOWS\system32\SHELL32.dll 0x77f60000 - 0x77fd6000 G:\WINDOWS\system32\SHLWAPI.dll 0x77c00000 - 0x77c08000 G:\WINDOWS\system32\VERSION.dll 0x771b0000 - 0x7725a000 G:\WINDOWS\system32\WININET.dll 0x77a80000 - 0x77b15000 G:\WINDOWS\system32\CRYPT32.dll 0x77b20000 - 0x77b32000 G:\WINDOWS\system32\MSASN1.dll 0x77120000 - 0x771ab000 G:\WINDOWS\system32\OLEAUT32.dll 0x773d0000 - 0x774d3000 G:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce83\comctl32.dll 0x74720000 - 0x7476c000 G:\WINDOWS\system32\MSCTF.dll 0x77b40000 - 0x77b62000 G:\WINDOWS\system32\apphelp.dll 0x755c0000 - 0x755ee000 G:\WINDOWS\system32\msctfime.ime 0x031d0000 - 0x031e9000 G:\Documents and Settings\Cameron\Local Settings\Temp\jna59262.tmp 0x62dc0000 - 0x63072000 G:\Documents and Settings\Cameron\Desktop\CHMP\libvlc.dll 0x71ab0000 - 0x71ac7000 G:\WINDOWS\system32\WS2_32.DLL 0x71aa0000 - 0x71aa8000 G:\WINDOWS\system32\WS2HELP.dll VM Arguments: java_command: VlcClient Launcher Type: SUN_STANDARD Environment Variables: JAVA_HOME=G:\Program Files\Java\jdk1.6.0_03 CLASSPATH=.;.;G:\PROGRA~1\JMF21~1.1E\lib\sound.jar;G:\PROGRA~1\JMF21~1.1E\lib\jmf.jar;G:\PROGRA~1\JMF21~1.1E\lib;G:\WINDOWS\java\classes;. PATH=PATH=PATH=PATH=G:\WINDOWS\System32;C:\Ant\bin;G:\Program Files\Java\jre1.6.0_03\bin;G:\C++\Bin;G:\Program Files\WinRAR;G:\WINDOWS\System32\Wbem;G:\WINDOWS\system32;G:\Program Files\QuickTime\QTSystem\;F:\Program Files\Java\jdk1.6.0_07\bin;C:\Ant\bin;G:\Program Files\Java\jre1.6.0_03\bin;G:\C++\Bin;G:\Program Files\WinRAR;G:\WINDOWS\System32\Wbem;G:\WINDOWS\system32;G:\Program Files\QuickTime\QTSystem\;F:\Program Files\Java\jdk1.6.0_07\bin;C:\Ant\bin;G:\Program Files\Java\jre1.6.0_03\bin;G:\C++\Bin;G:\Program Files\WinRAR;G:\WINDOWS\System32\Wbem;G:\WINDOWS\system32;G:\Program Files\QuickTime\QTSystem\;F:\Program Files\Java\jdk1.6.0_07\bin;G:\Program Files\MKVtoolnix USERNAME=Cameron OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 6, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 3 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 6, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 2095532k(1352032k free), swap 4033264k(3421472k free) vm_info: Java HotSpot(TM) Client VM (1.6.0_03-b05) for windows-x86, built on Sep 24 2007 22:24:33 by "java_re" with unknown MS VC++:1310
Last edited by CamHart on 30 Jul 2008 02:47, edited 1 time in total.

thannoy
Big Cone-huna
Big Cone-huna
Posts: 601
Joined: 20 Mar 2008 09:44
VLC version: 0.9.8a & 1.0-git
Operating System: GNU/Linux Fedora10
Location: France
Contact:

Re: JVLC .jar for windows

Postby thannoy » 30 Jul 2008 01:41

I have never used this module, but maybe you should try to give javac an additional path to search libraries into instead of moving libvlc. Maybe libvlc will search other VLC libraries (at runtime) with a path related to its location (thinking about plugins/*.dll ones).

To do it, try those lines (not tested):

Code: Select all

javac -classpath jvlc.jar "-Djava.library.path=c:\Program Files\Videolan\VLC" *.java
and

Code: Select all

java -cp jvlc.jar "-Djava.library.path=c:\Program Files\Videolan\VLC" VlcClient
You can also try to add directory containing libvlc.dll and/or the plugin folder into PATH environment variable.

CamHart
New Cone
New Cone
Posts: 7
Joined: 28 Jul 2008 20:46

Re: JVLC .jar for windows

Postby CamHart » 30 Jul 2008 02:16

I have never used this module, but maybe you should try to give javac an additional path to search libraries into instead of moving libvlc. Maybe libvlc will search other VLC libraries (at runtime) with a path related to its location (thinking about plugins/*.dll ones).

To do it, try those lines (not tested):

Code: Select all

javac -classpath jvlc.jar "-Djava.library.path=c:\Program Files\Videolan\VLC" *.java
and

Code: Select all

java -cp jvlc.jar "-Djava.library.path=c:\Program Files\Videolan\VLC" VlcClient
You can also try to add directory containing libvlc.dll and/or the plugin folder into PATH environment variable.

Code: Select all

G:\Documents and Settings\Cameron\Desktop\CHMP>javac -cp jvlc.jar "-Djava.librar y.path=G:\Program Files\Videolan\VLC" *.java javac: invalid flag: -Djava.library.path=G:\Program Files\Videolan\VLC Usage: javac <options> <source files> use -help for a list of possible options
Am I doing something wrong?

Code: Select all

javac -cp jvlc.jar "-Djava.library.path=G:\Program Files\Videolan\VLC" *.java pause
I added the plugin directory of VLC to my PATH in enviornmental variables and it spit out this old error

Code: Select all

G:\Documents and Settings\Cameron\Desktop\CHMP>java -classpath jvlc.jar; VlcClie nt Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load librar y 'libvlc': The specified module could not be found. at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:114) at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:157) at com.sun.jna.Library$Handler.<init>(Library.java:123) at com.sun.jna.Native.loadLibrary(Native.java:260) at com.sun.jna.Native.loadLibrary(Native.java:246) at org.videolan.jvlc.internal.LibVlc.<clinit>(LibVlc.java:41) at org.videolan.jvlc.JVLC.<init>(JVLC.java:45) at VLCPlayerFrame.initComponents(VlcClient.java:41) at VLCPlayerFrame.<init>(VlcClient.java:22) at VlcClient.main(VlcClient.java:192)
Added the VLC folder (thats where the dll i need is) to EV, spit this bad boy out again.

Code: Select all

G:\Documents and Settings\Cameron\Desktop\CHMP>java -classpath jvlc.jar; VlcClie nt # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x62e55535, pid=3168, tid=2140 # # Java VM: Java HotSpot(TM) Client VM (1.6.0_03-b05 mixed mode, sharing) # Problematic frame: # C [libvlc.dll+0x95535] # # An error report file with more information is saved as hs_err_pid3168.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp #

CamHart
New Cone
New Cone
Posts: 7
Joined: 28 Jul 2008 20:46

Re: JVLC .jar for windows

Postby CamHart » 30 Jul 2008 02:46

Okay so I was fiddling around a bit and decided to download the nightly build (like beta) of VLC Media player. I put that .dll file into the directory instead of the old on and stuff started to run (y). But now i can't seem to be able to open any files and this error keeps outputting.

Code: Select all

G:\Documents and Settings\Cameron\Desktop\CHMP>java -classpath jvlc.jar; VlcClie nt [00000001] main libvlc debug: VLC media player - version 0.9.0-test3-20080730-00 04 Grishenko - (c) 1996-2008 the VideoLAN team [00000001] main libvlc debug: libvlc was configured with ./configure '--enable- debug' '--host=i586-mingw32msvc' '--build=i386-linux' '--enable-shared-libvlc' ' --enable-sdl' '--with-sdl-config-path=/usr/win32/bin' '--disable-gtk' '--disable -hal' '--disable-libcdio' '--enable-nls' '--enable-skins2' '--enable-ffmpeg' '-- with-ffmpeg-mp3lame' '--with-ffmpeg-faac' '--with-ffmpeg-zlib' '--with-ffmpeg-co nfig-path=/usr/win32/bin' '--enable-faad' '--enable-flac' '--enable-theora' '--e nable-twolame' '--enable-dvdread' '--disable-vcdx' '--disable-cddax' '--enable-m ozilla' '- [00000001] main libvlc debug: translation test: code is "C" [00000001] main libvlc error: no memcpy module matched "any" [00000007] main access error: no access module matched "file" [00000006] main input error: open of `file/xspf-open://G:\Documents and Settings \Cameron\Application Data\vlc\ml.xspf' failed: could not create access: no acces s module matched "file" [00000010] main interface error: no interface module matched "hotkeys,none" [00000010] main interface error: no suitable interface module [00000001] main libvlc error: interface "hotkeys,none" initialization failed *** LibVLC Exception not handled: No active input Set a breakpoint in 'libvlc_exception_not_handled' to debug. [00000013] main access error: no access module matched "file" [00000011] main input error: open of `file://a.mpg' failed: could not create acc ess: no access module matched "file"
Any ideas?

thannoy
Big Cone-huna
Big Cone-huna
Posts: 601
Joined: 20 Mar 2008 09:44
VLC version: 0.9.8a & 1.0-git
Operating System: GNU/Linux Fedora10
Location: France
Contact:

Re: JVLC .jar for windows

Postby thannoy » 30 Jul 2008 02:55

--- For the not-last message ---
Have you tried this one ? (after having compiled without my -D.. parameter)

Code: Select all

java -cp jvlc.jar "-Djava.library.path=c:\Program Files\Videolan\VLC" VlcClient
If it works, you can add this option inside your code source (google java.library.path). I have added double quotes because of the space, you can try to mive the opening quote after the '='.

--- For the last message (nightly) ---
- yes, it is better than previous tests
- maybe it can't find VLC "plugin" directory (which contains module libraries for access, codecs and others)
- I find the URL you are opening quite weird : "file://a.mpg". what about "c:\\folders\\file.mpg" or "http://test.tld/fold/file.suffix"?
-> try to add the -Djava.library.path at launch time without using copied libvlc library
-> try to copy all VLC folder to keep names relative to libvlc.dll location usables

CamHart
New Cone
New Cone
Posts: 7
Joined: 28 Jul 2008 20:46

Re: JVLC .jar for windows

Postby CamHart » 30 Jul 2008 03:39

--- For the not-last message ---
Have you tried this one ? (after having compiled without my -D.. parameter)

Code: Select all

java -cp jvlc.jar "-Djava.library.path=c:\Program Files\Videolan\VLC" VlcClient
If it works, you can add this option inside your code source (google java.library.path). I have added double quotes because of the space, you can try to mive the opening quote after the '='.

--- For the last message (nightly) ---
- yes, it is better than previous tests
- maybe it can't find VLC "plugin" directory (which contains module libraries for access, codecs and others)
- I find the URL you are opening quite weird : "file://a.mpg". what about "c:\\folders\\file.mpg" or "http://test.tld/fold/file.suffix"?
-> try to add the -Djava.library.path at launch time without using copied libvlc library
-> try to copy all VLC folder to keep names relative to libvlc.dll location usables
Yea I tried it and it wouldn't even open up the program. I moved the quotes around into all positions that could possible make sense. I even installed VLC to a different directory so I didn't have to use quotes. When I did this, this is what the error was.

Code: Select all

G:\Documents and Settings\Cameron\Desktop\CHMP>java -cp jvlc.jar -Djava.library. path=f:\VLC VlcClient Exception in thread "main" java.lang.NoClassDefFoundError: VlcClient

chradev
New Cone
New Cone
Posts: 1
Joined: 30 Jul 2008 10:15

Re: JVLC .jar for windows

Postby chradev » 30 Jul 2008 11:23

Hi guys,

I try it and get success after following fixes:
* use of the same nightly build (20080727) - maybe not critical but version 0.9 is a must;
* add libvlc.dll location in the PATH variable;
* add to VlcClient code to init jvlc with args;
* add to args option "--plugin-path=path\\to\\plugins\\directory";

I build example under Eclipse 3.4 and even place both jvlc.jar and jna.jar into project's lib folder. Later on I place whole VLC staff into project's lib\native folder. Everything works fine even without "-Djava.library.path=..." argument in Run properties.

Code: Select all

String[] arg = new String[8]; arg[0] = "-vvv"; arg[1] = "--intf=dummy"; arg[2] = "--ignore-config"; arg[3] = "--no-plugins-cache"; arg[4] = "--plugin-path=.\\lib\\native\\plugins"; arg[5] = "--extraintf=http"; arg[6] = "--http-host=0.0.0.0:9999"; arg[7] = "--http-src=.\\lib\\native\\share\\http"; jvlc = new JVLC(arg);
add PATH variable into Run VlcClient as Java Application Configuration Environment Tab

Code: Select all

PATH=./lib/vlc_win32
It is needed by jna to find libvlc.dll in Windows. No other run arguments are needed.I'm not sure why -Djava.library.path=... does not work in a proper way without adding libvlc.dll location into the PATH variable.

It has to be added both jna.jar and jvlc-core-0.9.0-SNAPSHOT-20080727.jar in Project properties in Java Build Path Libraries Tab. It is good idea to put them into project's lib folder but it is not a must.

Unfortunately, it is not the best way because it is needed to put in the code or as run argument location of plugins. Is it a bug (probably for Windows) or it is not implemented in libvlc.dll to find plugins relatively to its own location?

In case of relative search for plugins is solved only PATH should be updated for Windows which is its problem in searching the libraries. No such a problem on Linux if Vlc is installed in a right way (libraries could be found by jna).

It is very important especially when multi-platform plugins for eclipse/equinox have to be developed. Any ideas how to automate jvlc/plugins development in eclipse and in a platform independent manner.

Regards
chradev

CamHart
New Cone
New Cone
Posts: 7
Joined: 28 Jul 2008 20:46

Re: JVLC .jar for windows

Postby CamHart » 30 Jul 2008 19:35

I got mine working in a smiliar way by simply adding

Code: Select all

String[] args = new String[] { "-vvv", "--plugin-path=g:\\Program Files\\VideoLAN\\VLC\\plugins" }; jvlc = new JVLC(args); //replacing --> jvlc = new JVLC();

saurabh
Blank Cone
Blank Cone
Posts: 25
Joined: 05 Aug 2008 08:19
Operating System: Linux
Location: Pune, India

Re: JVLC .jar for windows

Postby saurabh » 13 Aug 2008 09:44

Hey folks..
I have some problem running it on winxp..
Did u set any environment variables in system...
Let me kno or I will c wht is wrong here.....
Thanks...


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 35 guests