示例#1
0
 public MainWindow()
 {
     InitializeComponent();
     Screenshoter = new Screenshoter();
     Video        = new VideoMaker();
     Timer        = new DispatcherTimer();
 }
示例#2
0
        static void Main(string[] args)
        {
            if (args.Length > 0)
            {
                VideoMaker videoMaker = new VideoMaker();

                videoMaker = VideoMaker.LoadFromFile(args[0]);
                videoMaker.Run();
            }
        }
        public IFinalVisualizer GetFinalVisualizer(ICostReviewer storage)
        {
            var costVisualizationSize = parameters.CostVisualizationSize;
            var totalSize             = new Point(Math.Max(getParticleVisualizationSize().X, costVisualizationSize.X),
                                                  getParticleVisualizationSize().Y + costVisualizationSize.Y);
            var videoMaker = new VideoMaker(getMainPath() + "MergedPictures\\", getMainPath() + "FinalVideo\\",
                                            parameters.VideoName + ".avi", totalSize);
            var accumAllToOneCost = new AccumCostReviewer(new SingleCoreCostReviewer(storage));
            var finalVis          = new FinalVisualizer(videoMaker, parameters.SnapTime,
                                                        new CostPrinter(getMainPath() + "CostPrints\\", accumAllToOneCost, "FINAL"));

            return(finalVis);
        }
示例#4
0
    public void Generate(VideoMaker videoMaker)
    {
        aviManager = new AviFile.AviManager(fileName, false);
        Console.WriteLine("Video ID:" + this.Id + " with name: " + fileName);
        Console.WriteLine("Number of Sequences: " + this.Sequences.Length);
        int sequenceNumber = 1;

        foreach (var sequence in Sequences)
        {
            Console.WriteLine("Processing Video " + sequenceNumber.ToString() + " : " + sequence.Id);
            ++sequenceNumber;
        }
    }
示例#5
0
        private void ProcessRecords(IEnumerable <string[]> data, VideoSpec spec, VideoMaker maker)
        {
            foreach (var record in data)
            {
                spec.Name = Path.Combine(txtOutputFolder.Text, record[0] + ".wmv");
                spec.Text = record[1];

                SetStatus(spec.Name);

                pbStatus.Increment(1);
                maker.Create(spec);
                pbStatus.Increment(1);
            }
        }
示例#6
0
        public void CreateCountdownFrames(HttpContext web, VideoMaker maker)
        {
            string type   = web.Request.Params["TvFormat"];
            int    frames = 0;

            if ("ntsc" == type)
            {
                frames = TvType.Ntsc.FrameRate.GetValueOrDefault();
            }
            for (int i = frames; i >= 0; i--)
            {
                maker.CreateFrame("" + i);
            }
        }
示例#7
0
        private void SaveImage()
        {
            int width  = 1024;
            int height = 1024;

            var        snapShotBmp = new Bitmap(width, height);
            BitmapData bmpData     = snapShotBmp.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.WriteOnly,
                                                          System.Drawing.Imaging.PixelFormat.Format24bppRgb);

            GL.ReadPixels(0, 0, width, height, OpenTK.Graphics.OpenGL.PixelFormat.Bgr, PixelType.UnsignedByte,
                          bmpData.Scan0);
            snapShotBmp.UnlockBits(bmpData);
            snapShotBmp.RotateFlip(RotateFlipType.RotateNoneFlipXY);
            VideoMaker.writeImage(snapShotBmp);
        }
 public async Task <string> Filter()
 {
     return(await VideoMaker.Process());
 }
 public VideoServiceImpl(VideoMaker videoMaker, VideoRepository videoRepository, IHostingEnvironment hostingEnvironment)
 {
     _videoMaker         = videoMaker;
     _videoRepository    = videoRepository;
     _hostingEnvironment = hostingEnvironment;
 }
        public ProceedViewModel()
        {
            Model = new ProceedModel();
            OpenNewVideoFileIsEnabled = true;
            OutputPathTextBox         = "Select output directory";

            BrowseOutputDirectory = new RelayCommand(() =>
            {
                try
                {
                    OutputPathTextBox = Utils.Directories.BrowseDirectory(OutputPathTextBox);
                    if (OutputPathTextBox != null)
                    {
                        StartIsEnabled = true;
                    }
                }
                catch (Exception ex)
                {
                    Logger.Log(string.Concat(ex.Message, "\r\n", ex.StackTrace));
                    MessageBox.Show(ex.Message);
                }
            });

            Start = new RelayCommand(async() =>
            {
                try
                {
                    StartIsEnabled            = false;
                    OpenNewVideoFileIsEnabled = false;
                    var maker         = new VideoMaker();
                    maker.PBValEvent += SetPBValue;
                    maker.CurrentTimeProceededEvent += SetCurrTimeProc;
                    maker.VidInfo        = VidInfo;
                    maker.IfOpenNewVideo = OpenNewVideoFileIsChecked;
                    maker.OutputDir      = OutputPathTextBox;
                    ProgressBarMax       = Model.Vid.VideoReader.FrameCount;
                    if (ProgressBarMax == 0)
                    {
                        ProgressBarIndeterminate = true;
                    }
                    maker.PBIndeterminate = ProgressBarIndeterminate;
                    bool result           = await Task.Factory.StartNew(() => maker.MakeVideo());
                    if (result)
                    {
                        Switcher.Switch(new SuccesView());
                    }
                    else
                    {
                        MessageBox.Show("Could not create a video file.");
                        Switcher.Switch(new MainView());
                    }
                }
                catch (Exception ex)
                {
                    Logger.Log(string.Concat(ex.Message, "\r\n", ex.StackTrace));
                    MessageBox.Show(ex.Message);
                }
            });
            BackToFirstVideo = new RelayCommand(() =>
            {
                Model = null;
                Switcher.Switch(new MainView());
            });
        }
示例#11
0
文件: MainForm.cs 项目: njmube/public
        private void ProcessRecords(IEnumerable<string[]> data, VideoSpec spec, VideoMaker maker)
        {
            foreach (var record in data)
              {
            spec.Name = Path.Combine(txtOutputFolder.Text, record[0] + ".wmv");
            spec.Text = record[1];

            SetStatus(spec.Name);

            pbStatus.Increment(1);
            maker.Create(spec);
            pbStatus.Increment(1);
              }
        }