mirror of
https://github.com/lostjared/Acid.Cam.v2.Qt.git
synced 2025-12-13 18:30:02 +01:00
updated
This commit is contained in:
@@ -968,15 +968,17 @@ bool AC_MainWindow::startCamera(int res, int dev, const QString &outdir, bool re
|
|||||||
Log(tr("Capture Device Opened [Camera]\n"));
|
Log(tr("Capture Device Opened [Camera]\n"));
|
||||||
std::ostringstream time_stream;
|
std::ostringstream time_stream;
|
||||||
switch(res) {
|
switch(res) {
|
||||||
case 0:
|
case 0:
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
res_w = 640;
|
res_w = 640;
|
||||||
res_h = 480;
|
res_h = 480;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 2:
|
||||||
res_w = 1280;
|
res_w = 1280;
|
||||||
res_h = 720;
|
res_h = 720;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 3:
|
||||||
res_w = 1920;
|
res_w = 1920;
|
||||||
res_h = 1080;
|
res_h = 1080;
|
||||||
break;
|
break;
|
||||||
@@ -998,7 +1000,7 @@ bool AC_MainWindow::startCamera(int res, int dev, const QString &outdir, bool re
|
|||||||
std::ostringstream index_val;
|
std::ostringstream index_val;
|
||||||
index_val << std::setw(4) << std::setfill('0') << (++index);
|
index_val << std::setw(4) << std::setfill('0') << (++index);
|
||||||
time_stream << "-" << (m->tm_year + 1900) << "." << (m->tm_mon + 1) << "." << m->tm_mday << "_" << m->tm_hour << "." << m->tm_min << "." << m->tm_sec << "_";
|
time_stream << "-" << (m->tm_year + 1900) << "." << (m->tm_mon + 1) << "." << m->tm_mday << "_" << m->tm_hour << "." << m->tm_min << "." << m->tm_sec << "_";
|
||||||
stream_ << outdir << "/" << "Acid.Cam.Video" << "." << out_type << time_stream.str().c_str() << "." << res_w << "x" << res_h << "." "AC2.Output." << index_val.str().c_str() << ext;
|
stream_ << outdir << "/" << "Acid.Cam.Video" << "." << out_type << time_stream.str().c_str() << "." << "AC2.Output." << index_val.str().c_str() << ext;
|
||||||
/*
|
/*
|
||||||
bool cw = capture_camera.set(CV_CAP_PROP_FRAME_WIDTH, res_w);
|
bool cw = capture_camera.set(CV_CAP_PROP_FRAME_WIDTH, res_w);
|
||||||
bool ch = capture_camera.set(CV_CAP_PROP_FRAME_HEIGHT, res_h);
|
bool ch = capture_camera.set(CV_CAP_PROP_FRAME_HEIGHT, res_h);
|
||||||
|
|||||||
@@ -69,37 +69,33 @@ bool Playback::setVideoCamera(std::string name, int type, int device, int res, c
|
|||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
/*#else
|
|
||||||
if(!capture.isOpened()) {
|
|
||||||
capture.open(device);
|
|
||||||
if(!capture.isOpened()) {
|
|
||||||
mutex.unlock();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif*/
|
|
||||||
recording = record;
|
recording = record;
|
||||||
writer = wr;
|
writer = wr;
|
||||||
int res_w = 640, res_h = 480;
|
int res_w = 640, res_h = 480;
|
||||||
switch(res) {
|
switch(res) {
|
||||||
case 0:
|
case 0:
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
res_w = 640;
|
res_w = 640;
|
||||||
res_h = 480;
|
res_h = 480;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 2:
|
||||||
res_w = 1280;
|
res_w = 1280;
|
||||||
res_h = 720;
|
res_h = 720;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 3:
|
||||||
res_w = 1920;
|
res_w = 1920;
|
||||||
res_h = 1080;
|
res_h = 1080;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
capture.set(cv::CAP_PROP_FRAME_WIDTH, res_w);
|
|
||||||
capture.set(cv::CAP_PROP_FRAME_HEIGHT, res_h);
|
if(res != 0) {
|
||||||
double fps = capture.get(cv::CAP_PROP_FPS);
|
capture.set(cv::CAP_PROP_FRAME_WIDTH, res_w);
|
||||||
res_w = capture.get(cv::CAP_PROP_FRAME_WIDTH);
|
capture.set(cv::CAP_PROP_FRAME_HEIGHT, res_h);
|
||||||
res_h = capture.get(cv::CAP_PROP_FRAME_HEIGHT);
|
}
|
||||||
|
double fps = capture.get(cv::CAP_PROP_FPS);
|
||||||
|
res_w = capture.get(cv::CAP_PROP_FRAME_WIDTH);
|
||||||
|
res_h = capture.get(cv::CAP_PROP_FRAME_HEIGHT);
|
||||||
if(name.size()>0) {
|
if(name.size()>0) {
|
||||||
writer = cv::VideoWriter(name, type, fps, cv::Size(res_w, res_h), true);
|
writer = cv::VideoWriter(name, type, fps, cv::Size(res_w, res_h), true);
|
||||||
if(!writer.isOpened()) {
|
if(!writer.isOpened()) {
|
||||||
@@ -258,9 +254,9 @@ void Playback::drawFilter(cv::Mat &frame, FilterValue &f) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Playback::run() {
|
void Playback::run() {
|
||||||
|
|
||||||
int duration = 1000/ac::fps;
|
int duration = 1000/ac::fps;
|
||||||
|
|
||||||
while(!stop) {
|
while(!stop) {
|
||||||
mutex.lock();
|
mutex.lock();
|
||||||
if(ac::release_frames) {
|
if(ac::release_frames) {
|
||||||
@@ -290,7 +286,7 @@ void Playback::run() {
|
|||||||
cv::flip(frame, temp_frame, 0);
|
cv::flip(frame, temp_frame, 0);
|
||||||
frame = temp_frame;
|
frame = temp_frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
static std::vector<FilterValue> cur;
|
static std::vector<FilterValue> cur;
|
||||||
mutex_shown.lock();
|
mutex_shown.lock();
|
||||||
@@ -315,7 +311,7 @@ void Playback::run() {
|
|||||||
++cycle_index;
|
++cycle_index;
|
||||||
if(cycle_index > static_cast<int>(cycle_values.size()-1))
|
if(cycle_index > static_cast<int>(cycle_values.size()-1))
|
||||||
cycle_index = 0;
|
cycle_index = 0;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
cycle_image = &cycle_values[cycle_index];
|
cycle_image = &cycle_values[cycle_index];
|
||||||
@@ -333,7 +329,7 @@ void Playback::run() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
|
|
||||||
if(single_mode == true && alpha > 0) {
|
if(single_mode == true && alpha > 0) {
|
||||||
if(fadefilter == true) filterFade(frame, current_filter, prev_filter, alpha);
|
if(fadefilter == true) filterFade(frame, current_filter, prev_filter, alpha);
|
||||||
drawEffects(frame);
|
drawEffects(frame);
|
||||||
@@ -358,7 +354,7 @@ void Playback::run() {
|
|||||||
} else {
|
} else {
|
||||||
if(_custom_cycle_index > static_cast<int>(cur.size()-1))
|
if(_custom_cycle_index > static_cast<int>(cur.size()-1))
|
||||||
_custom_cycle_index = 0;
|
_custom_cycle_index = 0;
|
||||||
|
|
||||||
if(_custom_cycle_index >= 0 && _custom_cycle_index < static_cast<int>(cur.size())) {
|
if(_custom_cycle_index >= 0 && _custom_cycle_index < static_cast<int>(cur.size())) {
|
||||||
drawFilter(frame, cur[_custom_cycle_index]);
|
drawFilter(frame, cur[_custom_cycle_index]);
|
||||||
msleep(duration/2);
|
msleep(duration/2);
|
||||||
|
|||||||
Reference in New Issue
Block a user