JVLC Vista

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.
mkeuschn
Blank Cone
Blank Cone
Posts: 16
Joined: 10 Apr 2007 19:30

JVLC Vista

Postby mkeuschn » 08 Aug 2008 14:17

Hello *,

I have compiled vlc(0.9.0) for my jvlc project with following configure options:

Code: Select all

PATH=/usr/win32/bin:$PATH \ PKG_CONFIG_PATH=/usr/win32/lib/pkgconfig \ CPPFLAGS="-I/usr/win32/include -I/usr/win32/include/ebml" \ LDFLAGS=-L/usr/win32/lib \ CC="gcc -mno-cygwin -Wl,--add-stdcall-alias" CXX="g++ -mno-cygwin -Wl,--add-stdcall-alias" \ ./configure \ --host=i686-pc-mingw32 \ --disable-gtk \ --enable-nls --enable-sdl --with-sdl-config-path=/usr/win32/bin \ --enable-ffmpeg --with-ffmpeg-mp3lame --with-ffmpeg-faac \ --with-ffmpeg-zlib --enable-faad --enable-flac --enable-theora \ --with-wx-config-path=/usr/win32/bin \ --with-freetype-config-path=/usr/win32/bin \ --with-fribidi-config-path=/usr/win32/bin \ --enable-live555 --with-live555-tree=/usr/win32/live.com \ --enable-caca --with-caca-config-path=/usr/win32/bin \ --with-xml2-config-path=/usr/win32/bin \ --with-dvdnav-config-path=/usr/win32/bin \ --disable-cddax --disable-vcdx --enable-goom \ --enable-twolame --enable-dvdread \ --enable-debug --enable-dca \ --disable-mkv --disable-taglib \ --disable-optimizations \ --enable-debug \ --enable-qt4
when I try the example provided by the java jar file from the jvlc page, with my own compiled vlc version, I got following error:

Code: Select all

== Starting VLCExample == Creating a JVLC instance with args: 0) C:\11-eclipseWorkspace\test-videos\t-en.mpg Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'libvlc': Das angegebene Modul wurde nicht gefunden. 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 at.org.videolan.jvlc.internal.LibVlc.<clinit>(LibVlc.java:41) at at.org.videolan.jvlc.JVLC.<init>(JVLC.java:45) at at.org.videolan.jvlc.example.VLCExample.main(VLCExample.java:29)
when I use the binary version(0.8.6i) from the vlc page I got following error:

Code: Select all

== Starting VLCExample == Creating a JVLC instance with args: 0) C:\11-eclipseWorkspace\test-videos\t-en.mpg [00000018] main interface error: no interface module matched "hotkeys,none" [00000018] main interface error: no suitable interface module [00000001] main private error: interface "hotkeys,none" initialization failed ... done. Exception in thread "main" java.lang.UnsatisfiedLinkError: Error looking up function 'libvlc_media_new': Die angegebene Prozedur wurde nicht gefunden. at com.sun.jna.Function.<init>(Function.java:126) at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:219) at com.sun.jna.Library$Handler.invoke(Library.java:191) at com.sun.jna.Native$2.invoke(Native.java:583) at $Proxy0.libvlc_media_new(Unknown Source) at at.org.videolan.jvlc.MediaDescriptor.<init>(MediaDescriptor.java:49) at at.org.videolan.jvlc.example.VLCExample.main(VLCExample.java:32)
Something is wrong with my self created binary can anyone provide a binary which is working or can anyone tell which is wrong with my compilation (I have used the instructions from this site http://wiki.videolan.org/Win32CompileCygwinNew).

cheers,
mkeuschn

mkeuschn
Blank Cone
Blank Cone
Posts: 16
Joined: 10 Apr 2007 19:30

Re: JVLC Vista

Postby mkeuschn » 08 Aug 2008 15:14

With the nightly build I got following error:

Code: Select all

== Starting VLCExample == Creating a JVLC instance with args: 0) C:\11-eclipseWorkspace\test-videos\t-en.mpg [00000001] main libvlc debug: VLC media player - version 0.9.0-test3-20080727-0004 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-config-path=/usr/win32/bin' '--enable-faad' '--enable-flac' '--enable-theora' '--enable-twolame' '--enable-dvdread' '--disable-vcdx' '--disable-cddax' '--enable-mozilla' '- [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://C:\Users\MrsMojo\AppData\Roaming\vlc\ml.xspf' failed: could not create access: no access 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 ... done. [00000013] main access error: no access module matched "any" [00000011] main input error: open of `C:/11-eclipseWorkspace/test-videos/t-en.mpg' failed: could not create access: no access module matched "any" log4j:WARN No appenders could be found for logger (org.videolan.jvlc.event.MediaPlayerCallback). log4j:WARN Please initialize the log4j system properly. An error has occurred.

mkeuschn
Blank Cone
Blank Cone
Posts: 16
Joined: 10 Apr 2007 19:30

Re: JVLC Vista

Postby mkeuschn » 08 Aug 2008 17:29

I have solved the problem with following thread: viewtopic.php?f=14&t=48627&p=155194&hil ... ll#p155194.

Now I have another problem: when I try to call jvlc.setVideoOutput() I got following error:

Code: Select all

[00000001] main libvlc debug: VLC media player - version 0.9.0-test3-20080727-0004 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-config-path=/usr/win32/bin' '--enable-faad' '--enable-flac' '--enable-theora' '--enable-twolame' '--enable-dvdread' '--disable-vcdx' '--disable-cddax' '--enable-mozilla' '- [00000001] main libvlc debug: translation test: code is "C" Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Component must be displayable at com.sun.jna.Native.getComponentID(Native.java:159) at org.videolan.jvlc.JVLC.setVideoOutput(JVLC.java:90) at at.uniklu.unikluni.client.gui.JVLCCanvas.<init>(JVLCCanvas.java:32) at at.uniklu.unikluni.client.gui.JVLCPanel.<init>(JVLCPanel.java:37) at at.uniklu.unikluni.client.gui.WorkingFrame.addControls(WorkingFrame.java:144) at at.uniklu.unikluni.client.gui.WorkingFrame.<init>(WorkingFrame.java:68) at at.uniklu.unikluni.client.gui.JVLCMain$1.run(JVLCMain.java:62) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)

mkeuschn
Blank Cone
Blank Cone
Posts: 16
Joined: 10 Apr 2007 19:30

Re: JVLC Vista

Postby mkeuschn » 08 Aug 2008 17:59

I have this problems with following code:

Code: Select all

package at.uniklu.unikluni.client.gui; import java.awt.Canvas; import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JPanel; import org.videolan.jvlc.Audio; import org.videolan.jvlc.JVLC; import org.videolan.jvlc.MediaDescriptor; import org.videolan.jvlc.MediaPlayer; import org.videolan.jvlc.Video; import at.uniklu.unikluni.client.listener.ClientMediaPlayerListener; public class JVLCPanel extends JComponent { private static final long serialVersionUID = -3316671696374369195L; private static final String[] vlcArguments = new String[] {"--plugin-path=lib\\plugins"}; private Video video; private Audio audio; private MediaDescriptor mediaDescriptor; private MediaPlayer player; private JVLC jvlc; private JVLCCanvas jvlcCanvas; /** * Constructor. * @param source (e.g.: "C:/11-eclipseWorkspace/test-videos/t-en.mpg") * @param number * @param width * @param height */ public JVLCPanel(String source, int width, int height) { super(); super.setSize(width, height); //jvlcCanvas = new JVLCCanvas(width, height); //jvlcCanvas.setVisible(true); //this.add(jvlcCanvas); Canvas jvcc = new Canvas(); jvcc.setSize(width, height); jvcc.setVisible(true); this.add(jvcc); //jvlc = jvlcCanvas.getJVLC(); jvlc = new JVLC(vlcArguments); mediaDescriptor = new MediaDescriptor(jvlc, source); player = mediaDescriptor.getMediaPlayer(); //player.addListener(new ClientMediaPlayerListener()); video = new Video(jvlc); audio = new Audio(jvlc); // video.setSize(width, height); jvlc.setVideoOutput(jvcc); this.play(); } /** * Set new source to play. * @param source */ public void setSource(String source) { mediaDescriptor = new MediaDescriptor(jvlc, source); stop(); player = null; player = mediaDescriptor.getMediaPlayer(); } /** * Start player. */ public void play() { player.play(); } /** * Stop player. */ public void stop() { player.stop(); } /** * Set mute. * @param mute */ public void setMute(boolean mute) { audio.setMute(mute); } /** * Set volume. * @param volume */ public void setVolume(int volume) { audio.setVolume(volume); } /** * Return JVLC. * @return */ public JVLC getJVLCObject() { return jvlc; } /** * Set window size. */ public void setSize(int width, int height) { super.setSize(width, height); video.setSize(width, height); } public static void main (String[] args) { JVLCPanel jp = new JVLCPanel("C:/11-eclipseWorkspace/test-videos/t-en.mpg", 640, 480); jp.setVisible(true); JVLCPanel jp2 = new JVLCPanel("C:/11-eclipseWorkspace/test-videos/t-en.mpg", 640, 480); jp2.setVisible(true); JFrame jf = new JFrame("test"); jf.add(jp); jf.add(jp2); jf.setVisible(true); } }

joost
New Cone
New Cone
Posts: 1
Joined: 15 Aug 2008 11:24

Re: JVLC Vista

Postby joost » 15 Aug 2008 11:55

Hi mkeuschn!

It's good to know that I'm not the only one suffering from these problems. I encountered exactly the same errors and exceptions as you did and got stuck with the "java.lang.IllegalStateException: Component must be displayable" exception. Did you conquer this issue yet?

The code that gives me headache is:

Code: Select all

import java.awt.Canvas; import java.awt.Frame; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.awt.SWT_AWT; import org.videolan.jvlc.JVLC; import org.videolan.jvlc.MediaDescriptor; import org.videolan.jvlc.MediaPlayer; public class SWTVideoControl { private MediaPlayer mediaPlayer; public SWTVideoControl(Composite parent) { Frame awtFrame = SWT_AWT.new_Frame(parent); awtFrame.setVisible(true); awtFrame.setSize(150, 150); // just for testing addVLCcomponent(awtFrame); } public void startVideo() { mediaPlayer.play(); } private void addVLCcomponent(Frame awtFrame) { String[] args = new String[4]; args[0] = "-vvv"; args[1] = "--intf=dummy"; //arg[2] = "--ignore-config"; args[2] = "--no-plugins-cache"; args[3] = "--plugin-path=C:\\Program Files\\VideoLAN\\VLC\\plugins"; JVLC jvlc = new JVLC(args); Canvas awtCanvas = new Canvas(); awtCanvas.setSize(150, 150); // just for testing awtCanvas.setVisible(true); System.out.println(awtCanvas.isVisible()); // results in true jvlc.setVideoOutput(awtCanvas); awtFrame.add(awtCanvas); MediaDescriptor mediaDescriptor = new MediaDescriptor(jvlc, "C:/AMIDA/Video en Audio/Amida1.mpg"); mediaPlayer = mediaDescriptor.getMediaPlayer(); } }
The exception that is thrown reads:

Code: Select all

Exception in thread "main" java.lang.IllegalStateException: Component must be displayable at com.sun.jna.Native.getComponentID(Native.java:159) at org.videolan.jvlc.JVLC.setVideoOutput(JVLC.java:90) at org.amidaproject.ui.gui.SWTVideoControl.addVLCcomponent(SWTVideoControl.java:39) at org.amidaproject.ui.gui.SWTVideoControl.<init>(SWTVideoControl.java:20) at org.amidaproject.ui.gui.SimpleUI.show(SimpleUI.java:147) at org.amidaproject.ui.controller.MainController.showGUI(MainController.java:44) at org.amidaproject.ui.controller.MainController.main(MainController.java:84)
Can anyone tell me what the cause of this exception is? Exactly what component is "not displayable"?

mkeuschn
Blank Cone
Blank Cone
Posts: 16
Joined: 10 Apr 2007 19:30

Re: JVLC Vista

Postby mkeuschn » 15 Aug 2008 12:28

Sorry I am waiting for an explanation from anyone. A friend of me telled me to invalidate the container but I got the same error. Maybe you can try to invalidate the canvas. If that is working please reply.

cheers
marko

mkeuschn
Blank Cone
Blank Cone
Posts: 16
Joined: 10 Apr 2007 19:30

Re: JVLC Vista

Postby mkeuschn » 15 Aug 2008 12:53

This code is working:

Code: Select all

package at.uniklu.unikluni.client.gui; import java.awt.Canvas; import javax.swing.JFrame; import javax.swing.JPanel; import org.videolan.jvlc.Audio; import org.videolan.jvlc.JVLC; import org.videolan.jvlc.MediaDescriptor; import org.videolan.jvlc.MediaPlayer; import org.videolan.jvlc.Video; import at.uniklu.unikluni.client.listener.ClientMediaPlayerListener; public class JVLCPanel extends JPanel { private static final long serialVersionUID = -3316671696374369195L; private static final String[] vlcArguments = new String[] {"--plugin-path=lib\\plugins-new"}; private Video video; private Audio audio; private MediaDescriptor mediaDescriptor; private MediaPlayer player; private JVLC jvlc; private Canvas canvas; /** * Constructor. * @param source (e.g.: "C:/11-eclipseWorkspace/test-videos/t-en.mpg") * @param number * @param width * @param height */ public JVLCPanel(String source, int width, int height) { super(); super.setSize(width, height); super.invalidate(); System.out.println("super: " + super.isDisplayable()); this.invalidate(); this.setVisible(true); System.out.println(this.isDisplayable()); canvas = new Canvas(); canvas.setSize(width, height); this.add(canvas); jvlc = new JVLC(vlcArguments); mediaDescriptor = new MediaDescriptor(jvlc, source); player = mediaDescriptor.getMediaPlayer(); player.addListener(new ClientMediaPlayerListener()); video = new Video(jvlc); audio = new Audio(jvlc); // video.setSize(width, height); // jvlc.setVideoOutput(canvas); // this.play(); canvas.invalidate(); canvas.setVisible(true); } /** * Set new source to play. * @param source */ public void setSource(String source) { mediaDescriptor = new MediaDescriptor(jvlc, source); stop(); player = null; player = mediaDescriptor.getMediaPlayer(); } /** * Start player. */ public void play() { player.play(); } /** * Stop player. */ public void stop() { player.stop(); } /** * Set mute. * @param mute */ public void setMute(boolean mute) { audio.setMute(mute); } /** * Set volume. * @param volume */ public void setVolume(int volume) { audio.setVolume(volume); } /** * Return JVLC. * @return */ public JVLC getJVLCObject() { return jvlc; } /** * Set window size. */ public void setSize(int width, int height) { super.setSize(width, height); video.setSize(width, height); } public Canvas getCanvas() { return canvas; } public static void main (String[] args) { JVLCPanel jp = new JVLCPanel("C:/11-eclipseWorkspace/test-videos/t-en.mpg", 640, 480); System.out.println("main jpanel " + jp.isDisplayable()); jp.invalidate(); jp.setVisible(true); JFrame jf = new JFrame("test"); jf.add(jp); jf.invalidate(); jf.setVisible(true); jp.getJVLCObject().setVideoOutput(jp.getCanvas()); jp.play(); System.out.println("main jpanel " + jp.isDisplayable()); System.out.println("main jframe "); System.out.println("main"); } }
the setVideoOutput Method have to be called after the gui is build.

lefish
Blank Cone
Blank Cone
Posts: 32
Joined: 23 Jun 2008 04:58

Re: JVLC Vista

Postby lefish » 08 Sep 2008 10:48

hmm, nice, thanks a lot.

genjosanzo
New Cone
New Cone
Posts: 2
Joined: 27 Jan 2009 11:53

Re: JVLC Vista

Postby genjosanzo » 27 Jan 2009 14:33

This code is working:

Code: Select all

package at.uniklu.unikluni.client.gui; import java.awt.Canvas; import javax.swing.JFrame; import javax.swing.JPanel; import org.videolan.jvlc.Audio; import org.videolan.jvlc.JVLC; import org.videolan.jvlc.MediaDescriptor; import org.videolan.jvlc.MediaPlayer; import org.videolan.jvlc.Video; import at.uniklu.unikluni.client.listener.ClientMediaPlayerListener; public class JVLCPanel extends JPanel { private static final long serialVersionUID = -3316671696374369195L; private static final String[] vlcArguments = new String[] {"--plugin-path=lib\\plugins-new"}; private Video video; private Audio audio; private MediaDescriptor mediaDescriptor; private MediaPlayer player; private JVLC jvlc; private Canvas canvas; /** * Constructor. * @param source (e.g.: "C:/11-eclipseWorkspace/test-videos/t-en.mpg") * @param number * @param width * @param height */ public JVLCPanel(String source, int width, int height) { super(); super.setSize(width, height); super.invalidate(); System.out.println("super: " + super.isDisplayable()); this.invalidate(); this.setVisible(true); System.out.println(this.isDisplayable()); canvas = new Canvas(); canvas.setSize(width, height); this.add(canvas); jvlc = new JVLC(vlcArguments); mediaDescriptor = new MediaDescriptor(jvlc, source); player = mediaDescriptor.getMediaPlayer(); player.addListener(new ClientMediaPlayerListener()); video = new Video(jvlc); audio = new Audio(jvlc); // video.setSize(width, height); // jvlc.setVideoOutput(canvas); // this.play(); canvas.invalidate(); canvas.setVisible(true); } /** * Set new source to play. * @param source */ public void setSource(String source) { mediaDescriptor = new MediaDescriptor(jvlc, source); stop(); player = null; player = mediaDescriptor.getMediaPlayer(); } /** * Start player. */ public void play() { player.play(); } /** * Stop player. */ public void stop() { player.stop(); } /** * Set mute. * @param mute */ public void setMute(boolean mute) { audio.setMute(mute); } /** * Set volume. * @param volume */ public void setVolume(int volume) { audio.setVolume(volume); } /** * Return JVLC. * @return */ public JVLC getJVLCObject() { return jvlc; } /** * Set window size. */ public void setSize(int width, int height) { super.setSize(width, height); video.setSize(width, height); } public Canvas getCanvas() { return canvas; } public static void main (String[] args) { JVLCPanel jp = new JVLCPanel("C:/11-eclipseWorkspace/test-videos/t-en.mpg", 640, 480); System.out.println("main jpanel " + jp.isDisplayable()); jp.invalidate(); jp.setVisible(true); JFrame jf = new JFrame("test"); jf.add(jp); jf.invalidate(); jf.setVisible(true); jp.getJVLCObject().setVideoOutput(jp.getCanvas()); jp.play(); System.out.println("main jpanel " + jp.isDisplayable()); System.out.println("main jframe "); System.out.println("main"); } }
the setVideoOutput Method have to be called after the gui is build.
That's really usefull,is there anywhere the listener just to se if it runs out of the box?


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: Bing [Bot] and 64 guests