Start() public method

Start video source.
Starts video source and return execution to caller. Video source object creates background thread and notifies about new frames with the help of NewFrame event.
Video source is not specified.
public Start ( ) : void
return void
Beispiel #1
2
        public CameraRecorder(string address)
        {
            this.address = address;
            stream = new MJPEGStream(address + "/image?speed=0");

            recorder = new AVIWriter("XVID");
            recorder.FrameRate = 10;
            recorder.Open("c:\\test.avi", 736, 480);

            stream.NewFrame += newFrameEvent;

            stream.Login = "******";
            stream.Password = "******";
            stream.Start();
        }
Beispiel #2
0
        public CameraRecorder(ConnectionConfigData conf, string path, double fps)
        {
            this.address = "http://"+conf.Address;
            this.path = path;
            this.fps = fps;

            stream = new MJPEGStream("http://"+ address + "/image?speed=0");
            stream.NewFrame += newFrameEvent;
            startRecord(path, (int)fps);
            stream.Login = conf.UserName;
            stream.Password = conf.Password;
            stream.Start();
        }
Beispiel #3
0
        private void OpenVideoStream()
        {
            string url = "http://localhost:8080/";

            Console.WriteLine ("Connecting to {0}", url);
            videoStream = new MJPEGStream (url);

            videoStream.NewFrame += (Object sender, NewFrameEventArgs eventArgs) => {
                if (videoFrame != null)
                    lock (videoFrame) {
                        videoFrame = new Bitmap (eventArgs.Frame);
                    }
                else
                    videoFrame = new Bitmap (eventArgs.Frame);

            };

            videoStream.Start ();
        }
Beispiel #4
0
        public static void VidTest()
        {
            List<Bitmap> frames = new List<Bitmap>();

            AVIWriter aw = new AVIWriter("DIB ");
            aw.FrameRate = 15;
            aw.Open("test2.avi",320,240);
            int i = 0;
            string surl = "";
            MJPEGStream ms = new MJPEGStream();
            ms.Login = "";
            ms.Password = "";
            ms.Source = surl;
            ms.NewFrame += (sender, e) =>
            {
                i++;
                //frames.Add(e.Frame);
                aw.AddFrame(e.Frame);
                e.Frame.Save("test" + i.ToString() + ".jpg", ImageFormat.Jpeg);

            //	            ((MJPEGStream)sender).Stop();
            };

            ms.Start();
            System.Threading.Thread.Sleep(4000);
            ms.Stop();
            aw.Close();

            //
        }
 public override void Init()
 {
     if (stream != null)
     {
         throw new Exception("Stream Allready Initialized. Use RestartStream To Create A New One");
     }
     stream = new MJPEGStream(CameraURL);
     stream.NewFrame += stream_NewFrame;
     stream.Proxy = null;
     setSource();
     stream.Start();
     isRunning = true;
 }
Beispiel #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            string res="8";

            if (conf.HighResolution)
            {
                res = "32";
            }
            else
            {
                res = "8";
            }

            stream = new MJPEGStream(conf.Address+"/image?speed=0");
            stream.NewFrame += videoSource_NewFrame;
            a = new AVIWriter("wmv3");
            a.FrameRate = 20;
            a.Open("c:\\test.avi", 736, 480);
            stream.Login = conf.UserName;
            stream.Password = conf.Password;
            button1.Enabled = false;
            button2.Enabled = true;

            //motionDetector = new MotionDetector(new TwoFramesDifferenceDetector(), new MotionAreaHighlighting());

            videoSourcePlayer1.VideoSource = stream;
            stream.Start();
            Text = "[Conectado] IPCam";
        }
Beispiel #7
0
        private void btnView_Click(object sender, EventArgs e)
        {
            stream = new MJPEGStream("http://"+conf[0].Address + "/videostream.cgi");
            stream.NewFrame += videoSource_NewFrame;
            stream.Login = conf[0].UserName;
            stream.Password = conf[0].Password;
            if (conf.Count > 1)
            {
                stream2 = new MJPEGStream("http://" + conf[1].Address + "/videostream.cgi");
                //stream2.NewFrame += videoSource_NewFrame;
                stream2.Login = conf[1].UserName;
                stream2.Password = conf[1].Password;

                videoSourcePlayer2.VideoSource = stream2;
            }
            if (conf.Count > 2)
            {
                stream3 = new MJPEGStream("http://" + conf[2].Address + "/videostream.cgi");
                //stream2.NewFrame += videoSource_NewFrame;
                stream3.Login = conf[2].UserName;
                stream3.Password = conf[2].Password;

                videoSourcePlayer3.VideoSource = stream3;
            }

            btnView.Enabled = false;
            btndesconect.Enabled = true;
            btnConfig.Enabled = false;
            btnRecoder.Enabled = true;

            // motionDetector = new MotionDetector(new TwoFramesDifferenceDetector(), new MotionAreaHighlighting());

            videoSourcePlayer1.VideoSource = stream;

            stream.Start();
            stream2.Start();

            Text = "[Conectado] IPCam";
        }