Exemple #1
0
        public Metadata(string kvaString, VideoInfo info, HistoryStack historyStack, TimeCodeBuilder timecodeBuilder, ClosestFrameDisplayer closestFrameDisplayer)
            : this(historyStack, timecodeBuilder)
        {
            // This should reflect what we do in FrameServerPlayer.SetupMetadata
            imageSize    = info.ReferenceSize;
            userInterval = info.FrameIntervalMilliseconds;
            averageTimeStampsPerFrame  = info.AverageTimeStampsPerFrame;
            averageTimeStampsPerSecond = info.AverageTimeStampsPerSeconds;
            calibrationHelper.CaptureFramesPerSecond = info.FramesPerSeconds;
            firstTimeStamp = info.FirstTimeStamp;

            fullPath = info.FilePath;

            MetadataSerializer serializer = new MetadataSerializer();

            serializer.Load(this, kvaString, false);
        }
Exemple #2
0
        /// <summary>
        /// Main video saving pipeline. Saves either a video or the analysis data.
        /// </summary>
        public void Save(double playbackFrameInterval, double slowmotionPercentage, ImageRetriever imageRetriever)
        {
            // Let the user select what he wants to save exactly.
            formVideoExport fve = new formVideoExport(videoReader.FilePath, metadata, slowmotionPercentage);

            if (fve.ShowDialog() != DialogResult.OK)
            {
                fve.Dispose();
                return;
            }

            if (!FilesystemHelper.CanWrite(fve.Filename))
            {
                DisplayErrorMessage(ScreenManagerLang.Error_SaveMovie_FileError);
                fve.Dispose();
                return;
            }

            if (fve.SaveAnalysis)
            {
                MetadataSerializer serializer = new MetadataSerializer();
                serializer.SaveToFile(metadata, fve.Filename);
                metadata.AfterManualExport();
            }
            else
            {
                DoSave(fve.Filename,
                       fve.UseSlowMotion ? playbackFrameInterval : metadata.UserInterval,
                       fve.BlendDrawings,
                       false,
                       false,
                       imageRetriever);

                PreferencesManager.PlayerPreferences.VideoFormat = FilesystemHelper.GetVideoFormat(fve.Filename);
                PreferencesManager.Save();
            }

            fve.Dispose();
        }
Exemple #3
0
        public override void LoadKVA(string path)
        {
            MetadataSerializer s = new MetadataSerializer();

            s.Load(frameServer.Metadata, path, true);
        }
Exemple #4
0
        public void PerformAutosave()
        {
            MetadataSerializer serializer = new MetadataSerializer();

            serializer.SaveToFile(this, Path.Combine(tempFolder, "autosave.kva"));
        }
Exemple #5
0
        /// <summary>
        /// Save the annotations with an explicit prompt for a filename.
        /// </summary>
        public void SaveAs()
        {
            MetadataSerializer serializer = new MetadataSerializer();

            serializer.UserSaveAs(frameServer.Metadata, frameServer.VideoReader.FilePath);
        }