資源簡介
C#基于第三方控件開發的屏幕,攝像頭錄像軟件代碼,可實現二次開發。
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Threading.Tasks;
using?System.Windows.Forms;
using?Oraycn.MCapture;
using?Oraycn.MFile;
using?ESBasic;
namespace?Video
{
????public?partial?class?Form1?:?Form
????{
????????private?ICapturer?audioCapturer;
????????private?ICapturer?videoCapturer;
????????private?VideoFileMaker?videoFileMaker;
????????private?int?starTime?=?0;//開始錄制初始時間
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????comboBox1.SelectedIndex?=?1;
????????????comboBox2.SelectedIndex?=?0;
????????????textBox1.Enabled?=?false;
????????????textBox2.Enabled?=?false;
????????????button2.Enabled?=?false;
????????????停止ToolStripMenuItem.Enabled?=?false;
????????????notifyIcon1.Visible?=?false;
????????}
????????//開始錄像
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????this.button1.Enabled?=?false;//禁用按鈕同時作為標記位
????????????開始ToolStripMenuItem.Enabled?=?false;
????????????//采樣率
????????????int?audioSampleRate?=?16000;
????????????//聲道
????????????int?channelCount?=?1;
????????????if?(this.comboBox1.SelectedItem.ToString()?==?“麥克風“)
????????????{
????????????????this.audioCapturer?=?CapturerFactory.CreateMicrophoneCapturer(0);
????????????????((IMicrophoneCapturer)this.audioCapturer).AudioCaptured?+=?new?ESBasic.CbGeneric(AudioCaptured);
????????????}
????????????else?//聲卡
????????????{
????????????????this.audioCapturer?=?CapturerFactory.CreateSoundcardCapturer();
????????????????((ISoundcardCapturer)this.audioCapturer).AudioCaptured?+=?new?ESBasic.CbGeneric(AudioCaptured);
????????????????audioSampleRate?=?((ISoundcardCapturer)this.audioCapturer).SampleRate;
????????????????channelCount?=?((ISoundcardCapturer)this.audioCapturer).ChannelCount;
????????????}
????????????int?frameRate?=?15;
????????????System.Drawing.Size?videoSize?=?new?Size(int.Parse(this.textBox1.Text?)?int.Parse(this.textBox2.Text?));
????????????if?(this.comboBox2.SelectedItem.ToString?()==“攝像頭“)?//攝像頭
????????????{
????????????????this.videoCapturer?=?CapturerFactory.CreateCameraCapturer(0?videoSize?frameRate);
????????????????((ICameraCapturer)this.videoCapturer).ImageCaptured?+=?new?ESBasic.CbGeneric(ImageCaptured);
????????????}
????????????else?//?桌面
????????????{
????????????????this.videoCapturer?=?CapturerFactory.CreateDesktopCapturer(frameRate?false);
????????????????((IDesktopCapturer)this.videoCapturer).ImageCaptured?+=?new?ESBasic.CbGeneric(ImageCaptured);
????????????}
????????????videoFileMaker?=?new?VideoFileMaker();
????????????this.videoFileMaker.Initialize(“Video.mp4“?VideoCodecType.H264?videoSize.Width?videoSize.Height?frameRate?AudioCodecType.AAC?audioSampleRate?channelCou
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????7984428??2015-06-05?16:15??屏幕錄像\Oraycn.RecordDemo.rar
?????文件????????187??2015-06-08?08:04??屏幕錄像\Video\App.config
?????文件???13496832??2012-12-06?15:38??屏幕錄像\Video\bin\Debug\avcodec-53.dll
?????文件?????349696??2012-12-06?15:37??屏幕錄像\Video\bin\Debug\avdevice-53.dll
?????文件?????890880??2012-12-06?15:37??屏幕錄像\Video\bin\Debug\avfilter-2.dll
?????文件????2462208??2012-12-06?15:38??屏幕錄像\Video\bin\Debug\avformat-53.dll
?????文件?????137728??2012-12-06?15:37??屏幕錄像\Video\bin\Debug\avutil-51.dll
?????文件?????398336??2015-05-27?17:24??屏幕錄像\Video\bin\Debug\ESBasic.dll
?????文件?????142336??2015-06-01?10:14??屏幕錄像\Video\bin\Debug\OMFile.dll
?????文件????1164800??2015-06-01?09:33??屏幕錄像\Video\bin\Debug\Oraycn.MCapture.dll
?????文件?????118272??2015-06-01?10:14??屏幕錄像\Video\bin\Debug\Oraycn.MFile.dll
?????文件?????296960??2012-12-06?15:37??屏幕錄像\Video\bin\Debug\swscale-2.dll
?????文件????????187??2015-06-08?08:04??屏幕錄像\Video\bin\Debug\Video.vshost.exe.config
?????文件????????490??2010-03-17?22:39??屏幕錄像\Video\bin\Debug\Video.vshost.exe.manifest
?????文件??????24064??2015-06-13?16:18??屏幕錄像\Video\bin\Debug\錄像工具.exe
?????文件????????187??2015-06-08?08:04??屏幕錄像\Video\bin\Debug\錄像工具.exe.config
?????文件??????30208??2015-06-13?16:18??屏幕錄像\Video\bin\Debug\錄像工具.pdb
?????文件??????24224??2015-06-13?16:15??屏幕錄像\Video\bin\Debug\錄像工具.vshost.exe
?????文件????????187??2015-06-08?08:04??屏幕錄像\Video\bin\Debug\錄像工具.vshost.exe.config
?????文件????????490??2010-03-17?22:39??屏幕錄像\Video\bin\Debug\錄像工具.vshost.exe.manifest
?????文件???????9216??2015-06-13?16:18??屏幕錄像\Video\Form1.cs
?????文件??????17235??2015-06-13?16:17??屏幕錄像\Video\Form1.Designer.cs
?????文件??????11493??2015-06-13?16:17??屏幕錄像\Video\Form1.resx
?????文件???????1406??2015-06-08?16:33??屏幕錄像\Video\noti.ico
?????文件???????1453??2015-06-08?10:58??屏幕錄像\Video\obj\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件???????7295??2015-06-13?16:11??屏幕錄像\Video\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件??????????0??2015-06-08?08:04??屏幕錄像\Video\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
?????文件??????????0??2015-06-08?08:04??屏幕錄像\Video\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
?????文件??????????0??2015-06-08?08:04??屏幕錄像\Video\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
?????文件???????1206??2015-06-13?16:18??屏幕錄像\Video\obj\Debug\Video.csproj.FileListAbsolute.txt
............此處省略27個文件信息
- 上一篇:電子商務網站asp.NET+論文
- 下一篇:C#大作業——圖書管理系統完整版
評論
共有 條評論