Skip to content

Commit

Permalink
Fix vlcj option names (v4l2 instead of v4l)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarxos committed Jan 21, 2015
1 parent 21b1bfd commit b793d61
Showing 1 changed file with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,33 +98,37 @@ public static void main(String[] args) throws IOException, InterruptedException
@Override
public void display(DirectMediaPlayer player, Memory[] buffers, BufferFormat format) {

BufferedImage bi = convert(buffers, format);
try {
ImageIO.write(bi, "JPG", new File(System.currentTimeMillis() + "-test.jpg"));
} catch (IOException e) {
e.printStackTrace();
}
if (i++ < 10) {

System.out.println("write " + i);
BufferedImage bi = convert(buffers, format);
try {
ImageIO.write(bi, "JPG", new File(System.currentTimeMillis() + "-test.jpg"));
} catch (IOException e) {
e.printStackTrace();
}

if (i++ > 10) {
player.stop();
System.exit(0);
System.out.println("write " + i);
}
}
});

String device = "/dev/video0";
String mrl = "v4l2://" + device;
String[] options = new String[] {
":v4l-vdev=" + device,
":v4l-width=320", // XXX this setting does not have any effect!
":v4l-height=240", // XXX this setting does not have any effect!
":v4l-fps=30",
":v4l-quality=20",
":v4l-adev=none",
":v4l2-vdev=" + device,
":v4l2-width=320",
":v4l2-height=240",
":v4l2-fps=30",
":v4l2-quality=20",
":v4l2-adev=none",
};

player.startMedia(mrl, options);

Thread.sleep(1000);

player.stop();
player.release();
factory.release();
}
}

0 comments on commit b793d61

Please sign in to comment.