Beispiel #1
0
 public void EmitConvertVideoFiles(List <MediaFile> files, EncodingSettings settings)
 {
     if (ConvertVideoFilesEvent != null)
     {
         ConvertVideoFilesEvent(files, settings);
     }
 }
 public VideoEditionProperties(Window parent)
 {
     TransientFor = parent;
     this.Build ();
     encSettings = new EncodingSettings ();
     stdStore = Misc.FillImageFormat (sizecombobox, VideoStandards.Rendering,
         Config.RenderVideoStandard);
     encStore = Misc.FillEncodingFormat (formatcombobox, Config.RenderEncodingProfile);
     qualStore = Misc.FillQuality (qualitycombobox, Config.RenderEncodingQuality);
     descriptioncheckbutton.Active = Config.OverlayTitle;
     audiocheckbutton.Active = Config.EnableAudio;
     mediafilechooser1.FileChooserMode = FileChooserMode.File;
     mediafilechooser1.FilterName = "Multimedia Files";
     mediafilechooser1.FilterExtensions = new string[] {"*.mkv", "*.mp4", "*.ogg",
         "*.avi", "*.mpg", "*.vob"
     };
     mediafilechooser2.FileChooserMode = FileChooserMode.Directory;
     mediafilechooser2.ChangedEvent += (sender, e) => {
         OutputDir = mediafilechooser2.CurrentPath;
     };
 }
Beispiel #3
0
 public void EmitConvertVideoFiles(List<MediaFile> files, EncodingSettings settings)
 {
     if (ConvertVideoFilesEvent != null)
         ConvertVideoFilesEvent (files, settings);
 }
        protected void OnButtonOkClicked(object sender, System.EventArgs e)
        {
            EncodingSettings encSettings;
            EncodingQuality qual;
            TreeIter iter;
            VideoStandard std;
            uint fps_n, fps_d;

            sizecombobox.GetActiveIter (out iter);
            std = (VideoStandard)stdStore.GetValue (iter, 1);

            bitratecombobox.GetActiveIter (out iter);
            qual = bitStore.GetValue (iter, 1) as EncodingQuality;

            var rates = new HashSet<uint> (Files.Select (f => (uint)f.Fps));
            if (rates.Count == 1) {
                fps_n = rates.First ();
                fps_d = 1;
            } else {
                fps_n = App.Current.Config.FPS_N;
                fps_d = App.Current.Config.FPS_D;
            }

            if (fps_n == 50) {
                fps_n = 25;
            } else if (fps_n == 60) {
                fps_n = 30;
            }
            encSettings = new EncodingSettings (std, EncodingProfiles.MP4, qual, fps_n, fps_d,
                mediafilechooser1.CurrentPath, true, false, 0);

            EncodingSettings = encSettings;
            Respond (ResponseType.Ok);
        }
Beispiel #5
0
        bool CreateProject()
        {
            TreeIter iter;
            MediaFile file;

            if (projectType == ProjectType.FileProject ||
                projectType == ProjectType.EditProject) {
                if (!mediafilesetselection1.FileSet.CheckFiles ()) {
                    gtoolkit.WarningMessage (Catalog.GetString ("You need at least 1 video file for the main angle"));
                    return false;
                }
            }

            if (project != null) {
                /* Make sure event types and timers are updated in case we are importing
                 * a project without dashboard */
                project.UpdateEventTypesAndTimers ();
                return true;
            }

            if (projectType == ProjectType.CaptureProject ||
                projectType == ProjectType.URICaptureProject) {
                if (String.IsNullOrEmpty (capturemediafilechooser.CurrentPath)) {
                    gtoolkit.WarningMessage (Catalog.GetString ("No output video file"));
                    return false;
                }
            }
            if (projectType == ProjectType.URICaptureProject) {
                if (urientry.Text == "") {
                    gtoolkit.WarningMessage (Catalog.GetString ("No input URI"));
                    return false;
                }
            }
            project = new Project ();
            project.Dashboard = analysisTemplate;
            project.LocalTeamTemplate = hometemplate;
            project.VisitorTeamTemplate = awaytemplate;
            project.Description = new ProjectDescription ();
            project.Description.Competition = competitionentry.Text;
            project.Description.MatchDate = datepicker1.Date;
            project.Description.Description = desctextview.Buffer.GetText (desctextview.Buffer.StartIter,
                desctextview.Buffer.EndIter, true);
            project.Description.Season = seasonentry.Text;
            project.Description.LocalName = project.LocalTeamTemplate.TeamName;
            project.Description.VisitorName = project.VisitorTeamTemplate.TeamName;
            project.Description.FileSet = mediafilesetselection1.FileSet;
            project.UpdateEventTypesAndTimers ();

            encSettings = new EncodingSettings ();
            captureSettings = new CaptureSettings ();

            encSettings.OutputFile = capturemediafilechooser.CurrentPath;

            /* Get quality info */
            qualitycombobox.GetActiveIter (out iter);
            encSettings.EncodingQuality = (EncodingQuality)qualList.GetValue (iter, 1);

            /* Get size info */
            imagecombobox.GetActiveIter (out iter);
            encSettings.VideoStandard = (VideoStandard)videoStandardList.GetValue (iter, 1);

            /* Get encoding profile info */
            encodingcombobox.GetActiveIter (out iter);
            encSettings.EncodingProfile = (EncodingProfile)encProfileList.GetValue (iter, 1);

            encSettings.Framerate_n = Config.FPS_N;
            encSettings.Framerate_d = Config.FPS_D;

            captureSettings.EncodingSettings = encSettings;

            file = project.Description.FileSet.FirstOrDefault ();
            if (file == null) {
                file = new MediaFile () { Name = Catalog.GetString ("Main camera angle") };
                file.FilePath = capturemediafilechooser.CurrentPath;
                file.Fps = (ushort)(Config.FPS_N / Config.FPS_D);
                file.Par = 1;
                project.Description.FileSet.Add (file);
            }

            if (projectType == ProjectType.CaptureProject) {
                captureSettings.Device = videoDevices [devicecombobox.Active];
                captureSettings.Format = captureSettings.Device.Formats [deviceformatcombobox.Active];
                file.VideoHeight = encSettings.VideoStandard.Height;
                file.VideoWidth = encSettings.VideoStandard.Width;
            } else if (projectType == ProjectType.URICaptureProject) {
                captureSettings.Device = new Device {DeviceType = CaptureSourceType.URI,
                    ID = urientry.Text
                };
                file.VideoHeight = encSettings.VideoStandard.Height;
                file.VideoWidth = encSettings.VideoStandard.Width;
            } else if (projectType == ProjectType.FakeCaptureProject) {
                file.FilePath = Constants.FAKE_PROJECT;
            }
            return true;
        }
Beispiel #6
0
 public Job(EncodingSettings encSettings)
 {
     EncodingSettings = encSettings;
     State = JobState.NotStarted;
 }
Beispiel #7
0
 public EditionJob(Playlist playlist, EncodingSettings encSettings)
     : base(encSettings)
 {
     Playlist = Cloner.Clone(playlist);
 }
Beispiel #8
0
 public ConversionJob(List<MediaFile> files, EncodingSettings encSettings)
     : base(encSettings)
 {
     InputFiles = files;
 }
        public void TestRenderedCamera()
        {
            Project p = Utils.CreateProject ();

            try {
                TimelineEvent evt = p.Timeline [0];
                evt.CamerasConfig = new List<CameraConfig> { new CameraConfig (0) };
                PlaylistPlayElement element = new PlaylistPlayElement (evt, p.Description.FileSet);

                // Playlist with one event
                var playlist = new Playlist ();
                playlist.Elements.Add (element);

                // Create a job
                const string outputFile = "path";
                EncodingSettings settings = new EncodingSettings (VideoStandards.P720, EncodingProfiles.MP4, EncodingQualities.Medium,
                                                25, 1, outputFile, true, true, 20);
                EditionJob job = new EditionJob (playlist, settings);

                // Mock IMultimediaToolkit and video editor
                var mtk = Mock.Of<IMultimediaToolkit> (m => m.GetVideoEditor () == Mock.Of<IVideoEditor> ());
                // and guitoolkit
                var gtk = Mock.Of<IGUIToolkit> (g => g.RenderingStateBar == Mock.Of<IRenderingStateBar> ());
                // and a video editor
                Mock<IVideoEditor> mock = Mock.Get<IVideoEditor> (mtk.GetVideoEditor ());
                // And eventbroker
                Config.EventsBroker = Mock.Of<EventsBroker> ();

                // Create a rendering object with mocked interfaces
                RenderingJobsManager renderer = new RenderingJobsManager (mtk, gtk);
                // Start service
                renderer.Start ();

                renderer.AddJob (job);

                // Check that AddSegment is called with the right video file.
                mock.Verify (m => m.AddSegment (p.Description.FileSet [0].FilePath,
                    evt.Start.MSeconds, evt.Stop.MSeconds, evt.Rate, evt.Name, true, new Area ()), Times.Once ());

                /* Test with a camera index bigger than the total cameras */
                renderer.CancelAllJobs ();
                mock.ResetCalls ();
                evt = p.Timeline [1];
                evt.CamerasConfig = new List<CameraConfig> { new CameraConfig (1) };
                element = new PlaylistPlayElement (evt, p.Description.FileSet);
                playlist.Elements [0] = element;
                job = new EditionJob (playlist, settings);
                renderer.AddJob (job);
                mock.Verify (m => m.AddSegment (p.Description.FileSet [1].FilePath,
                    evt.Start.MSeconds, evt.Stop.MSeconds, evt.Rate, evt.Name, true, new Area ()), Times.Once ());

                /* Test with the secondary camera */
                renderer.CancelAllJobs ();
                mock.ResetCalls ();
                evt = p.Timeline [1];
                evt.CamerasConfig = new List<CameraConfig> { new CameraConfig (2) };
                element = new PlaylistPlayElement (evt, p.Description.FileSet);
                playlist.Elements [0] = element;
                job = new EditionJob (playlist, settings);
                renderer.AddJob (job);
                mock.Verify (m => m.AddSegment (p.Description.FileSet [0].FilePath,
                    evt.Start.MSeconds, evt.Stop.MSeconds, evt.Rate, evt.Name, true, new Area ()), Times.Once ());
            } finally {
                Utils.DeleteProject (p);
            }
        }
Beispiel #10
0
 public ConversionJob(List <MediaFile> files, EncodingSettings encSettings) : base(encSettings)
 {
     InputFiles = files;
 }
Beispiel #11
0
 public EditionJob(Playlist playlist, EncodingSettings encSettings) : base(encSettings)
 {
     Playlist = Cloner.Clone(playlist);
 }
Beispiel #12
0
 public Job(EncodingSettings encSettings)
 {
     EncodingSettings = encSettings;
     State            = JobState.NotStarted;
 }