示例#1
0
        private void ConvertToMp4()
        {
            string command = string.Format(VideoToMp4, "d:\\test.avi", "d:\\test.mp4");

            MepgHelper.ExecVideoCommand(command,
                                        (sender, e) =>
            {
                if (e.Data != null)
                {
                    //Debug.Write(e.Data.ToString() + "\r\n");
                }
            },
                                        (sender, e) =>
            {
            });
        }
示例#2
0
        /// <summary>
        /// 获取屏幕上所有音频和视频设备
        /// </summary>
        public string GetVideoAndAudioDev()
        {
            string           result  = "";
            DevState         state   = DevState.None;
            VideoAndAudioDev devs    = new VideoAndAudioDev();
            string           devName = string.Empty;

            MepgHelper.ExecVideoCommand(VideoAndAudioList,
                                        (sender, e) =>
            {
                state = MepgHelper.GetDevId(e.Data, state, ref devs, ref devName);
            },
                                        (sender, e) =>
            {
                _events.Publish(new DevListMessage {
                    Data = devs
                }, (t) => { Task.Factory.StartNew(t); });
            });
            return(result);
        }
示例#3
0
        /// <summary>
        /// 录制屏幕
        /// </summary>
        /// <returns></returns>
        public bool RecordScreen(AudioDev dev, ScreenData data)
        {
            string area = (data.RectSelectArea.Width % 2 == 0 ? data.RectSelectArea.Width.ToString() : (data.RectSelectArea.Width + 1.0).ToString())
                          + "x"
                          + (data.RectSelectArea.Height % 2 == 0 ? data.RectSelectArea.Height.ToString() : (data.RectSelectArea.Height + 1.0).ToString());
            string command = string.Format(RecordScreenConst,
                                           data.RectSelectArea.X,
                                           data.RectSelectArea.Y,
                                           area,
                                           data.FileName, dev.DevId);

            MepgHelper.ExecVideoCommand(command,
                                        (sender, e) =>
            {
                if (e.Data != null)
                {
                    //Debug.Write(e.Data.ToString()+"\r\n");
                }
            },
                                        (sender, e) =>
            {
            });
            return(true);
        }
示例#4
0
 /// <summary>
 /// 停止当前操作
 /// </summary>
 /// <returns></returns>
 public void Stop()
 {
     MepgHelper.Stop();
     //  ConvertToMp4();
 }