• 44阅读
  • 0回复

Qt视频监控系统中的通道布局开源/4-6-8-9-13-16-25-49-64布局/异形布局/布局切换/最大支持64路同时显示 [复制链接]

上一主题 下一主题
离线liudianwu
 

只看楼主 倒序阅读 楼主  发表于: 07-15


## 一、前言说明
监控系统中有很多视频画面需要同时显示,有时候需要同时显示4个画面,也就是2x2的布局,这种整数倍的布局是最容易实现的,搞个表格布局按照行列格式插入对应视频控件即可,还有一种非对称的布局,但是整体拉伸比例也完全一致,比如6个画面同时显示,其中一个画面占用两个行列,然后右侧和底部各放两个视频控件,加上右下角的1个,总共6个画面,这种也是用表格布局,只不过在插入第一个最大显示的画面的时候,需要指定占用的行列数,这种差不多的人稍微动动脑子,也是可以搞定的。

上面的布局情况涵盖了几乎所有的情况,也是见过的所有视频监控系统中最常用的布局,几乎都是按照这个规则来整的,现在又有了新的需求,需要增加异形布局,比如现在有些是拼接的视频画面,不是16:9之类的,是一个很大的长宽比,宽度非常大,可能有三五个摄像头拼接的,但是视频流画面是一个完整的,按照之前的布局就基本上不大适合,可能需要3通道布局,上面放两个视频画面,下面放一个画面占用两列,当然这种依然使用的表格布局来,只不过不是所有通道的拉伸比例一样,底部的大通道是不同的拉伸比例,依次类推,还有专门播放手机视频的竖条的布局比如2x6布局,两行6列,因为手机视频一般是垂直的,所有按照这种比例拉伸更合适。

之前布局是写在视频布局窗体中,后面随着功能越来越多,单独搞了个videobox视频盒子的自定义控件,负责管理各种布局,也可以自行增加异形布局,里面已经写好了各种可能的布局的函数,只要传入对应的参数即可,使用起来非常方便。当前这个视频布局控件是开源的,我看很多人都用的我这个控件。也算是回馈了开源社区。


## 二、效果图




## 三、相关代码
```cpp
#pragma execution_character_set("utf-8")

#include "videobox.h"
#include "qapplication.h"
#include "qevent.h"
#include "qmenu.h"
#include "qaction.h"
#include "qgridlayout.h"
#include "qdebug.h"

VideoBox::VideoBox(QObject *parent) : QObject(parent)
{
    isMax = false;
    maxCount = 64;

    type = 16;
    layoutType = "1_16";

    menu = NULL;
    gridLayout = NULL;

    menuFlag = "画面";
    actionFlag = "通道";

    //通过这里设置好数据/下面只需要循环添加和判断就行/灵活性大大增强/只需要这里改动下就行
    //自定义x布局/按照行列数生成/可以通过appendtype函数添加其他类型
    //1_2x4表示通道1开始/2x4行列布局画面/相当于通道1-8按照2行4列排列
    //9_2x4表示通道9开始/2x4行列布局画面/相当于通道9-16按照2行4列排列
    types.insert("x", QStringList() << "1_1x1" << "1_4x1" << "1_2x4" << "9_2x4" << "1_2x6" << "1_3x2" << "1_4x2" << "1_5x2" << "1_6x2" << "1_7x2" << "1_8x2");

    //自定义y布局/主要是一些用户定义的不规则的排列布局/加个y用于区分其他布局/可能有雷同
    types.insert("y", QStringList() << "y_1_2" << "y_1_3" << "y_1_5" << "y_1_8" << "y_1_9" << "y_1_10" << "y_1_12" << "y_1_16");

    //1_4表示通道1-通道4/前面是通道开始的索引/后面是通道结束的索引
    types.insert("4", QStringList() << "1_4" << "5_8" << "9_12" << "13_16" << "17_20" << "21_24" << "25_28" << "29_32" << "33_36");
    types.insert("6", QStringList() << "1_6" << "7_12" << "13_18" << "19_24" << "25_30" << "31_36");
    types.insert("8", QStringList() << "1_8" << "9_16" << "17_24" << "25_32" << "33_40" << "41_48" << "49_57" << "57_64");
    types.insert("9", QStringList() << "1_9" << "9_17" << "18_26" << "27_35" << "36_42" << "43_50" << "51_59");
    types.insert("13", QStringList() << "1_13" << "14_26" << "27_39" << "40_52" << "52_64");
    types.insert("16", QStringList() << "1_16" << "17_32" << "33_48" << "49_64");
    types.insert("25", QStringList() << "1_25");
    types.insert("36", QStringList() << "1_36");
    types.insert("64", QStringList() << "1_64");

    //默认全部可见
    int count = types.count();
    for (int i = 0; i < count; ++i) {
        visibles << true;
    }
}

bool VideoBox::eventFilter(QObject *watched, QEvent *event)
{
    if (event->type() == QEvent::FocusIn) {
        QWidget *widget = (QWidget *) watched;
        Q_EMIT widgetSelected(widget);
    } else if (event->type() == QEvent::MouseButtonDblClick) {
        //有些情况是要对控件的父窗体进行处理
        QWidget *widget = (QWidget *) watched;
        if (widget->parent()->inherits(parentName.toUtf8().constData())) {
            widget = (QWidget *)widget->parent();
        }

        //双击最大化再次双击还原
        if (!isMax) {
            isMax = true;
            this->hide_all();
            this->gridLayout->addWidget(widget, 0, 0);
            widget->setVisible(true);
        } else {
            isMax = false;
            this->show_all();
        }

        //获取焦点
        int index = widgets.indexOf(widget);
        if (index >= 0) {
            widgets2.at(index)->setFocus();
        }

        //通知布局发生了变化
        Q_EMIT layoutChanged(type, layoutType, isMax);
        return true;
    } else if (event->type() == QEvent::MouseButtonPress) {
        //鼠标右键的地方弹出菜单
        pressedTime = QDateTime::currentDateTime();
        if (menu && qApp->mouseButtons() == Qt::RightButton) {
            menu->exec(QCursor::pos());
        }
    } else if (event->type() == QEvent::MouseButtonRelease) {
#ifdef Q_OS_ANDROID
        //长按弹出菜单
        int offset = pressedTime.msecsTo(QDateTime::currentDateTime());
        if (menu && offset >= 1000) {
            menu->exec(QCursor::pos());
            return true;
        }
#endif
    }

    return QObject::eventFilter(watched, event);
}

void VideoBox::addMenu(QMenu *menu, const QString &type)
{
    //父菜单文字
    QString name = QString("切换到%1%2").arg(type).arg(menuFlag);
    //链表中取出该布局大类下的小类集合
    QStringList flags = types.value(type);

    //超过一个子元素则添加子菜单
    QMenu *menuSub;
    if (flags.count() > 1) {
        menuSub = menu->addMenu(name);
    } else {
        menuSub = menu;
    }

    foreach (QString flag, flags) {
        QString text;
        QStringList list = flag.split("_");
        QString start = list.at(0);
        QString end = list.at(1);
        start = QString("%1").arg(start, 2, QChar('0'));

        //对应菜单文本
        if (type == "x") {
            list = end.split("x");
            text = QString("%1 x %2").arg(list.at(0)).arg(list.at(1));
            text = QString("%1%2 (%3)").arg(actionFlag).arg(start).arg(text);
        } else if (type == "y") {
            start = list.at(1);
            end = list.at(2);
            start = QString("%1").arg(start, 2, QChar('0'));
            end = QString("%1").arg(end, 2, QChar('0'));
            text = QString("%1%2-%1%3").arg(actionFlag).arg(start).arg(end);
        } else {
            end = QString("%1").arg(end, 2, QChar('0'));
            text = QString("%1%2-%1%3").arg(actionFlag).arg(start).arg(end);
        }

        //只有一个节点则子菜单文字=主菜单文字
        if (flags.count() == 1) {
            text = name;
        }

        //添加菜单动作
        QAction *action = menuSub->addAction(text, this, SLOT(change_layout()));
        //设置弱属性传入大类和子类布局标识等
        action->setProperty("index", start);
        action->setProperty("type", type);
        action->setProperty("flag", flag);
    }
}

//行列数一致的比如 2*2 3*3 4*4 5*5 等可以直接套用通用的公式
//按照这个函数还可以非常容易的拓展出 10*10 16*16=256 通道界面
void VideoBox::change_layout_normal(int index, int row, int column)
{
    int size = 0;
    int rowCount = 0;
    int columnCount = 0;

    //首先隐藏所有通道
    hide_all();

    //按照指定的行列数逐个添加
    for (int i = 0; i < maxCount; ++i) {
        if (i >= index) {
            //添加到对应布局并设置可见
            gridLayout->addWidget(widgets.at(i), rowCount, columnCount);
            widgets.at(i)->setVisible(true);

            size++;
            columnCount++;
            if (columnCount == column) {
                rowCount++;
                columnCount = 0;
            }
        }

        //到了规定的数量则不用继续
        if (size == (row * column)) {
            break;
        }
    }
}

void VideoBox::change_layout_custom(int index, int type)
{
    //从开始索引开始往后衍生多少个通道
    QList<int> indexs;
    for (int i = index; i < (index + type); ++i) {
        indexs << i;
    }

    //过滤防止索引越界
    if (indexs.count() < type) {
        return;
    }

    if (type == 6 || type == 8 || type == 10 || type == 12 || type == 16) {
        change_layout_l(indexs);
    } else if (type == 13) {
        change_layout_o(indexs);
    }
}

void VideoBox::change_layout_visible(int start, int end)
{
    //设置通道控件可见
    for (int i = start; i <= end; ++i) {
        widgets.at(i)->setVisible(true);
    }
}

void VideoBox::change_layout_l(const QList<int> &indexs)
{
    //通过观察发现这种都是左上角一个大通道/右侧和底部排列几个小通道
    int count = indexs.count();
    int num = count / 2;
    int flag = num - 1;

    //首先隐藏所有通道
    hide_all();

    //添加大通道
    gridLayout->addWidget(widgets.at(indexs.at(0)), 0, 0, flag, flag);
    //添加右侧小通道
    for (int i = 0; i < flag; ++i) {
        gridLayout->addWidget(widgets.at(indexs.at(i + 1)), i, flag);
    }
    //添加底部小通道
    for (int i = num; i < count; ++i) {
        gridLayout->addWidget(widgets.at(indexs.at(i)), flag, count - i - 1);
    }

    //下面添加6通道/这里留着挨个添加的写法/方便学习和对比
#if 0
    gridLayout->addWidget(widgets.at(indexs.at(0)), 0, 0, 2, 2);
    gridLayout->addWidget(widgets.at(indexs.at(1)), 0, 2, 1, 1);
    gridLayout->addWidget(widgets.at(indexs.at(2)), 1, 2, 1, 1);
    gridLayout->addWidget(widgets.at(indexs.at(3)), 2, 2, 1, 1);
    gridLayout->addWidget(widgets.at(indexs.at(4)), 2, 1, 1, 1);
    gridLayout->addWidget(widgets.at(indexs.at(5)), 2, 0, 1, 1);
#endif

    //设置通道控件可见
    change_layout_visible(indexs.first(), indexs.last());
}

void VideoBox::change_layout_o(const QList<int> &indexs)
{
    //首先隐藏所有通道
    hide_all();
    //挨个重新添加到布局
    gridLayout->addWidget(widgets.at(indexs.at(0)), 0, 0, 1, 1);
    gridLayout->addWidget(widgets.at(indexs.at(1)), 0, 1, 1, 1);
    gridLayout->addWidget(widgets.at(indexs.at(2)), 0, 2, 1, 1);
    gridLayout->addWidget(widgets.at(indexs.at(3)), 0, 3, 1, 1);
    gridLayout->addWidget(widgets.at(indexs.at(4)), 1, 0, 1, 1);
    gridLayout->addWidget(widgets.at(indexs.at(5)), 2, 0, 1, 1);
    gridLayout->addWidget(widgets.at(indexs.at(6)), 1, 1, 2, 2);
    gridLayout->addWidget(widgets.at(indexs.at(7)), 1, 3, 1, 1);
    gridLayout->addWidget(widgets.at(indexs.at(8)), 2, 3, 1, 1);
    gridLayout->addWidget(widgets.at(indexs.at(9)), 3, 0, 1, 1);
    gridLayout->addWidget(widgets.at(indexs.at(10)), 3, 1, 1, 1);
    gridLayout->addWidget(widgets.at(indexs.at(11)), 3, 2, 1, 1);
    gridLayout->addWidget(widgets.at(indexs.at(12)), 3, 3, 1, 1);
    //设置通道控件可见
    change_layout_visible(indexs.first(), indexs.last());
}

QString VideoBox::getLayoutType() const
{
    return this->layoutType;
}

void VideoBox::setLayoutType(const QString &layoutType)
{
    this->layoutType = layoutType;
}

QWidgetList VideoBox::getWidgets() const
{
    return this->widgets;
}

void VideoBox::setWidgets(QWidgetList widgets, QWidgetList widgets2)
{
    this->widgets = widgets;
    this->widgets2 = widgets2;
    this->maxCount = widgets.count();
    foreach (QWidget *widget, widgets2) {
        widget->installEventFilter(this);
    }
}

void VideoBox::setLayout(QGridLayout *gridLayout)
{
    this->gridLayout = gridLayout;
}

void VideoBox::setMenuFlag(const QString &menuFlag)
{
    this->menuFlag = menuFlag;
}

void VideoBox::setActionFlag(const QString &actionFlag)
{
    this->actionFlag = actionFlag;
}

void VideoBox::setParentName(const QString &parentName)
{
    this->parentName = parentName;
}

void VideoBox::setVisibles(const QList<bool> &visibles)
{
    this->visibles = visibles;
}

void VideoBox::appendType(int index, int row, int column)
{
    //先要过滤下是否满足最大通道数量/start从1开始
    if (((index - 1) + (row * column)) > maxCount) {
        return;
    }

    //追加到x布局后面
    QString type = QString("%1_%2x%3").arg(index).arg(row).arg(column);
    QMap<QString, QStringList>::iterator iter = types.begin();
    while (iter != types.end()) {
        if (iter.key() == "x") {
            QStringList value = iter.value();
            if (!value.contains(type)) {
                value.append(type);
                types["x"] = value;
            }
            break;
        }
        iter++;
    }
}

void VideoBox::initMenu(QMenu *menu)
{
    //为空则主动创建一个菜单
    if (!menu) {
        this->menu = new QMenu((QWidget *)this->parent());
    } else {
        this->menu = menu;
    }

    //约定依次是按照顺序控制启用状态
    int count = visibles.count();
    if (count > 0 && visibles.at(0)) {
        addMenu(this->menu, "x");
    }
    if (count > 1 && visibles.at(1)) {
        addMenu(this->menu, "y");
    }
    if (count > 2 && visibles.at(2)) {
        addMenu(this->menu, "4");
    }
    if (count > 3 && visibles.at(3)) {
        addMenu(this->menu, "6");
    }
    if (count > 4 && visibles.at(4)) {
        addMenu(this->menu, "8");
    }
    if (count > 5 && visibles.at(5)) {
        addMenu(this->menu, "9");
    }
    if (count > 6 && visibles.at(6)) {
        addMenu(this->menu, "13");
    }
    if (count > 7 && visibles.at(7)) {
        addMenu(this->menu, "16");
    }
    if (count > 8 && visibles.at(8)) {
        addMenu(this->menu, "25");
    }
    if (count > 9 && visibles.at(9)) {
        addMenu(this->menu, "36");
    }
    if (count > 10 && visibles.at(10)) {
        addMenu(this->menu, "64");
    }
}

void VideoBox::show_all()
{
    //一般是从配置文件读取到了最后的通道画面类型进行设置
    int type = 1;
    int index = layoutType.split("_").first().toInt() - 1;
    //y开头的布局需要重置索引=0
    if (layoutType.startsWith("y")) {
        index = 0;
    }

    QMap<QString, QStringList>::iterator iter = types.begin();
    while (iter != types.end()) {
        QStringList flags = iter.value();
        if (flags.contains(layoutType)) {
            type = iter.key().toInt();
            change_layout(type, index);
            return;
        }
        iter++;
    }

    //如果运行到这里说明设置了不存在的布局/强制纠正
    layoutType = "1_4";
    this->show_all();
}

void VideoBox::hide_all()
{
    for (int i = 0; i < maxCount; ++i) {
        gridLayout->removeWidget(widgets.at(i));
        widgets.at(i)->setVisible(false);
    }
}

void VideoBox::change_layout()
{
    //识别具体是哪个动作菜单触发的
    QAction *action = (QAction *)sender();
    //从弱属性取出值
    int index = action->property("index").toInt() - 1;
    int type = action->property("type").toInt();
    QString layoutType = action->property("flag").toString();
    //只有当画面布局类型改变了才需要切换
    if (this->layoutType != layoutType) {
        this->layoutType = layoutType;
        change_layout(type, index);
    }
}

void VideoBox::change_layout(int type, int index)
{
    //根据不同的父菜单类型执行对应的函数
    if (type == 0) {
        if (layoutType.contains("x")) {
            //取出行列
            QString text = layoutType.split("_").last();
            QStringList list = text.split("x");
            int row = list.at(0).toInt();
            int column = list.at(1).toInt();
            change_layout_normal(index, row, column);

            //只有1个通道需要更改类型/方便外面区分当前是1通道
            if (layoutType.endsWith("1x1")) {
                type = 1;
            }
        } else if (layoutType == "y_1_2") {
            change_layout_y_1_2(index);
        } else if (layoutType == "y_1_3") {
            change_layout_y_1_3(index);
        } else if (layoutType == "y_1_5") {
            change_layout_y_1_5(index);
        } else if (layoutType == "y_1_8") {
            change_layout_y_1_8(index);
        } else if (layoutType == "y_1_9") {
            change_layout_y_1_9(index);
        } else if (layoutType == "y_1_10") {
            change_layout_y_1_10(index);
        } else if (layoutType == "y_1_12") {
            change_layout_y_1_12(index);
        } else if (layoutType == "y_1_16") {
            change_layout_y_1_16(index);
        }
    } else if (type == 1) {
        change_layout_1(index);
    } else if (type == 4) {
        change_layout_4(index);
    } else if (type == 6) {
        change_layout_6(index);
    } else if (type == 8) {
        change_layout_8(index);
    } else if (type == 9) {
        change_layout_9(index);
    } else if (type == 13) {
        change_layout_13(index);
    } else if (type == 16) {
        change_layout_16(index);
    } else if (type == 25) {
        change_layout_25(index);
    } else if (type == 36) {
        change_layout_36(index);
    } else if (type == 64) {
        change_layout_64(index);
    }

    this->type = type;
    this->isMax = false;
    Q_EMIT layoutChanged(type, layoutType, isMax);
}

void VideoBox::change_layout_y_1_2(int index)
{
    change_layout_normal(index, 1, 2);
}

void VideoBox::change_layout_y_1_3(int index)
{
    //首先隐藏所有通道
    hide_all();
    //添加通道到布局
    gridLayout->addWidget(widgets.at(index + 0), 0, 0, 1, 2);
    gridLayout->addWidget(widgets.at(index + 1), 1, 0, 1, 1);
    gridLayout->addWidget(widgets.at(index + 2), 1, 1, 1, 1);
    //设置通道控件可见
    change_layout_visible(index, index + 2);
}

void VideoBox::change_layout_y_1_5(int index)
{
    //首先隐藏所有通道
    hide_all();
    //依次左上/左下/
    gridLayout->addWidget(widgets.at(index + 0), 0, 0, 1, 2);
    gridLayout->addWidget(widgets.at(index + 1), 1, 0, 2, 1);
    gridLayout->addWidget(widgets.at(index + 2), 1, 1, 1, 1);
    gridLayout->addWidget(widgets.at(index + 3), 2, 1, 1, 1);
    gridLayout->addWidget(widgets.at(index + 4), 0, 2, 3, 1);
    //设置通道控件可见
    change_layout_visible(index, index + 4);
}

void VideoBox::change_layout_y_1_8(int index)
{
    //首先隐藏所有通道
    hide_all();
    //添加上面4个通道
    gridLayout->addWidget(widgets.at(index + 0), 0, 0, 1, 1);
    gridLayout->addWidget(widgets.at(index + 1), 0, 1, 1, 1);
    gridLayout->addWidget(widgets.at(index + 2), 0, 2, 1, 1);
    gridLayout->addWidget(widgets.at(index + 3), 0, 3, 1, 1);
    //添加中间全景通道
    gridLayout->addWidget(widgets.at(index + 8), 1, 0, 1, 4);
    //添加下面4个通道
    gridLayout->addWidget(widgets.at(index + 4), 2, 0, 1, 1);
    gridLayout->addWidget(widgets.at(index + 5), 2, 1, 1, 1);
    gridLayout->addWidget(widgets.at(index + 6), 2, 2, 1, 1);
    gridLayout->addWidget(widgets.at(index + 7), 2, 3, 1, 1);
    //设置通道控件可见
    change_layout_visible(index, index + 8);
}

void VideoBox::change_layout_y_1_9(int index)
{
    //首先隐藏所有通道
    hide_all();
    //添加通道到布局
    gridLayout->addWidget(widgets.at(index + 0), 0, 0, 2, 2);
    gridLayout->addWidget(widgets.at(index + 1), 0, 2, 1, 1);
    gridLayout->addWidget(widgets.at(index + 2), 0, 3, 1, 1);
    gridLayout->addWidget(widgets.at(index + 3), 1, 2, 1, 1);
    gridLayout->addWidget(widgets.at(index + 4), 1, 3, 1, 1);
    gridLayout->addWidget(widgets.at(index + 5), 2, 3, 1, 1);
    gridLayout->addWidget(widgets.at(index + 6), 2, 2, 1, 1);
    gridLayout->addWidget(widgets.at(index + 7), 2, 1, 1, 1);
    gridLayout->addWidget(widgets.at(index + 8), 2, 0, 1, 1);
    //设置通道控件可见
    change_layout_visible(index, index + 8);
}

void VideoBox::change_layout_y_1_10(int index)
{
    change_layout_custom(index, 10);
}

void VideoBox::change_layout_y_1_12(int index)
{
    change_layout_custom(index, 12);
}

void VideoBox::change_layout_y_1_16(int index)
{
    change_layout_custom(index, 16);
}

void VideoBox::change_layout_1(int index)
{
    change_layout_normal(index, 1, 1);
}

void VideoBox::change_layout_4(int index)
{
    change_layout_normal(index, 2, 2);
}

void VideoBox::change_layout_6(int index)
{
    change_layout_custom(index, 6);
}

void VideoBox::change_layout_8(int index)
{
    change_layout_custom(index, 8);
}

void VideoBox::change_layout_9(int index)
{
    change_layout_normal(index, 3, 3);
}

void VideoBox::change_layout_13(int index)
{
    change_layout_custom(index, 13);
}

void VideoBox::change_layout_16(int index)
{
    change_layout_normal(index, 4, 4);
}

void VideoBox::change_layout_25(int index)
{
    change_layout_normal(index, 5, 5);
}

void VideoBox::change_layout_36(int index)
{
    change_layout_normal(index, 6, 6);
}

void VideoBox::change_layout_64(int index)
{
    change_layout_normal(index, 8, 8);
}
```

## 四、相关地址
1. 国内站点:[https://gitee.com/feiyangqingyun](https://gitee.com/feiyangqingyun)
2. 国际站点:[https://github.com/feiyangqingyun](https://github.com/feiyangqingyun)
3. 个人作品:[https://blog.csdn.net/feiyangqingyun/article/details/97565652](https://blog.csdn.net/feiyangqingyun/article/details/97565652)
4. 文件地址:[https://pan.baidu.com/s/1d7TH_GEYl5nOecuNlWJJ7g](https://pan.baidu.com/s/1d7TH_GEYl5nOecuNlWJJ7g) 提取码:01jf 文件名:bin_video_system。

## 五、功能特点
### 5.1 软件模块
1. 视频监控模块,各种停靠小窗体子模块,包括设备列表、图文警情、窗口信息、云台控制、预置巡航、视频轮询、设备控制、悬浮地图、网页浏览等。
2. 视频回放模块,包括本地回放、网络回放、远程回放、图片回放、视频上传等。
3. 电子地图模块,包括图片地图、设备地图、设备移动、轨迹回放等。
4. 日志查询模块,包括本地日志、设备日志等。
5. 系统设置模块,包括系统设置(基本设置、视频参数、数据设置、颜色配置、功能激活等)、录像机管理、摄像机管理、轮询配置、录像计划、用户管理、其他设置等。

### 5.2 基础功能
1. 支持各种音视频流(rtsp、rtmp、http、srt、ws等)、音视频文件(mp4、rmvb、avi等)、本地设备(本地摄像头、麦克风、桌面)。
2. 支持多画面切换,包括1、4、6、8、9、13、16、25、36、64画面切换。
3. 支持全屏切换,多种切换方式包括鼠标右键菜单、工具栏按钮、快捷键(alt+enter全屏,esc退出全屏)。
4. 支持视频轮询,包括1、4、9、16画面轮询,可设置轮询分组(轮询预案)、轮询间隔、码流类型等。
5. 支持onvif协议,包括设备搜索、云台控制、预置位管理、设备控制(图片参数、校对时间、系统重启、抓拍图片、OSD配置、网络配置等)。
6. 支持权限管理,不同的用户可以对应不同的模块权限,比如删除日志、关闭系统等。
7. 数据库支持多种,包括sqlite、mysql、sqlserver、postgresql、oracle、人大金仓等。
8. 支持本地设备采集比如本地桌面和摄像头,支持设置分辨率、帧率等参数,支持多屏幕。
9. 所有停靠模块都自动生成对应的菜单用来控制显示和隐藏,在标题栏右键可以弹出。
10. 支持显示所有模块、隐藏所有模块、复位普通布局、复位全屏布局。
11. 支持图片地图和网页地图上双击设备图标弹出实时预览。
12. 摄像机节点拖曳到对应窗体播放视频,同时支持拖曳本地文件直接播放。
13. 设备树双击分组打开对应分组下的所有视频,双击设备子节点直接打开对应设备视频流。自动加载最后展开的节点。
14. 设备树支持自定义配置,可以添加分组、删除分组、修改分组,任意层级设置。
15. 设备树可以开启是否放大字体显示、是否显示主码流子码流节点、是否隐藏空组(没有设备的分组自动隐藏)。
16. 删除视频支持鼠标右键删除、悬浮条关闭删除、拖曳到视频监控面板外删除等多种方式。
17. 图片地图上设备按钮可自由拖动,自动保存位置信息。地图上可以鼠标单击获取经纬度信息,用来更新设备位置。
18. 视频监控面板窗体中任意通道支持拖曳交换,瞬间响应。
19. 网页地图支持视图切换、运动轨迹显示、设备点位,鼠标按下获取经纬度等。
20. 双击节点、拖曳节点、拖曳窗体交换位置等操作,均自动更新保存最后的播放地址,下次软件打开自动应用。
21. 右下角音量条控件,失去焦点自动隐藏,音量条带静音图标,自动记忆最后的音量及静音状态。
22. 支持视频截图,可指定单个或者对所有通道截图,底部小工具栏也有截图按钮,每个视频控件悬浮条也有抓拍按钮。
23. 支持辅屏预览,可以打开多个,在多个屏幕分别打开64通道,按需显示视频。
24. 支持超时自动隐藏鼠标指针、自动全屏机制。
25. 支持onvif云台控制,可上下左右移动云台摄像机,包括复位和焦距调整等。
26. 支持onvif预置位,可以添加、删除、修改预置位,可以调用起始位。
27. 支持OSD增删改查,可以通过onvif协议添加及修改OSD信息。
28. 支持onvif图像参数设置,包括明亮度、对比度、饱和度、尖锐度等。
29. 支持onvif其他操作,包括抓图、网络设置、校时、重启、事件订阅等。
30. 支持任意onvif摄像机,包括但不限于海康、大华、宇视、天地伟业、华为等。
31. 可保存视频,可通过录像计划存储,也可在悬浮条手动切换开始录像和停止录像。
32. 可设置视频流通信方式tcp或udp,可设置视频解码是速度优先、质量优先、均衡处理、最快速度等。
33. 可设置软件中文名称、英文名称、LOGO图标等。
34. 存储的视频文件支持导出到指定目录,支持批量上传到服务器。
35. 完善的录像计划设置,支持每个通道7 * 24小时每半小时设置是否存储录像。
36. 音视频同步显示以及音视频同步存储到MP4文件。

### 5.3 特色功能
1. 主界面采用停靠窗体模式,各种组件以小模块的形式加入,可自定义任意模块加入。
2. 停靠模块可拖动任意位置嵌入和悬浮,支持最大化全屏,支持多屏幕。
3. 双重布局文件存储机制,正常模式、全屏模式都对应不同的布局方案,自动切换和保存,比如全屏模式可以突出几个模块透明显示在指定位置,更具科幻感现代化。
4. 原创onvif协议机制,采用底层协议解析(udp广播搜索+http请求执行命令)更轻量易懂易学习拓展,不依赖任何第三方组件比如gsoap。
5. 原创数据导入、导出、打印机制,跨平台不依赖任何组件,瞬间导出数据。
6. 内置多个原创组件,宇宙超值超级牛逼,包括数据导入导出组件(导出到xls、pdf、打印)、数据库组件(数据库管理线程、自动清理数据线程、万能分页、数据请求等)、地图组件、视频监控组件、文件多线程收发组件、onvif通信组件、通用浏览器内核组件等。
7. 自定义信息框、错误框、询问框、右下角提示框(包含多种格式)等。
8. 精美换肤,高达20套皮肤样式随意更换,所有样式全部统一,包括菜单等。
9. 选中通道对应设备树节点高亮,选中通道节点对应视频控件高亮,方便查看当前通道信息。
10. 视频控件悬浮条可以自行增加多个按钮,监控界面底部小工具栏也可自行增加按钮。
11. 双击摄像机节点自动播放视频,双击节点自动依次添加视频,会自动跳到下一个,双击父节点自动添加该节点下的所有视频。可选主码流、子码流。
12. 录像机管理、摄像机管理,可添加删除修改导入导出打印信息,立即应用新的设备信息生成树状列表,不需重启。
13. 摄像机搜索支持一键搜索和批量添加,支持onvif的NVR一键添加子设备,可以手动设置开始地址和数量一键生成摄像机信息。
14. 可选多种内核自由切换,ffmpeg、vlc、mpv等,均可在pro中设置。推荐用ffmpeg,跨平台最多,默认提供好了linux和mac平台上编译好的库。
15. 支持windows、linux、macos等系统硬解码,还支持嵌入式linux RKMPP硬解码,可设置硬解码类型(dxva2、d3d11va、vaapi、vdpau等)。
16. 各种模块可以勾选是否激活,方便根据实际需求搭配各种组合,比如隐藏电子地图模块,隐藏远程回放模块只保留本地回放等。
17. 尽最大化可能,将常用的功能封装接口,全局静态函数调用,极其容易使用,提供各种使用示例,方便用户二开。
18. 默认采用opengl绘制视频,超低的CPU资源占用,支持yuyv和nv12两种格式绘制,性能爆表。
19. 标签和图形信息支持三种绘制方式,绘制到遮罩层、绘制到图片、源头绘制(对应信息可以存储到文件)。
20. 包括但不限于视频监控内核组件的所有功能,可参阅说明书中功能介绍 [视频监控内核](###8.1 视频监控内核)。
21. 高度可定制化,用户可以很方便的在此基础上衍生自己的功能,比如增加自定义模块,增加运行模式、机器人监控、无人机监控、挖掘机监控、广播监控等。
22. 支持xp、win7、win10、win11、linux、mac、各种国产系统(UOS、中标麒麟、银河麒麟等)、嵌入式linux等系统。
23. 注释完整,项目结构清晰,超级详细完整的使用开发手册,精确到每个代码文件的功能说明,不断持续迭代版本。
欢迎关注微信公众号:Qt实战/Qt入门和进阶(各种开源作品、经验整理、项目实战技巧,专注Qt/C++软件开发,视频监控、物联网、工业控制、嵌入式软件、国产化系统应用软件开发) QQ:517216493  WX:feiyangqingyun  QQ群:751439350
快速回复
限100 字节
 
上一个 下一个