通道切換在視頻監控系統中是最基礎的必備功能,通常都會提供1通道+4通道+6通道+8通道+9通道+16通道這幾個通道切換,可能作得比較好的還會提供24通道+32通道的,這個可能對電腦的配置就有必定要求了,通常來講,超過9個通道實時顯示視頻流,基本上會採用子碼流來顯示,若是都採用主碼流,電腦壓力很是巨大,CPU佔用很高,內存也高,不過如今的電腦配置愈來愈高,基本上四千多的臺式機,配置已經很是好了,顯示個16個通道的實時視頻毫無壓力。 Qt中的佈局很是好用,尤爲是QGridLayout表格佈局,能夠指定行列放置控件,並且還能夠設置每一個控件佔用幾行幾列,這樣就能夠完美的實現各類通道佈局了。好比6通道,能夠設置通道1佔用兩行兩列,其餘通道各站一行一列便可,當切換佈局的時候,其餘隱藏便可。 體驗地址:https://pan.baidu.com/s/1bbL2ZughZAgfIGrexyN-9g 提取碼:zkeh 。linux
監控系統是由攝像、傳輸、控制、顯示、記錄登記5大部分組成。攝像機經過同軸視頻電纜將視頻圖像傳輸到控制主機,控制主機再將視頻信號分配到各監視器及錄像設備,同時可將須要傳輸的語音信號同步錄入到錄像機內。 經過控制主機,操做人員可發出指令,對雲臺的上、下、左、右的動做進行控制及對鏡頭進行調焦變倍的操做,並可經過控制主機實如今多路攝像機及雲臺之間的切換。利用特殊的錄像處理模式,可對圖像進行錄入、回放、處理等操做,使錄像效果達到最佳。安全
視頻監控系統由實時控制系統、監視系統及管理信息系統組成。實時控制系統完成實時數據採集處理、存儲、反饋的功能;監視系統完成對各個監控點的全天候的監視,能在多操做控制點上切換多路圖像;管理信息系統完成各種所需信息的採集、接收、傳輸、加工、處理,是整個系統的控制核心。視頻監控系統是安全防範系統的組成部分,它是一種防範能力較強的綜合系統。視頻監控以其直觀、方便、信息內容豐富而普遍應用於許多場合。ide
void frmVideoPanel::show_video_all() { if (App::VideoType.startsWith("0_")) { QStringList list = App::VideoType.split("_"); int index = list.last().toInt() - 1; hide_video_all(); ui->gridLayout->addWidget(widgets.at(index), 0, 0); widgets.at(index)->setVisible(true); ui->btnVideo1->setChecked(true); } else if (App::VideoType == "1_4") { change_video_4(0); } else if (App::VideoType == "5_8") { change_video_4(4); } else if (App::VideoType == "9_12") { change_video_4(8); } else if (App::VideoType == "13_16") { change_video_4(12); } else if (App::VideoType == "1_6") { change_video_6(0); } else if (App::VideoType == "6_11") { change_video_6(5); } else if (App::VideoType == "11_16") { change_video_6(10); } else if (App::VideoType == "1_8") { change_video_8(0); } else if (App::VideoType == "9_16") { change_video_8(8); } else if (App::VideoType == "1_9") { change_video_9(0); } else if (App::VideoType == "8_16") { change_video_9(7); } else if (App::VideoType == "1_16") { change_video_16(0); } } void frmVideoPanel::show_video_4() { QString videoType; int index = 0; QAction *action = (QAction *)sender(); QString name = action->text(); if (name == "通道1-通道4") { index = 0; videoType = "1_4"; } else if (name == "通道5-通道8") { index = 4; videoType = "5_8"; } else if (name == "通道9-通道12") { index = 8; videoType = "9_12"; } else if (name == "通道13-通道16") { index = 12; videoType = "13_16"; } if (App::VideoType != videoType) { App::VideoType = videoType; App::VideoMax = false; App::writeConfig(); change_video_4(index); } } void frmVideoPanel::show_video_6() { QString videoType; int index = 0; QAction *action = (QAction *)sender(); QString name = action->text(); if (name == "通道1-通道6") { index = 0; videoType = "1_6"; } else if (name == "通道6-通道11") { index = 5; videoType = "6_11"; } else if (name == "通道11-通道16") { index = 10; videoType = "11_16"; } if (App::VideoType != videoType) { App::VideoType = videoType; App::VideoMax = false; App::writeConfig(); change_video_6(index); } } void frmVideoPanel::show_video_8() { QString videoType; int index = 0; QAction *action = (QAction *)sender(); QString name = action->text(); if (name == "通道1-通道8") { index = 0; videoType = "1_8"; } else if (name == "通道9-通道16") { index = 8; videoType = "9_16"; } if (App::VideoType != videoType) { App::VideoType = videoType; App::VideoMax = false; App::writeConfig(); change_video_8(index); } } void frmVideoPanel::show_video_9() { QString videoType; int index = 0; QAction *action = (QAction *)sender(); QString name = action->text(); if (name == "通道1-通道9") { index = 0; videoType = "1_9"; } else if (name == "通道8-通道16") { index = 7; videoType = "8_16"; } if (App::VideoType != videoType) { App::VideoType = videoType; App::VideoMax = false; App::writeConfig(); change_video_9(index); } } void frmVideoPanel::show_video_16() { QString videoType; int index = 0; videoType = "1_16"; if (App::VideoType != videoType) { App::VideoType = videoType; App::VideoMax = false; App::writeConfig(); change_video_16(index); } } void frmVideoPanel::show_video_full() { if (ui->widgetSplite->isVisible()) { ui->widgetSplite->setVisible(false); emit fullScreen(true); } else { ui->widgetSplite->setVisible(true); emit fullScreen(false); } } void frmVideoPanel::hide_video_all() { for (int i = 0; i < App::VideoCount; i++) { ui->gridLayout->removeWidget(widgets.at(i)); widgets.at(i)->setVisible(false); } } void frmVideoPanel::change_video(int index, int flag) { int count = 0; int row = 0; int column = 0; for (int i = 0; i < App::VideoCount; i++) { if (i >= index) { ui->gridLayout->addWidget(widgets.at(i), row, column); widgets.at(i)->setVisible(true); count++; column++; if (column == flag) { row++; column = 0; } } if (count == (flag * flag)) { break; } } } void frmVideoPanel::change_video_4(int index) { ui->btnVideo4->setChecked(true); hide_video_all(); change_video(index, 2); } void frmVideoPanel::change_video_6(int index) { ui->btnVideo6->setChecked(true); hide_video_all(); if (index == 0) { ui->gridLayout->addWidget(widgets.at(0), 0, 0, 2, 2); ui->gridLayout->addWidget(widgets.at(1), 0, 2, 1, 1); ui->gridLayout->addWidget(widgets.at(2), 1, 2, 1, 1); ui->gridLayout->addWidget(widgets.at(3), 2, 2, 1, 1); ui->gridLayout->addWidget(widgets.at(4), 2, 1, 1, 1); ui->gridLayout->addWidget(widgets.at(5), 2, 0, 1, 1); for (int i = 0; i < 6; i++) { widgets.at(i)->setVisible(true); } } else if (index == 5) { ui->gridLayout->addWidget(widgets.at(5), 0, 0, 2, 2); ui->gridLayout->addWidget(widgets.at(6), 0, 2, 1, 1); ui->gridLayout->addWidget(widgets.at(7), 1, 2, 1, 1); ui->gridLayout->addWidget(widgets.at(8), 2, 2, 1, 1); ui->gridLayout->addWidget(widgets.at(9), 2, 1, 1, 1); ui->gridLayout->addWidget(widgets.at(10), 2, 0, 1, 1); for (int i = 5; i < 11; i++) { widgets.at(i)->setVisible(true); } } else if (index == 10) { ui->gridLayout->addWidget(widgets.at(10), 0, 0, 2, 2); ui->gridLayout->addWidget(widgets.at(11), 0, 2, 1, 1); ui->gridLayout->addWidget(widgets.at(12), 1, 2, 1, 1); ui->gridLayout->addWidget(widgets.at(13), 2, 2, 1, 1); ui->gridLayout->addWidget(widgets.at(14), 2, 1, 1, 1); ui->gridLayout->addWidget(widgets.at(15), 2, 0, 1, 1); for (int i = 10; i < 16; i++) { widgets.at(i)->setVisible(true); } } } void frmVideoPanel::change_video_8(int index) { ui->btnVideo8->setChecked(true); hide_video_all(); if (index == 0) { ui->gridLayout->addWidget(widgets.at(0), 0, 0, 3, 3); ui->gridLayout->addWidget(widgets.at(1), 0, 3, 1, 1); ui->gridLayout->addWidget(widgets.at(2), 1, 3, 1, 1); ui->gridLayout->addWidget(widgets.at(3), 2, 3, 1, 1); ui->gridLayout->addWidget(widgets.at(4), 3, 3, 1, 1); ui->gridLayout->addWidget(widgets.at(5), 3, 2, 1, 1); ui->gridLayout->addWidget(widgets.at(6), 3, 1, 1, 1); ui->gridLayout->addWidget(widgets.at(7), 3, 0, 1, 1); for (int i = 0; i < 8; i++) { widgets.at(i)->setVisible(true); } } else if (index == 8) { ui->gridLayout->addWidget(widgets.at(8), 0, 0, 3, 3); ui->gridLayout->addWidget(widgets.at(9), 0, 3, 1, 1); ui->gridLayout->addWidget(widgets.at(10), 1, 3, 1, 1); ui->gridLayout->addWidget(widgets.at(11), 2, 3, 1, 1); ui->gridLayout->addWidget(widgets.at(12), 3, 3, 1, 1); ui->gridLayout->addWidget(widgets.at(13), 3, 2, 1, 1); ui->gridLayout->addWidget(widgets.at(14), 3, 1, 1, 1); ui->gridLayout->addWidget(widgets.at(15), 3, 0, 1, 1); for (int i = 8; i < 16; i++) { widgets.at(i)->setVisible(true); } } } void frmVideoPanel::change_video_9(int index) { ui->btnVideo9->setChecked(true); hide_video_all(); change_video(index, 3); } void frmVideoPanel::change_video_16(int index) { ui->btnVideo16->setChecked(true); hide_video_all(); change_video(index, 4); }