use of org.bytedeco.javacv.FFmpegFrameGrabber in project bigbluebutton by bigbluebutton.
the class FfmpegScreenshare method setupLinuxGrabber.
private FFmpegFrameGrabber setupLinuxGrabber(int width, int height, int x, int y) {
// ffmpeg -video_size 1024x768 -framerate 25 -f x11grab -i :0.0+100,200 output.mp4
// This will grab the image from desktop, starting with the upper-left corner at (x=100, y=200)
// with the width and height of 1024x768.
String inputDevice = ":";
if (ssi.fullScreen) {
inputDevice = inputDevice.concat(new Integer(0).toString()).concat(".").concat(new Integer(0).toString());
inputDevice = inputDevice.concat("+").concat(new Integer(0).toString()).concat(",").concat(new Integer(0).toString());
} else {
inputDevice = inputDevice.concat(new Integer(0).toString()).concat(".").concat(new Integer(0).toString());
inputDevice = inputDevice.concat("+").concat(new Integer(x).toString()).concat(",").concat(new Integer(y).toString());
}
String videoSize = new Integer(width).toString().concat("x").concat(new Integer(height).toString());
System.out.println("Setting up grabber for linux.");
System.out.println("input:" + inputDevice + " videoSize:" + videoSize);
FFmpegFrameGrabber linuxGrabber = new FFmpegFrameGrabber(inputDevice);
linuxGrabber.setImageWidth(width);
linuxGrabber.setImageHeight(height);
linuxGrabber.setOption("video_size", videoSize);
linuxGrabber.setFormat("x11grab");
return linuxGrabber;
}
use of org.bytedeco.javacv.FFmpegFrameGrabber in project bigbluebutton by bigbluebutton.
the class FfmpegScreenshare method setupMacOsXGrabber.
private FFmpegFrameGrabber setupMacOsXGrabber(int width, int height, int x, int y) {
//ffmpeg -f avfoundation -i "Capture screen 0" test.mkv
String inputDevice = "Capture screen 0:none";
String videoSize = new Integer(width).toString().concat("x").concat(new Integer(height).toString());
System.out.println("Setting up grabber for macosx.");
System.out.println("input:" + inputDevice + " videoSize:" + videoSize);
FFmpegFrameGrabber macGrabber = new FFmpegFrameGrabber(inputDevice);
macGrabber.setImageWidth(width);
macGrabber.setImageHeight(height);
macGrabber.setFrameRate(frameRate);
macGrabber.setPixelFormat(AV_PIX_FMT_RGB0);
macGrabber.setFormat("avfoundation");
macGrabber.setOption("capture_cursor", "1");
macGrabber.setOption("capture_mouse_clicks", "1");
return macGrabber;
}
Aggregations