Example #1
0
        void HandleOpenedProjectChanged(Project project, ProjectType projectType,
                                        EventsFilter filter, IAnalysisWindow analysisWindow)
        {
            this.openedProject = project;
            this.projectType   = projectType;
            this.filter        = filter;

            if (project == null)
            {
                if (framesCapturer != null)
                {
                    framesCapturer.Dispose();
                    framesCapturer = null;
                }
                return;
            }

            if (projectType == ProjectType.FileProject)
            {
                framesCapturer = Config.MultimediaToolkit.GetFramesCapturer();
                framesCapturer.Open(openedProject.Description.FileSet.First().FilePath);
            }
            this.analysisWindow = analysisWindow;
            player   = analysisWindow.Player;
            capturer = analysisWindow.Capturer;
        }
 public FramesSeriesCapturer(string videoFile,long start, long stop, uint interval, string outputDir)
 {
     MultimediaFactory mf= new MultimediaFactory();
     this.capturer=mf.GetFramesCapturer();
     this.capturer.Open(videoFile);
     this.start= start;
     this.stop = stop;
     this.interval = interval;
     this.outputDir = outputDir;
     this.seriesName = System.IO.Path.GetFileName(outputDir);
     this.totalFrames = (int)Math.Floor((double)((stop - start) / interval))+1;
 }
Example #3
0
 public FramesSeriesCapturer(MediaFileSet fileSet, TimelineEvent evt, uint interval, string outputDir)
 {
     this.capturer = Config.MultimediaToolkit.GetFramesCapturer ();
     this.fileSet = fileSet;
     this.evt = evt;
     this.start = evt.Start;
     this.stop = evt.Stop;
     this.interval = interval;
     this.outputDir = outputDir;
     this.seriesName = System.IO.Path.GetFileName (outputDir);
     this.totalFrames = ((int)Math.Floor ((double)((stop - start).MSeconds / interval)) + 1) * evt.CamerasConfig.Count;
     this.cancel = false;
 }
Example #4
0
        public FramesSeriesCapturer(string videoFile, long start, long stop, uint interval, string outputDir)
        {
            MultimediaFactory mf = new MultimediaFactory();

            this.capturer = mf.GetFramesCapturer();
            this.capturer.Open(videoFile);
            this.start       = start;
            this.stop        = stop;
            this.interval    = interval;
            this.outputDir   = outputDir;
            this.seriesName  = System.IO.Path.GetFileName(outputDir);
            this.totalFrames = (int)Math.Floor((double)((stop - start) / interval)) + 1;
        }
Example #5
0
 public FramesSeriesCapturer(MediaFileSet fileSet, TimelineEvent evt, uint interval, string outputDir)
 {
     this.capturer    = App.Current.MultimediaToolkit.GetFramesCapturer();
     this.fileSet     = fileSet;
     this.evt         = evt;
     this.start       = evt.Start;
     this.stop        = evt.Stop;
     this.interval    = interval;
     this.outputDir   = outputDir;
     this.seriesName  = System.IO.Path.GetFileName(outputDir);
     this.totalFrames = ((int)Math.Floor((double)((stop - start).MSeconds / interval)) + 1) * evt.CamerasConfig.Count;
     this.cancel      = false;
 }
Example #6
0
 public RenderingJobsManager(IMultimediaToolkit multimediaToolkit, IGUIToolkit guiToolkit)
 {
     this.guiToolkit        = guiToolkit;
     this.multimediaToolkit = multimediaToolkit;
     this.stateBar          = guiToolkit.MainWindow.RenderingStateBar;
     capturer             = multimediaToolkit.GetFramesCapturer();
     jobs                 = new List <Job>();
     pendingJobs          = new List <Job>();
     stateBar.Cancel     += (sender, e) => CancelCurrentJob();
     stateBar.ManageJobs += (sender, e) => ManageJobs();
     guiToolkit.MainWindow.ConvertVideoFilesEvent += delegate(List <MediaFile> inputFiles, EncodingSettings encSettings) {
         ConversionJob job = new ConversionJob(inputFiles, encSettings);
         AddJob(job);
     };;
 }
Example #7
0
        private string CreateStillImage(string filename, FrameDrawing drawing)
        {
            Image  frame, final_image;
            string path = System.IO.Path.GetTempFileName().Replace(@"\", @"\\");

            capturer = multimediaToolkit.GetFramesCapturer();
            capturer.Open(filename);
            frame = capturer.GetFrame(drawing.Render, true);
            capturer.Dispose();
            if (frame == null)
            {
                Log.Error(String.Format("Could not get frame for file {0} at pos {1}",
                                        filename, drawing.Render.ToMSecondsString()));
                return(null);
            }
            final_image = Drawing.Utils.RenderFrameDrawingToImage(Config.DrawingToolkit, frame, drawing);
            final_image.Save(path);
            return(path);
        }
Example #8
0
        string CreateStillImage(MediaFile file, FrameDrawing drawing)
        {
            Image  frame, final_image;
            string path = System.IO.Path.GetTempFileName().Replace(@"\", @"\\");

            capturer = App.Current.MultimediaToolkit.GetFramesCapturer();
            capturer.Open(file.FilePath);
            frame = capturer.GetFrame(drawing.Render + file.Offset, true, (int)file.DisplayVideoWidth, (int)file.DisplayVideoHeight);
            capturer.Dispose();
            if (frame == null)
            {
                Log.Error(String.Format("Could not get frame for file {0} at pos {1}",
                                        file.FilePath, drawing.Render.ToMSecondsString()));
                return(null);
            }
            final_image = VAS.Drawing.Utils.RenderFrameDrawingToImage(App.Current.DrawingToolkit, frame, drawing);
            final_image.Save(path);
            return(path);
        }
Example #9
0
        private string CreateStillImage(string filename, FrameDrawing drawing)
        {
            Image frame, final_image;
            string path = System.IO.Path.GetTempFileName ().Replace (@"\", @"\\");

            capturer = multimediaToolkit.GetFramesCapturer ();
            capturer.Open (filename);
            frame = capturer.GetFrame (drawing.Render, true);
            capturer.Dispose ();
            if (frame == null) {
                Log.Error (String.Format ("Could not get frame for file {0} at pos {1}",
                    filename, drawing.Render.ToMSecondsString ()));
                return null;
            }
            final_image = Drawing.Utils.RenderFrameDrawingToImage (Config.DrawingToolkit, frame, drawing);
            final_image.Save (path);
            return path;
        }
Example #10
0
        void HandleOpenedProjectChanged(Project project, ProjectType projectType,
		                                 EventsFilter filter, IAnalysisWindow analysisWindow)
        {
            this.openedProject = project;
            this.projectType = projectType;
            this.filter = filter;

            if (project == null) {
                if (framesCapturer != null) {
                    framesCapturer.Dispose ();
                    framesCapturer = null;
                }
                return;
            }

            if (projectType == ProjectType.FileProject) {
                framesCapturer = Config.MultimediaToolkit.GetFramesCapturer ();
                framesCapturer.Open (openedProject.Description.FileSet.First ().FilePath);
            }
            this.analysisWindow = analysisWindow;
            player = analysisWindow.Player;
            capturer = analysisWindow.Capturer;
        }