1 import org.videolan.jvlc.JVLC;
2 import org.videolan.jvlc.VLCException;
5 public class VLCExample
8 public static void main( String[] args )
10 boolean videoInput = false;
11 JVLC jvlc = new JVLC(args);
13 //jvlc.playlist.add("file://" + System.getProperty( "user.dir" ) + "/a.avi", "a.avi");
14 jvlc.playlist.add("file:///home/little/a.avi", "a.avi");
15 jvlc.playlist.add("file://" + System.getProperty( "user.dir" ) + "/a.mp3", "a.mp3");
16 jvlc.playlist.play( -1 , null );
17 } catch (VLCException e) {
20 while (! jvlc.isInputPlaying()) ;
21 while (! jvlc.hasVout() );
25 // testing vout functionalities
29 if (jvlc.hasVout()) videoInput = true;
30 } catch (InterruptedException e) {
36 System.out.print(jvlc.video.getWidth());
37 System.out.print("x");
38 System.out.println(jvlc.video.getHeight());
39 } catch (VLCException e) {
46 System.out.print("Fullscreen... ");
47 jvlc.video.setFullscreen(true);
49 System.out.println("real size.");
50 jvlc.video.setFullscreen(false);
51 System.out.print("Taking snapshot... ");
52 jvlc.video.getSnapshot( System.getProperty( "user.dir" ) + "/snap.png");
53 System.out.println("taken. (see " + System.getProperty( "user.dir" ) + "/snap.png )");
55 System.out.println("Resizing to 300x300");
56 jvlc.video.setSize(300, 300);
59 System.out.print("Muting...");
60 jvlc.audio.setMute(true);
62 System.out.println("unmuting.");
63 jvlc.audio.setMute(false);
65 System.out.println("Volume is: " + jvlc.audio.getVolume());
66 System.out.print("Setting volume to 150... ");
67 jvlc.audio.setVolume(150);
68 System.out.println("done");
69 System.out.println("Audio channel info: " + jvlc.audio.getChannel());
70 System.out.println("Audio track info: " + jvlc.audio.getTrack());
71 System.out.print("Setting left channel... ");
72 jvlc.audio.setChannel("left");
73 System.out.print("done.");
75 System.out.print("Setting right channel... ");
76 jvlc.audio.setChannel("right");
77 System.out.print("done.");
79 System.out.println("INPUT INFORMATION");
80 System.out.println("-----------------");
81 System.out.println("Total length (ms) :\t" + jvlc.input.getLength());
82 System.out.println("Input time (ms) :\t" + jvlc.input.getTime());
83 System.out.println("Input position [0-1]:\t" + jvlc.input.getPosition());
85 System.out.println("Input FPS :\t" + jvlc.input.getFPS());
92 System.out.println("Something was wrong. I die :(.");
97 System.out.println("Everything fine ;)");
98 System.out.println("Playing next item");
100 jvlc.playlist.next();
101 } catch (VLCException e) {
107 } catch (InterruptedException e) {