JVLC "setVideoOutput" persistent error

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.
MarcoC
New Cone
New Cone
Posts: 2
Joined: 05 Nov 2008 10:34

JVLC "setVideoOutput" persistent error

Postby MarcoC » 05 Nov 2008 11:47

Hallo, im trying to see a MediaPlayer in a Canvas.

I can run a standalone MediaPlayer in eclipse whith this:

Code: Select all

... ... JVLC jvlc = new JVLC(args); MediaDescriptor mediaDescriptor = new MediaDescriptor(jvlc, "C:\\test.avi"); MediaPlayer mediaInstance = mediaDescriptor.getMediaPlayer(); mediaInstance.play(); ... ...
Now i want create a panel with more mediaplayers at the same time and im trying to begin with an example found in this forum:

Code: Select all

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; public class JVLCPanel extends JPanel { private static final String[] vlcArguments = new String[] {"--plugin-path=C:\\Documents and Settings\\scarciafratte\\Documenti\\Eclipse.Workspace\\VLC.Client\\addon\\plugins","--no-plugins-cache"}; private static final long serialVersionUID = -3316671696374369195L; 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) throws InterruptedException { JVLCPanel jp = new JVLCPanel("C:\\test.avi", 720, 576); 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); //****************************************************************** //Here the error! jp.getJVLCObject().setVideoOutput(jp.getCanvas()); //****************************************************************** jp.play(); System.out.println("main jpanel " + jp.isDisplayable()); System.out.println("main jframe "); System.out.println("main"); } }
i have a persistent error here:

Code: Select all

jp.getJVLCObject().setVideoOutput(jp.getCanvas());
with this log:

Code: Select all

*** LibVLC Exception not handled: No active input Set a breakpoint in 'libvlc_exception_not_handled' to debug. [00000123] main access error: no access module matched "any" main [00000121] main input error: open of `C:\test.avi' failed: could not create access: no access module matched "any"
i have the latest git and libraries installed but i cant get out of this, anyone can help me?

Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 30 guests