forked from JPery/MJPEGWriter
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
34 lines (31 loc) · 638 Bytes
/
main.cpp
File metadata and controls
34 lines (31 loc) · 638 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "MJPEGWriter.h"
using namespace std;
using namespace cv;
int main()
{
MJPEG server(7777);
VideoCapture cap;
bool ok = cap.open(0);
if (!ok)
{
cerr << "No cam found" << endl;
return 1;
}
//cap.set(CV_CAP_PROP_FRAME_WIDTH, 1296);
//cap.set(CV_CAP_PROP_FRAME_HEIGHT, 972);
Mat frame;
cap >> frame;
server.write(frame);
frame.release();
server.start();
while (cap.isOpened())
{
cap >> frame;
server.write(frame);
frame.release();
mySleep(40);
}
cout << "Camera shutdown" << endl;
server.stop();
return 0;
}