On 2010-05-31 20:04, Lyubov Kolosovska wrote:
> thank you for your answer! I've checked the ffmpeg wrapper, but haven't
> found any example of how to actually wrap the ffmpeg command to Java
> code. Do you have some examples?
Actually, I never tested the x11grab device, and JavaCV was missing a
few things to enable screen capture. The modifications were pretty minor
and I was able to make them in half an hour. Please download and let me
know if you have any trouble with these test packages:
http://www.ok.ctrl.titech.ac.jp/~saudet/javacv.jar
http://www.ok.ctrl.titech.ac.jp/~saudet/ffmpeg-java.jar
Once installed, you should be able to do what you want with a program
like the following. (It displays back on the screen the captured images,
so you will get a double-mirror-like effect there... pretty neat :)
import name.audet.samuel.javacv.*;
public class ScreenCastingTest {
public static void main(String[] args) throws Exception {
CanvasFrame frame = new CanvasFrame("ScreenCastingTest", 1.0);
FrameGrabber grabber = new FFmpegFrameGrabber(":0.0", "x11grab");
grabber.setImageWidth(1024);
grabber.setImageHeight(768);
grabber.setFrameRate(10);
grabber.start();
while (frame.isVisible()) {
frame.showImage(grabber.grab());
}
grabber.stop();
frame.dispose();
}
}
Samuel
Samuel
I don't know, I do not use Ubuntu. This guy seems to have a solution though:
http://linux-tipps.blogspot.com/2009/05/pretending-package-is-installed-by.html
But if this does not work, then please ask other people who use Ubuntu
how to get ffmpeg working properly. I do not know, since I do not use
Ubuntu. I hope this is clear.
Samuel
Samuel
Samuel
Just to say that I have updated, tested, and confirmed that, with FFmpeg
plus x11grab installed from SVN that way, these test packages work:
http://www.ok.ctrl.titech.ac.jp/~saudet/javacv.jar
http://www.ok.ctrl.titech.ac.jp/~saudet/ffmpeg-java.jar
Happy x11grabbing...
Samuel