Skip to content

Commit

Permalink
CLI flag for timeoverlay
Browse files Browse the repository at this point in the history
  • Loading branch information
kiview committed Jun 10, 2020
1 parent 77e8537 commit 9acd28f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,23 @@ To build and run the program, execute:
$ mvn javafx:run
```

Note: JDK 13 and Maven need to be installed.

### Running the provided JAR

```
$ java -jar usb-camera-streamer.jar --delay=500
```


Note: JDK 13 and Maven need to be installed.
#### Parameters

All parameters are optional have sensible defaults.

| Parameter | Explanation | default | Example |
| ------------- |:-------------:| -----:|
| delay | delay of the mirrior image in ms | 0 | --delay=500 |
| timeoverlay | whether to display the timeoverlay for debugging | off | --timeoverlay=true (any value will activate) |

## Default Operation

Expand Down
12 changes: 9 additions & 3 deletions src/main/java/dev/wittek/usbcamerastreamer/CameraStreamer.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,16 @@ private String buildPipelineDescription() {

String transformations =
"! videobalance saturation=0.0 " +
"! videoflip method=horizontal-flip " +
"! timeoverlay halignment=center valignment=center " + // TODO: toggle by CLI flag
"! videobox top=200 bottom=200 left=355 right=355 " + // TODO: make configurable
"! videoflip method=horizontal-flip ";

if (getParameters().getNamed().containsKey("timeoverlay")) {
String timerOverlay = "! timeoverlay halignment=center valignment=center ";
transformations += timerOverlay;
}

transformations += "! videobox top=200 bottom=200 left=355 right=355 " + // TODO: make configurable
"! videoscale ";

descriptionBuilder.append(transformations);

if (getParameters().getNamed().containsKey("delay")) {
Expand Down

0 comments on commit 9acd28f

Please sign in to comment.