Skip to content

Commit

Permalink
* Take OpenCVFrameGrabber.setFormat() value to set FOURCC of `Vide…
Browse files Browse the repository at this point in the history
…oCapture` (pull #651)
  • Loading branch information
AmnonOwed authored and saudet committed Mar 25, 2017
1 parent 6adb47d commit 775ce2a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/org/bytedeco/javacv/OpenCVFrameGrabber.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,16 @@ public void start() throws Exception {
} else {
capture = new VideoCapture(deviceNumber);
}

if (format != null && format.length() >= 4) {
format = format.toUpperCase();
byte cc0 = (byte)format.charAt(0);
byte cc1 = (byte)format.charAt(1);
byte cc2 = (byte)format.charAt(2);
byte cc3 = (byte)format.charAt(3);
capture.set(CV_CAP_PROP_FOURCC, CV_FOURCC(cc0, cc1, cc2, cc3));
}

if (imageWidth > 0) {
if (!capture.set(CV_CAP_PROP_FRAME_WIDTH, imageWidth)) {
capture.set(CV_CAP_PROP_MODE, imageWidth); // ??
Expand Down

0 comments on commit 775ce2a

Please sign in to comment.