libVLC 视频抓图

Windows操作系统提供了多种便捷的截图方式,常见的有以下几种:

  • 全屏截图:通过按下PrtSc键(Print Screen),可以截取整个屏幕的内容。截取的图像会保存在剪贴板中,可以通过Ctrl+V粘贴到图片编辑工具或其他软件的输入框中。
  • 当前窗口截图:同时按下Alt + PrtSc键,可以截取当前活动的窗口。同样,截图内容会被保存在剪贴板中。
  • 矩形截图:使用快捷键Windows + Shift + S,可以选择矩形截图模式,然后拖动鼠标选取屏幕上的任意矩形区域进行截图。
  • 自由形状截图:同样使用Windows + Shift + S快捷键,可以选择任意形状截图模式,允许你自由绘制截图区域的形状。

libVLC 中通过libvlc_video_take_snapshot核心接口来截图。

以下是如何使用 libVLC 设置视频裁剪区域的基本步骤:

1. 初始化 libVLC 和媒体播放器

首先,你需要初始化 libVLC 实例和媒体播放器对象。

#include <vlc/vlc.h>int main(int argc, char* argv[])
{libvlc_instance_t* inst;libvlc_media_player_t* mp;libvlc_media_t* m;// 加载 libVLC 引擎inst = libvlc_new(0, NULL);// 创建一个新的 itemm = libvlc_media_new_location(inst, "your_video_path_here");mp = libvlc_media_player_new_from_media(m);// 不再需要媒体对象libvlc_media_release(m);
}

2. 播放视频

// 播放媒体播放器
libvlc_media_player_play(mp);// 保持程序运行,直到视频播放完成
while (libvlc_media_player_is_playing(mp)) {// 可以在这里加入延时
}// 清理 libVLC
libvlc_media_player_stop(mp);
libvlc_media_player_release(mp);
libvlc_release(inst);return 0;

3.截图

这里为了方便,路径写死了。

	if (vlc_mediaPlayer){QString path = "./snap.png";libvlc_video_take_snapshot(vlc_mediaPlayer, 0, path.toUtf8().data(), 0, 0);}

以下是VLC播放器中使用的截图界面,我们仿照这个做一个界面。 

以下是效果图。

菜单添加action,并响应槽函数。

m_snapAction = m_videoMenu->addAction("截图");
connect(m_snapAction, &QAction::triggered, this, &showWidget::slotSnap);

槽函数如下图所示,为了方便,路径写死了。 

void showWidget::slotSnap()
{if (vlc_mediaPlayer){QString path = "./snap.png";libvlc_video_take_snapshot(vlc_mediaPlayer, 0, path.toUtf8().data(), 0, 0);}
}

生成目录下snap.png。 

完整源码:

#pragma once
#define LIBVLC_USE_PTHREAD_CANCEL 1
#include <QtWidgets/QWidget>
#include "ui_showWidget.h"
#include <QMenu>
#include <QActionGroup>
#include <vlc/vlc.h>#include <QDebug>
#include <QFileDialog>
#include <QThread>
#include <QMouseEvent>
#include <QKeyEvent>enum Rate
{Rate2X,Rate1_5X,Rate1_25X,Rate1_0X,Rate0_75X,Rate0_5X
};class showWidget : public QWidget
{Q_OBJECTpublic:showWidget(QWidget *parent = nullptr);~showWidget();protected:virtual void mousePressEvent(QMouseEvent *event);virtual void mouseDoubleClickEvent(QMouseEvent *event);virtual void keyPressEvent(QKeyEvent *event);private slots:void slotOpenFile();void slotPlay();void slotPause();void slotStop();void slotValueChanged(int value);void slotCurrentIndexChanged(int index);void slotActionTriggered(QAction *action);void slotCropActionTriggered(QAction *action);void slotScaleActionTriggered(QAction *action);void slotSnap();private://事件处理回调static void vlcEvents(const libvlc_event_t *ev, void *param);//初始化menuvoid initMenu();private:Ui::showWidgetClass ui;private:libvlc_instance_t *vlc_base = nullptr;libvlc_media_t *vlc_media = nullptr;libvlc_media_player_t *vlc_mediaPlayer = nullptr;QList<float> m_lstRate;QMenu *m_menu = nullptr;QAction *m_video = nullptr;QAction *m_scaleAction = nullptr;	//缩放QAction *m_aspectRatioAction = nullptr;	//宽高比QAction *m_cropAction = nullptr;	//裁剪QAction *m_snapAction = nullptr;//截图QMenu *m_videoMenu = nullptr;//宽高比QMenu *m_aspectRatioMenu = nullptr;QAction *m_default = nullptr;QAction *m_16_9 = nullptr;QAction *m_4_3 = nullptr;QAction *m_1_1 = nullptr;QAction *m_16_10 = nullptr;QAction *m_2_21_1 = nullptr;QAction *m_2_35_1= nullptr;QAction *m_2_38_1 = nullptr;QAction *m_5_4 = nullptr;QActionGroup *m_group = nullptr;QAction *m_preAspectRatio = nullptr;//宽高比//裁剪QMenu *m_cropMenu = nullptr;QAction *m__cropDefault = nullptr;QAction *m__crop16_10 = nullptr;QAction *m__crop16_9 = nullptr;QAction *m__crop4_3 = nullptr;QAction *m__crop1_85_1 = nullptr;QAction *m__crop2_21_1 = nullptr;QAction *m__crop2_35_1 = nullptr;QAction *m__crop2_39_1 = nullptr;QAction *m__crop5_3 = nullptr;QAction *m__crop5_4 = nullptr;QAction *m__crop1_1 = nullptr;QActionGroup *m_cropGroup = nullptr;QAction *m_preCrop= nullptr;//裁剪//缩放QMenu *m_scaleMenu = nullptr;QAction *m_scale1_4 = nullptr;QAction *m_scale1_2 = nullptr;QAction *m_scale1_1 = nullptr;QAction *m_scale2_1 = nullptr;QActionGroup *m_scaleGroup = nullptr;QAction *m_preScale = nullptr;//缩放char *m_defalutRate = nullptr;char *m_defalutCrop = nullptr;float m_defalutScale = 0;
};

cpp

#include "showWidget.h"
#include <QTimer>
#include <QTime>#pragma execution_character_set("utf-8")showWidget::showWidget(QWidget *parent): QWidget(parent)
{ui.setupUi(this);this->setWindowTitle("视频播放器");ui.cbxRate->setCurrentIndex(Rate1_0X);m_lstRate << 2.0 << 1.5 << 1.25 << 1.0 << 0.75 << 0.5;initMenu();ui.btnOpen->setFocusPolicy(Qt::NoFocus);ui.btnPlay->setFocusPolicy(Qt::NoFocus);ui.btnPause->setFocusPolicy(Qt::NoFocus);ui.btnStop->setFocusPolicy(Qt::NoFocus);ui.hSliderVolumn->setFocusPolicy(Qt::NoFocus);ui.cbxRate->setFocusPolicy(Qt::NoFocus);connect(ui.btnOpen, &QPushButton::clicked, this, &showWidget::slotOpenFile);connect(ui.btnPlay, &QPushButton::clicked, this, &showWidget::slotPlay);connect(ui.btnPause, &QPushButton::clicked, this, &showWidget::slotPause);connect(ui.btnStop, &QPushButton::clicked, this, &showWidget::slotStop);connect(ui.btnSnap, &QPushButton::clicked, this, &showWidget::slotSnap);connect(ui.hSliderVolumn, &QSlider::valueChanged, this, &showWidget::slotValueChanged);connect(ui.cbxRate,SIGNAL(currentIndexChanged(int)), this, SLOT(slotCurrentIndexChanged(int)));
}showWidget::~showWidget()
{libvlc_release(vlc_base); //减少libvlc实例的引用计数,并销毁
}void showWidget::mousePressEvent(QMouseEvent *event)
{switch (event->button()){case Qt::RightButton://this->setWindowState(Qt::WindowMinimized);m_menu->exec(event->globalPos());break;default:QWidget::mousePressEvent(event);}
}void showWidget::mouseDoubleClickEvent(QMouseEvent *event)
{if (this->isFullScreen()){this->showNormal();}else{this->showFullScreen();}
}void showWidget::keyPressEvent(QKeyEvent *event)
{if (!vlc_mediaPlayer)return;int value = ui.hSliderVolumn->value();if (event->key() == Qt::Key_W)	//添加音量{qDebug() << "up";slotValueChanged(value+10);}else if (event->key() == Qt::Key_S)	//减小音量{slotValueChanged(value - 10);}else if (event->key() == Qt::Key_Space){if (vlc_mediaPlayer && libvlc_media_player_get_state(vlc_mediaPlayer) == libvlc_Playing){libvlc_media_player_pause(vlc_mediaPlayer);}else if (vlc_mediaPlayer && libvlc_media_player_get_state(vlc_mediaPlayer) == libvlc_Paused){libvlc_media_player_play(vlc_mediaPlayer);}}
}void showWidget::slotOpenFile()
{/*选择文件*/QString filename = QFileDialog::getOpenFileName(this, "选择打开的文件", "D:/", tr("*.*"));std::replace(filename.begin(), filename.end(), QChar('/'), QChar('\\'));vlc_base = libvlc_new(0, NULL);vlc_media = libvlc_media_new_path(vlc_base, filename.toUtf8().data());if (!vlc_media) {return;}// 创建libvlc实例和媒体播放器vlc_mediaPlayer = libvlc_media_player_new_from_media(vlc_media);if (!vlc_mediaPlayer) {return;}// 等待元数据加载完成libvlc_media_parse(vlc_media);m_defalutRate = libvlc_video_get_aspect_ratio(vlc_mediaPlayer);m_defalutCrop = libvlc_video_get_crop_geometry(vlc_mediaPlayer);libvlc_video_set_mouse_input(vlc_mediaPlayer, 0);libvlc_video_set_key_input(vlc_mediaPlayer, 0);// 获取各种元数据const char *title = libvlc_media_get_meta(vlc_media, libvlc_meta_Title);const char *artist = libvlc_media_get_meta(vlc_media, libvlc_meta_Artist);const char *album = libvlc_media_get_meta(vlc_media, libvlc_meta_Album);const char *url = libvlc_media_get_meta(vlc_media, libvlc_meta_URL);const char *date = libvlc_media_get_meta(vlc_media, libvlc_meta_Date);const char *lang = libvlc_media_get_meta(vlc_media, libvlc_meta_Language);int duration = libvlc_media_get_duration(vlc_media);  // 获取时长(单位:毫秒)qDebug("Title: %s", title ? title : "N/A");qDebug("Artist: %s", artist ? artist : "N/A");qDebug("Album: %s", album ? album : "N/A");qDebug("Duration: %d ms", duration);qDebug("url: %s", url ? url : "N/A");qDebug("date: %s", date ? date : "N/A");qDebug("lang: %s", lang ? lang : "N/A");libvlc_media_track_t **tracks;int track_count = libvlc_media_tracks_get(vlc_media,&tracks);for (unsigned i = 0; i < track_count; i++) {libvlc_media_track_t* track = tracks[i];// 显示轨道信息printf("Track #%u: %s\n", i, track->psz_description);// 这里可以获取到每一个轨道的信息,比如轨道类型 track->i_type// 可能是 libvlc_track_video, libvlc_track_audio 或者 libvlc_track_text (字幕)if (track->i_type == libvlc_track_video) {// 处理视频轨道信息qDebug("width = %d",track->video->i_width);qDebug("height = %d", track->video->i_height);qDebug("rate_num = %d", track->video->i_frame_rate_num);qDebug("rate_den = %d", track->video->i_frame_rate_den);}else if (track->i_type == libvlc_track_audio) {// 处理音频轨道信息qDebug("channels = %d", track->audio->i_channels);qDebug("rate = %d", track->audio->i_rate);}else if (track->i_type == libvlc_track_text) {// 处理字幕轨道信息}}//获取事件管理器libvlc_event_manager_t *em = libvlc_media_player_event_manager(vlc_mediaPlayer);// 注册事件监听器libvlc_event_attach(em, libvlc_MediaPlayerTimeChanged, vlcEvents, this);libvlc_event_attach(em, libvlc_MediaPlayerEndReached, vlcEvents, this);libvlc_event_attach(em, libvlc_MediaPlayerStopped, vlcEvents, this);libvlc_event_attach(em, libvlc_MediaPlayerPlaying, vlcEvents, this);libvlc_event_attach(em, libvlc_MediaPlayerPaused, vlcEvents, this);libvlc_media_player_set_hwnd(vlc_mediaPlayer, (void *)ui.widgetShow->winId());QTimer::singleShot(1000, this, &showWidget::slotPlay);}void showWidget::slotPlay()
{if (vlc_mediaPlayer){libvlc_media_player_play(vlc_mediaPlayer);m_defalutScale = libvlc_video_get_scale(vlc_mediaPlayer);}}void showWidget::slotPause()
{if (vlc_mediaPlayer)libvlc_media_player_pause(vlc_mediaPlayer);
}void showWidget::slotStop()
{if (vlc_mediaPlayer)libvlc_media_player_stop(vlc_mediaPlayer);
}void showWidget::slotValueChanged(int value)
{if (vlc_mediaPlayer)libvlc_audio_set_volume(vlc_mediaPlayer, value);
}void showWidget::slotCurrentIndexChanged(int index)
{if (vlc_mediaPlayer)libvlc_media_player_set_rate(vlc_mediaPlayer, m_lstRate[index]);
}void showWidget::slotActionTriggered(QAction *action)
{if (!vlc_mediaPlayer)return;if (action == m_default)libvlc_video_set_aspect_ratio(vlc_mediaPlayer,m_defalutRate);else if(action == m_16_9)libvlc_video_set_aspect_ratio(vlc_mediaPlayer, "16:9");else if (action == m_4_3)libvlc_video_set_aspect_ratio(vlc_mediaPlayer, "4:3");else if (action == m_1_1)libvlc_video_set_aspect_ratio(vlc_mediaPlayer, "1:1");else if (action == m_16_10)libvlc_video_set_aspect_ratio(vlc_mediaPlayer, "16:10");else if (action == m_2_21_1)libvlc_video_set_aspect_ratio(vlc_mediaPlayer, "221:100");else if (action == m_2_35_1)libvlc_video_set_aspect_ratio(vlc_mediaPlayer, "235:100");else if (action == m_2_38_1)libvlc_video_set_aspect_ratio(vlc_mediaPlayer, "238:100");else if (action == m_5_4)libvlc_video_set_aspect_ratio(vlc_mediaPlayer, "5:4");action->setIcon(QIcon(":/image/images/point.png"));m_preAspectRatio->setIcon(QIcon());m_preAspectRatio = action;
}void showWidget::slotCropActionTriggered(QAction *action)
{if (!vlc_mediaPlayer)return;if (action == m__cropDefault)libvlc_video_set_crop_geometry(vlc_mediaPlayer, m_defalutCrop);else if (action == m__crop16_10)libvlc_video_set_crop_geometry(vlc_mediaPlayer, "16:10");else if (action == m__crop16_9)libvlc_video_set_crop_geometry(vlc_mediaPlayer, "16:9");else if (action == m__crop4_3)libvlc_video_set_crop_geometry(vlc_mediaPlayer, "4:3");else if (action == m__crop1_85_1)libvlc_video_set_crop_geometry(vlc_mediaPlayer, "185:100");else if (action == m__crop2_21_1)libvlc_video_set_crop_geometry(vlc_mediaPlayer, "221:100");else if (action == m__crop2_35_1)libvlc_video_set_crop_geometry(vlc_mediaPlayer, "235:100");else if (action == m__crop2_39_1)libvlc_video_set_crop_geometry(vlc_mediaPlayer, "239:100");else if (action == m__crop5_3)libvlc_video_set_crop_geometry(vlc_mediaPlayer, "5:3");else if (action == m__crop5_4)libvlc_video_set_crop_geometry(vlc_mediaPlayer, "5:4");else if (action == m__crop1_1)libvlc_video_set_crop_geometry(vlc_mediaPlayer, "1:1");action->setIcon(QIcon(":/image/images/point.png"));m_preCrop->setIcon(QIcon());m_preCrop = action;
}void showWidget::slotScaleActionTriggered(QAction *action)
{if (!vlc_mediaPlayer)return;if (action == m_scale1_4)libvlc_video_set_scale(vlc_mediaPlayer, 0.25);else if (action == m_scale1_2)libvlc_video_set_scale(vlc_mediaPlayer, 0.5);else if (action == m_scale1_1)libvlc_video_set_scale(vlc_mediaPlayer, 1);else if (action == m_scale2_1)libvlc_video_set_scale(vlc_mediaPlayer, 2);action->setIcon(QIcon(":/image/images/point.png"));m_preScale->setIcon(QIcon());m_preScale = action;
}void showWidget::slotSnap()
{if (vlc_mediaPlayer){QString path = "./snap.png";libvlc_video_take_snapshot(vlc_mediaPlayer, 0, path.toUtf8().data(), 0, 0);}
}//事件回调
void showWidget::vlcEvents(const libvlc_event_t *ev, void *param)
{showWidget *w = (showWidget*)param;//处理不同的事件switch (ev->type) {case libvlc_MediaPlayerTimeChanged:{//qDebug() << "VLC媒体播放器时间已更改";qint64 len = libvlc_media_player_get_time(w->vlc_mediaPlayer);libvlc_time_t lenSec = len / 1000;libvlc_time_t totalLen = libvlc_media_player_get_length(w->vlc_mediaPlayer);libvlc_time_t totalLenSec = totalLen / 1000;int thh, tmm, tss;thh = lenSec / 3600;tmm = (lenSec % 3600) / 60;tss = (lenSec % 60);QTime time(thh, tmm, tss);w->ui.lbCurTime->setText(time.toString("hh:mm:ss"));thh = totalLenSec / 3600;tmm = (totalLenSec % 3600) / 60;tss = (totalLenSec % 60);QTime TotalTime(thh, tmm, tss);w->ui.lbTotalTime->setText(TotalTime.toString("hh:mm:ss"));double pos = (double)lenSec / totalLenSec * 100;w->ui.horizontalSlider->setValue(pos);}break;case libvlc_MediaPlayerEndReached:qDebug() << "VLC播放完毕.";break;case libvlc_MediaPlayerStopped:qDebug() << "VLC停止播放";break;case libvlc_MediaPlayerPlaying:qDebug() << "VLC开始播放";break;case libvlc_MediaPlayerPaused:qDebug() << "VLC暂停播放";break;}
}void showWidget::initMenu()
{//总菜单m_menu = new QMenu(this);m_video = m_menu->addAction("视频");//视频菜单m_videoMenu = new QMenu(this);m_scaleAction = m_videoMenu->addAction("缩放");m_aspectRatioAction = m_videoMenu->addAction("宽高比");m_cropAction = m_videoMenu->addAction("裁剪");m_snapAction = m_videoMenu->addAction("截图");connect(m_snapAction, &QAction::triggered, this, &showWidget::slotSnap);m_video->setMenu(m_videoMenu);//宽高比菜单m_aspectRatioMenu = new QMenu(this);m_aspectRatioAction->setMenu(m_aspectRatioMenu);//设置宽高比菜单m_default = m_aspectRatioMenu->addAction(QIcon(":/image/images/point.png"), "默认");m_16_9 = m_aspectRatioMenu->addAction("16:9");m_4_3 = m_aspectRatioMenu->addAction("4:3");m_1_1 = m_aspectRatioMenu->addAction("1:1");m_16_10 = m_aspectRatioMenu->addAction("16:10");m_2_21_1 = m_aspectRatioMenu->addAction("2.21:1");m_2_35_1 = m_aspectRatioMenu->addAction("2.35:1");m_2_38_1 = m_aspectRatioMenu->addAction("2.38:1");m_5_4 = m_aspectRatioMenu->addAction("5:4");m_preAspectRatio = m_default;m_group = new QActionGroup(this);m_group->addAction(m_default);m_group->addAction(m_16_9);m_group->addAction(m_4_3);m_group->addAction(m_1_1);m_group->addAction(m_16_10);m_group->addAction(m_2_21_1);m_group->addAction(m_2_35_1);m_group->addAction(m_2_38_1);m_group->addAction(m_5_4);connect(m_group, &QActionGroup::triggered, this, &showWidget::slotActionTriggered);//设置裁剪菜单m_cropMenu = new QMenu(this);m_cropAction->setMenu(m_cropMenu);m__cropDefault = m_cropMenu->addAction(QIcon(":/image/images/point.png"), "默认");m__crop16_10 = m_cropMenu->addAction("16:10");m__crop16_9 = m_cropMenu->addAction("16:9");m__crop4_3 = m_cropMenu->addAction("4:3");m__crop1_85_1 = m_cropMenu->addAction("1.85:1");m__crop2_21_1 = m_cropMenu->addAction("2.21:1");m__crop2_35_1 = m_cropMenu->addAction("2.35:1");m__crop2_39_1 = m_cropMenu->addAction("2.39:1");m__crop5_3 = m_cropMenu->addAction("5:3");m__crop5_4 = m_cropMenu->addAction("5:4");m__crop1_1 = m_cropMenu->addAction("1:1");m_preCrop = m__cropDefault;m_cropGroup = new QActionGroup(this);m_cropGroup->addAction(m__cropDefault);m_cropGroup->addAction(m__crop16_10);m_cropGroup->addAction(m__crop16_9);m_cropGroup->addAction(m__crop4_3);m_cropGroup->addAction(m__crop1_85_1);m_cropGroup->addAction(m__crop2_21_1);m_cropGroup->addAction(m__crop2_35_1);m_cropGroup->addAction(m__crop2_39_1);m_cropGroup->addAction(m__crop5_3);m_cropGroup->addAction(m__crop5_4);m_cropGroup->addAction(m__crop1_1);connect(m_cropGroup, &QActionGroup::triggered, this, &showWidget::slotCropActionTriggered);//设置缩放菜单m_scaleMenu = new QMenu(this);m_scaleAction->setMenu(m_scaleMenu);m_scale1_4 = m_scaleMenu->addAction("1:4 四分之一");m_scale1_2 = m_scaleMenu->addAction("1:2 二分之一");m_scale1_1 = m_scaleMenu->addAction(QIcon(":/image/images/point.png"),"1:1 原始");m_scale2_1 = m_scaleMenu->addAction("2:1 双倍");m_scaleGroup = new QActionGroup(this);m_scaleGroup->addAction(m_scale1_4);m_scaleGroup->addAction(m_scale1_2);m_scaleGroup->addAction(m_scale1_1);m_scaleGroup->addAction(m_scale2_1);m_preScale = m_scale1_1;connect(m_scaleGroup, &QActionGroup::triggered, this, &showWidget::slotScaleActionTriggered);
}

更多参考:

libVLC 事件机制-CSDN博客

libVLC windows开发环境搭建-CSDN博客

https://sunnnnnn666.blog.csdn.net/article/details/137023036

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/775083.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

vivado 使用远程主机和计算群集

使用远程主机和计算群集 概述 AMD Vivado™集成设计环境&#xff08;IDE&#xff09;支持同时并行合成和实现的执行在多个Linux主机上运行。你可以做到这一点通过配置单个主机或指定要在其上启动作业的命令手动执行现有的计算集群。目前&#xff0c;Linux是Vivado唯一支持远程主…

【Ollama】AI大模型本地部署

Ollama Ollama轻量级、可扩展的框架&#xff0c;用于在本地机器上构建和运行大型语言模型&#xff08;LLM&#xff09;。提供了一个简单的API来创建、运行和管理模型&#xff0c;以及一个预构建模型库&#xff0c;可以轻松用于各种应用程序。 明显优势&#xff1a;易于使用、…

python Flask扩展:如何查找高效开发的第三方模块(库/插件)

如何找到扩展以及使用扩展的文档 一、背景二、如何寻找框架的扩展&#xff1f;三、找到想要的扩展四、找到使用扩展的文档五、项目中实战扩展 一、背景 刚入门python的flask的框架&#xff0c;跟着文档学习了一些以后&#xff0c;想着其实在项目开发中&#xff0c;经常会用到发…

Python字符串操作

1.len(返回字符串的长度): text "Hello, world!" print(len(text)) # Output: 132.find(查找字符串在某字符串中是否包含): text "Hello, world!" print(text.find("world")) # Output: 7 3.index(查找字符串在某字符串中是否包含): tex…

图书推荐|Django+Vue.js商城项目实战

一线资深架构师 凝聚近十年大型系统开发经验 倾力打造 双色印刷 适合&#xff1a;项目演练求职应聘技术提升 全新&#xff1a;Django 4.x与Vue.js 3.x全栈技术 易学&#xff1a;娓娓道来图示指引原理剖析步骤解说代码详注 真实企业级项目技术细节完整揭秘&#xff0c;照着做就…

【JavaWeb】Day23.maven——依赖管理

依赖管理 一.依赖配置 依赖&#xff1a;指当前项目运行所需要的jar包。一个项目中可以引入多个依赖。 例如&#xff1a;在当前工程中&#xff0c;我们需要用到logback来记录日志&#xff0c;此时就可以在maven工程的pom.xml文件中&#xff0c;引入logback的依赖。具体步骤如…

开源大数据集群部署(十八)Hive 安装部署

作者&#xff1a;櫰木 1 创建hive Kerberos主体 bash /root/bigdata/getkeytabs.sh /etc/security/keytab/hive.keytab hive2 安装 在hd1.dtstack.com主机root权限下操作&#xff1a; 解压包 [roothd3.dtstack.com software]# tar -zxvf apache-hive-3.1.2-bin.tar.gz -C …

WPF 命名空间解释

在C#中有命名空间的概念&#xff0c;我们可以使用using引入&#xff0c;就可以使用其中的类&#xff0c;在xaml中&#xff0c;也同样有命名空间&#xff0c;在window标签中用xmlns声明的这几行&#xff0c;这就是本页面引入的命名空间。 一般的情况下&#xff0c;我们引入命名空…

钡铼技术R40工业4G路由器为户外广告牌智能控制系统提供无线网络

钡铼技术R40工业4G路由器在户外广告牌智能控制系统中的应用&#xff0c;为广告行业带来了革命性的变革。作为一种先进的无线通信设备&#xff0c;R40工业4G路由器通过其稳定的信号传输和强大的网络连接能力&#xff0c;为户外广告牌的智能控制系统提供了可靠的无线网络支持&…

汇编语言学习记录 01

目录 VScode配置调试环境 Debug的主要命令 简单写个Hello World VScode配置调试环境 没有IDE真的蛮难受的 安装插件TASM/MASM 右键扩展设置&#xff0c;选择Assembler&#xff1a;MASM 右键调试即可开始 Debug的主要命令 R-查看和修改寄存器 D-查看内存单元 E-修改内…

docker学习笔记 四-----docker基本使用方法

基础命令奉上&#xff1a; 1、docker命令查询方法 docker --help 获取docker命令帮助 docker search --help 查询docker 子命令search的帮助 2、查询镜像 查询镜像 docker search 192.168.206.100:5000/mysql 查询指定服务器指定镜像 docker search mysql …

树与二叉树的应用试题解析

01&#xff0e;在有n个叶结点的哈夫曼树中&#xff0c;非叶结点的总数是( A ). A. n-1 B. n C. 2n-1 D.2n 02.给定整数集合{3,5,6,9,12}&#xff0c;与之对应的哈夫曼树是( D…

OpenCV模块熟悉:点云处理相关

1. 显示--VIZ 曾经基于PCL 做过不少点云相关的开发&#xff0c;采样VTK进行有点云显示。后来基于OpenCV做了不少三维重建工作&#xff0c;总是将点云保存下来&#xff0c;然后借助CloudCompare等查看结果。如果能够将VIZ编译进来&#xff0c;预计会提升开发速度。 …

队列+宽搜例题讲解!

429. N 叉树的层序遍历 题目解析&#xff1a; 根据题目分析&#xff0c;可以看出题目要我们求的是N叉数的层序遍历&#xff0c;就是把每层的放在一块&#xff0c;最后把每层都输出出来即可&#xff01; 算法分析&#xff1a; 我们可以利用队列先进先出的特性进行求解&#x…

Machine Learning机器学习之K近邻算法(K-Nearest Neighbors,KNN)

目录 前言 背景介绍&#xff1a; 思想&#xff1a; 原理&#xff1a; KNN算法关键问题 一、构建KNN算法 总结&#xff1a; 博主介绍&#xff1a;✌专注于前后端、机器学习、人工智能应用领域开发的优质创作者、秉着互联网精神开源贡献精神&#xff0c;答疑解惑、坚持优质作品共…

基于大语言模型的云故障根因分析|顶会EuroSys24论文

*马明华 微软主管研究员 2021年CCF国际AIOps挑战赛程序委员会主席&#xff08;第四届&#xff09; 2021年博士毕业于清华大学&#xff0c;2020年在佐治亚理工学院做访问学者。主要研究方向是智能运维&#xff08;AIOps&#xff09;、软件可靠性。近年来在ICSE、FSE、ATC、EuroS…

人脸68关键点与K210疲劳检测

目录 人脸68关键点检测 检测闭眼睁眼 双眼关键点检测 计算眼睛的闭合程度&#xff1a; 原理: 设置阈值进行判断 实时监测和更新 拓展&#xff1a;通过判断上下眼皮重合程度去判断是否闭眼 检测嘴巴是否闭合 提取嘴唇上下轮廓的关键点 计算嘴唇上下轮廓关键点之间的距…

喜讯!聚铭网络荣获《日志分类方法及系统》发明专利

近日&#xff0c;聚铭网络又喜获一项殊荣&#xff0c;其申报的《日志分类方法及系统》发明专利成功获得国家知识产权局的授权&#xff0c;正式荣获国家发明专利证书。 在信息化时代&#xff0c;网络安全问题日益凸显&#xff0c;日志分析作为保障网络安全的重要手段&#xff…

SpringBoot多线程查询实战-查询库中所有数据多线程实现

文章目录 案例说明测试结论Controller层核心代码测试数据生成测试报告源码获取 案例说明 本案例我们希望使用三种方式查询数据库某张表下所有数据&#xff1a; 单线程分页查询获取所有数据单线程直接查询获取所有数据多线程分页查询获取所有数据 测试结论 ​ ​ ​在比较…

3D数据格式导出工具HOOPS Publish如何生成高质量3D PDF?

在当今数字化时代&#xff0c;从建筑设计到制造业&#xff0c;从医学领域到电子游戏开发&#xff0c;3D技术已经成为了不可或缺的一部分。在这个进程中&#xff0c;将3D模型导出为3D PDF格式具有重要的意义。同时&#xff0c;HOOPS Publish作为一个领先的解决方案&#xff0c;为…