当前位置:网站首页>EmguCV录制视频
EmguCV录制视频
2022-07-23 12:03:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
我所录制的为摄像头的视频: 使用的函数为VideoWriter。
using System;
using System.Drawing;
using System.Windows.Forms;
using Emgu.CV;
using Emgu.CV.CvEnum;
using Emgu.CV.Structure;
namespace EmguCVHist
{
public partial class Form1 : Form
{
Capture cap;
Image<Bgr, byte> frame;
VideoWriter vw;
public Form1()
{
InitializeComponent();
cap = new Emgu.CV.Capture(1);
vw = new VideoWriter("123.avi", 30, new Size(cap.Width, cap.Height), true);
cap.Start();
frame = new Image<Bgr, byte>(cap.Width, cap.Height);
cap.ImageGrabbed += Cap_ImageGrabbed;
cap.SetCaptureProperty(CapProp.Fps, 0);
}
private void Cap_ImageGrabbed(object sender, EventArgs e)
{
cap.Retrieve(frame, 0);
vw.Write(frame.Mat);
imageBox1.Image = frame;
}
}
}最后录制的视频会储存在项目所在文件夹的bin目录下的debug或release文件夹中。 最终效果:
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/126250.html原文链接:https://javaforall.cn
边栏推荐
- Ultra detailed MP4 format analysis
- [suctf 2018]multisql (MySQL precompiled)
- 现代商业无代码开发平台的治理和网络安全
- W3C introduces decentralized identifier as web standard
- It's too hard! Tencent T4 boss was still staying up late at 4 a.m. and was actually sorting out the distributed transaction notes
- Fake XML cookbook of XML xxE vulnerability
- Bean Validation核心组件篇----04
- Redis installation
- ICML 2022 | 稀疏双下降:网络剪枝也能加剧模型过拟合?
- ESP8266 NodeMCU 闪存文件系统(SPIFFS)
猜你喜欢

After effects tutorial, how to create animation in after effects?

VRRP+MSTP配置详解【华为eNSP实验】

Governance and network security of modern commercial codeless development platform

Bubble sort - just read one

MySQL 灵魂 16 问,你能撑到第几问?

Éléments de base de la validation des haricots - 04

After Effects 教程,如何在 After Effects 中创建动画?

How beautiful can VIM be configured?

The difference between deadlock, hunger and dead cycle

Summary of server performance tuning experience
随机推荐
Cloud native (11) | kubernetes chapter kubernetes principle and installation
链表合并(暑假每日一题 3)
FPGA-HLS-乘法器(流水线对比普通仿真)
Gear monthly update June
虚拟主播、偶像代言产品出问题谁负责?律师解析
Mysql—主从复制
GO语言学习——复习包、接口、文件操作
Backup content hahaha
Who is responsible for the problems of virtual anchor and idol endorsement products? Lawyer analysis
Please initialize the log4j system properly.
[suctf 2018]multisql (MySQL precompiled)
剑指 Offer II 115. 重建序列 : 拓扑排序构造题
[untitled]
It's too hard! Tencent T4 boss was still staying up late at 4 a.m. and was actually sorting out the distributed transaction notes
满足多种按键的高性价比、高抗干扰触摸IC:VK3606D、VK3610I、VK3618I 具有高电源电压抑制比
SharedPreferences data storage
Bean validation core components - 04
快递单证智能OCR识别,助力物流行业数字化升级
中年危机,35岁被退休,打工人拿什么来抗衡资本家?
LeetCode高频题:最少经过几次操作可以使数组变为非降序状态