From e947bf29af0540eda50fd298bb5492c2d8fa7680 Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Fri, 16 Mar 2018 22:03:56 +0000
Subject: [PATCH] C wrappers
---
src/demo.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/demo.c b/src/demo.c
index 0dce144..f1798c7 100644
--- a/src/demo.c
+++ b/src/demo.c
@@ -143,6 +143,7 @@
printf("video file: %s\n", filename);
cap = cvCaptureFromFile(filename);
}else{
+ printf("Webcam index: %d\n", cam_index);
cap = cvCaptureFromCAM(cam_index);
}
@@ -233,7 +234,7 @@
}
// if you run it with param -http_port 8090 then open URL in your web-browser: http://localhost:8090
- if (http_stream_port > 0) {
+ if (http_stream_port > 0 && show_img) {
//int port = 8090;
int port = http_stream_port;
int timeout = 200;
@@ -242,10 +243,11 @@
}
// save video file
- if (output_video_writer) {
+ if (output_video_writer && show_img) {
cvWriteFrame(output_video_writer, show_img);
printf("\n cvWriteFrame \n");
}
+
cvReleaseImage(&show_img);
pthread_join(fetch_thread, 0);
--
Gitblit v1.10.0