-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add README.md in screen capture driver
- Loading branch information
Showing
6 changed files
with
142 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
# webcam-capture-driver-screencapture | ||
|
||
This is capture driver which is able to capture video feed from your screen devices. It uses AWT Robot under | ||
the hood and it's is directly limited by its performance. Every screen device connected to your computer will | ||
be abstracted as a separate webcam device. | ||
|
||
## Maven | ||
|
||
Stable: | ||
|
||
```xml | ||
<dependency> | ||
<groupId>com.github.sarxos</groupId> | ||
<artifactId>webcam-capture-driver-screencapture</artifactId> | ||
<version>0.3.12</version> | ||
</dependency> | ||
``` | ||
|
||
Snapshot: | ||
|
||
```xml | ||
<repository> | ||
<id>Sonatype OSS Snapshot Repository</id> | ||
<url>http://oss.sonatype.org/content/repositories/snapshots</url> | ||
</repository> | ||
``` | ||
```xml | ||
<dependency> | ||
<groupId>com.github.sarxos</groupId> | ||
<artifactId>webcam-capture-driver-screencapture</artifactId> | ||
<version>0.3.13-SNAPSHOT</version> | ||
</dependency> | ||
``` | ||
|
||
## How To Use | ||
|
||
Set capture driver before you start using Webcam class: | ||
|
||
```java | ||
import java.awt.Dimension; | ||
import java.awt.FlowLayout; | ||
|
||
import javax.swing.JFrame; | ||
|
||
import com.github.sarxos.webcam.Webcam; | ||
import com.github.sarxos.webcam.WebcamPanel; | ||
import com.github.sarxos.webcam.WebcamPanel.DrawMode; | ||
import com.github.sarxos.webcam.WebcamResolution; | ||
import com.github.sarxos.webcam.ds.gstreamer.ScreenCaptureDriver; | ||
|
||
|
||
public class WebcamPanelExample { | ||
|
||
static { | ||
Webcam.setDriver(new ScreenCaptureDriver()); | ||
} | ||
|
||
public static void main(String[] args) throws InterruptedException { | ||
|
||
final JFrame window = new JFrame("Screen Capture Example"); | ||
window.setResizable(true); | ||
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | ||
window.getContentPane().setLayout(new FlowLayout()); | ||
|
||
final Dimension resolution = WebcamResolution.QVGA.getSize(); | ||
|
||
for (final Webcam webcam : Webcam.getWebcams()) { | ||
|
||
webcam.setCustomViewSizes(resolution); | ||
webcam.setViewSize(resolution); | ||
webcam.open(); | ||
|
||
final WebcamPanel panel = new WebcamPanel(webcam); | ||
panel.setFPSDisplayed(true); | ||
panel.setDrawMode(DrawMode.FIT); | ||
panel.setImageSizeDisplayed(true); | ||
panel.setPreferredSize(resolution); | ||
|
||
window.getContentPane().add(panel); | ||
} | ||
|
||
window.pack(); | ||
window.setVisible(true); | ||
} | ||
} | ||
``` | ||
|
||
## Examples | ||
|
||
Please check [this](https://github.com/sarxos/webcam-capture/tree/master/webcam-capture-drivers/driver-screencapture/src/example/java) directory for more examples. | ||
|
||
## Known Problems | ||
|
||
1. I noticed this on my Ubuntu Linux - black regions appears in place where other application (e.g. Cairo Dock) | ||
render OpenGL content. I don't know about any workaround or solution for this problem. Not verified on Mac and Windows. | ||
Please report [new issue](https://github.com/sarxos/webcam-capture/issues/new) if you know how to fix this. | ||
|
||
## Capture Driver License | ||
|
||
Copyright (C) 2012 - 2018 Bartosz Firyn <https://github.com/sarxos> and contributors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
Binary file added
BIN
+63.9 KB
webcam-capture-drivers/driver-screencapture/src/etc/resources/screen-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+113 KB
webcam-capture-drivers/driver-screencapture/src/etc/resources/screen-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters