C# RTSP摄像头监控分屏

您所在的位置:网站首页 vlc监控屏幕 C# RTSP摄像头监控分屏

C# RTSP摄像头监控分屏

2024-07-13 09:54| 来源: 网络整理| 查看: 265

软件特色

1. 简明轻巧(只需更改配置文件的视频流地址就能播放;使用高性能rtsp播放器,开流关流瞬开,延时更低(200ms内),软解CPU占用更低,支持rtsp及rtmp)

2. 自适应屏幕分辨率

3. 自定义分屏及任意更改某一路视频流地址

 

代码部分

 

using System; using System.Collections.Generic; using System.Configuration; using System.Windows.Forms; namespace RtspPlayerPro { public partial class MainForm : Form { // 视频流数据字典 Dictionary dicVideo = new Dictionary(); public MainForm() { InitializeComponent(); // 适配屏幕分辨率 this.Width = SystemInformation.VirtualScreen.Width; this.Height = SystemInformation.VirtualScreen.Height; this.Location = new System.Drawing.Point(0, 0); AutoScreenSize.AutoControls(this); } private void MainForm_Load(object sender, EventArgs e) { // 加载视频流数据 int ScreenMaxNum = Convert.ToInt32(ConfigurationManager.AppSettings["ScreenMaxNum"]); for (int i = 0; i < ScreenMaxNum; i++) { var url = ConfigurationManager.AppSettings["VideoUrl" + (i + 1).ToString()]; if (null != url) { dicVideo.Add(i, url); } } previewScreen1.DispalyMonitor(1);// 默认1画面 cmbScreenNum.SelectedIndex = 0; } private void cmbScreenNum_SelectedIndexChanged(object sender, EventArgs e) { // 播放布局更新 previewScreen1.CloseAllMonitor(); int ScreenNum = Convert.ToInt32(cmbScreenNum.Text); previewScreen1.DispalyMonitor(ScreenNum); foreach (KeyValuePair video in dicVideo) { if (video.Key > (ScreenNum - 1)) break; previewScreen1.AddPreviewPlayer(video.Key, video.Value); } } private void btnPlay_Click(object sender, EventArgs e) { // 播放线路更新 int videoIndex = Convert.ToInt32(txtVideoIndex.Text) - 1; if (videoIndex < 0) videoIndex = 0; string videoUrl = txtVideoUrl.Text; previewScreen1.AddPreviewPlayer(videoIndex, videoUrl); // 同步更新到视频流数据字典 dicVideo[videoIndex] = videoUrl; } } }

程序架构

软件运行

 32路测试

电脑配置

 

 



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3