Example #1
0
 private void splitVideoToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var lastFrameProcessed = 0;
     var fileVideo = _videoFiles.First().Value;
     var readVideoFile = new ReadVideoFile(fileVideo.FullName);
     foreach (var fileContent in _emotionFileContent)
     {
         var framesCount = fileContent.FinalFrame - fileContent.InitFrame;
         var offset = (fileContent.InitFrame - lastFrameProcessed) - 1;
         lastFrameProcessed = fileContent.FinalFrame;
         var frames = readVideoFile.ReadFrames(framesCount, offset);
         var folder = fileContent.Subject;
         ValidateFolder(folder);
         var videoFileName = string.Format("{0}\\{1}-{2}_{3}-{4}-{5}.avi",
             folder,
             fileContent.Subject,
             fileContent.InitFrame,
             fileContent.FinalFrame,
             fileContent.Emotion1,
             fileContent.Frequency1);
         var writer = new WriteVideoFile(videoFileName, readVideoFile.Codec, readVideoFile.FrameRate, readVideoFile.Width, readVideoFile.Height);
         writer.WriteFrames(frames);
         foreach (var frame in frames)
         {
             frame.Dispose();
         }
     }
 }
Example #2
0
 private void createConsolidationFileToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var classificationFile = _classificationFiles.First().Value;
     var fileVideo = _videoFiles.First().Value;
     var readVideoFile = new ReadVideoFile(fileVideo.FullName);
     var frameRate = readVideoFile.FrameRate;
     CreateConsolidationFile(classificationFile, frameRate);
 }