コード例 #1
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            StartTime = DateTime.Now;
            WatchTimer.Start();
            btnStart.Enabled = false;
            btnStop.Enabled  = true;
            btnPause.Enabled = true;
            movieMaker       = new MovieMaker();
            if (!Directory.Exists(VideosPath))
            {
                Directory.CreateDirectory(VideosPath);
            }
            var    name     = movieMaker.GenerateName();
            string filename = Path.Combine(VideosPath, name);

            movieMaker.Start(filename);
        }
コード例 #2
0
    private bool SaveVideo(string filePath, string toSaveFileName)
    {
        IMovieMaker moviewMaker = new MovieMaker(Server.MapPath("/bin"), _logger);
        var         movieFile   = new FileInfo(filePath);

        if (movieFile.Extension.ToLower().Contains(".flv"))
        {
            moviewMaker.GenerateMPEG(filePath, movieFile.Directory.FullName + "\\", Path.GetFileNameWithoutExtension(filePath));
            return(true);
        }
        try
        {
            var videoFile = moviewMaker.GenerateMoviefromAvi(filePath, movieFile.Directory.FullName + "\\", Path.GetFileNameWithoutExtension(toSaveFileName));
            moviewMaker.GenerateMPEG(movieFile.Directory.FullName + "\\" + videoFile, movieFile.Directory.FullName + "\\", Path.GetFileNameWithoutExtension(toSaveFileName));
            return(true);
        }
        catch (Exception ex)
        {
            _logger.Info("Video File Not Generated. Message: " + ex.Message + ".\n\t" + ex.StackTrace);
            return(false);
        }
    }
コード例 #3
0
ファイル: MediaHelper.cs プロジェクト: sahvishal/matrix
        private bool SaveVideo(string filePath, string toSaveFileName, string mediaLocation)
        {
            IMovieMaker moviewMaker = new MovieMaker(Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName, _logger);
            var         movieFile   = new FileInfo(filePath);

            if (movieFile.Extension.ToLower().Contains(".flv"))
            {
                moviewMaker.GenerateMPEGWithoutRedis(filePath, mediaLocation + "\\", Path.GetFileNameWithoutExtension(filePath));
                return(true);
            }

            try
            {
                var videoFilePath = moviewMaker.GenerateMoviefromAviWithoutRedis(filePath, mediaLocation + "\\", Path.GetFileNameWithoutExtension(toSaveFileName));
                moviewMaker.GenerateMPEGWithoutRedis(mediaLocation + "\\" + videoFilePath, mediaLocation + "\\", Path.GetFileNameWithoutExtension(toSaveFileName));
                return(true);
            }
            catch (Exception ex)
            {
                _logger.Info("Video File Not Generated. Message: " + ex.Message + ".\n\t" + ex.StackTrace);
                return(false);
            }
        }
コード例 #4
0
        public void Execute()
        {
            int maxCondition = 0;

            if (!string.IsNullOrEmpty(searchConditionText))
            {
                maxCondition++;
            }
            if (searchConditionKinds != null && searchConditionKinds.Length > 0)
            {
                maxCondition++;
            }

            int matchCnt = 0;

            ColViewListMakers.Filter = delegate(object o)
            {
                MovieMaker data = o as MovieMaker;

                if (data == null)
                {
                    return(false);
                }

                if (searchConditionAuto)
                {
                    if (data.RegisterdBy != null && data.RegisterdBy.IndexOf("AUTO", StringComparison.OrdinalIgnoreCase) >= 0)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                if (searchConditionText == null && searchConditionKinds == null)
                {
                    return(true);
                }

                matchCnt = 0;
                if (!string.IsNullOrEmpty(searchConditionText))
                {
                    if (data.Name.ToUpper().IndexOf(searchConditionText) >= 0 ||
                        data.Label.ToUpper().IndexOf(searchConditionText) >= 0 ||
                        data.MatchStr.ToUpper().IndexOf(searchConditionText) >= 0)
                    {
                        matchCnt++;
                    }
                }

                if (searchConditionKinds != null && searchConditionKinds.Length > 0)
                {
                    foreach (int condKind in searchConditionKinds)
                    {
                        if (condKind == data.Kind)
                        {
                            matchCnt++;
                            break;
                        }
                    }
                }

                if (maxCondition <= matchCnt)
                {
                    return(true);
                }

                return(false);
            };
        }