Example #1
0
        /// <summary>
        /// Пользователь нажал продолжить
        /// </summary>
        private void Continue(object sender, EventArgs e)
        {
            var info       = GetLocalVideoDirectory();
            var remoteInfo = GetRemoteVideoDirectory();
            //Получаем спискок видео
            var lastVideo = info.EnumerateFiles("MVI*.mov").OrderByDescending(p => p.CreationTimeUtc).FirstOrDefault();

            if (lastVideo != null)
            {
                //Запускаем конвертацию в фоне
                Process process = new Process();
                process.StartInfo.RedirectStandardOutput = true;
                process.StartInfo.UseShellExecute        = false;
                process.StartInfo.CreateNoWindow         = true;
                process.StartInfo.FileName  = "ffmpeg.exe";
                process.StartInfo.Arguments = $"-i \"{info.FullName}\\{lastVideo.Name}\" -vf scale=400x226 \"{remoteInfo.FullName}\\Min{lastVideo.Name}\"";
                process.Start();
                process.WaitForExit();
                //Грохаем орегинал
                lastVideo.Delete();
            }
            //заново запускам LV и показываем LV
            TakeVideoControl.StartLiveView();
            TakeVideoControl.Visibility   = Visibility.Visible;
            VideoResultControl.Visibility = Visibility.Collapsed;
        }
Example #2
0
        /// <summary>
        /// Пользователь нажал еще раз
        /// </summary>
        private void VideoRepeat(object sender, EventArgs e)
        {
            //Грохаем последний файл
            var info      = GetLocalVideoDirectory();
            var lastVideo = info.EnumerateFiles("MVI*.mov").OrderByDescending(p => p.CreationTimeUtc).FirstOrDefault();

            if (lastVideo != null)
            {
                lastVideo.Delete();
            }
            //Запускаем LV и показываем LV
            TakeVideoControl.StartLiveView();
            TakeVideoControl.Visibility   = Visibility.Visible;
            VideoResultControl.Visibility = Visibility.Collapsed;
            //Начинаем отсчет
            TakeVideoControl.InitRecord();
        }