Пример #1
0
        // ---------------------------------------------------------------
        // create new viddo file
        public override void StartRecord()
        {
            if (vsEncoder == null)
            {
                try
                {
                    vsEncoder = new AviEncoder();
                }
                catch (Exception err)
                {
                    if (vsEncoder != null)
                    {
                        vsEncoder.Dispose();
                        vsEncoder = null;
                    }
                    logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace);;
                }
            }

            if (vsEncoder != null && !vsEncoder.Recording)
            {
                // check & create directory
                process_DirName();

                try
                {
                    // create new file
                    vsEncoder.StartRecord(rawName, (int)(1000 / syncTimer), width, height);

                    // initial parameters
                    timeMaxLength = 0;
                    thumbCount    = 0;
                    thumbSave     = false;
                    stimer.Start();
                }
                catch (Exception err)
                {
                    // error log
                    logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace);;

                    // stop encoder
                    StopRecord(false);
                }
            }
        }
Пример #2
0
        public override void StartRecord()
        {
            if (vsEncoder == null)
            {
                try
                {
                    // new object
                    vsEncoder = new AviEncoder();
                }
                catch (Exception err)
                {
                    // error log
                    logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace);
                }
            }
            else
            {
                return;
            }

            try
            {
                // check & create directory
                process_DirName();

                // create new file
                vsEncoder.StartRecord("wmv3", aviName, (int)(1000 / syncTimer), width, height);

                // init encoder
                InitEncoder();

                // start counter
                StartCounter();
            }
            catch (Exception err)
            {
                // error log
                logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace);

                // if error stop record
                StopRecord();
            }
        }