Ejemplo n.º 1
0
    public static void Open(string videoFile)
    {
        VideoFile = videoFile;

        if (IsImported(videoFile))
        {
            VideoOpenedEvent?.Invoke(videoFile);
            return;
        }

        /* start the import process */
        Utils.StartThread(() => ImportVideo(videoFile), "ImportVideo");
    }
Ejemplo n.º 2
0
    static void ImportVideo(string videoFile)
    {
        AutoResetEvent AbortEvent = new AutoResetEvent(false);

        ImportStartedEvent?.Invoke(
            videoFile,
            () => AbortEvent.Set());

        try
        {
            uint NumFrames;

            PrepVideo.SplitFrames(
                FFMPEG_BIN, videoFile, SplitProgress, AbortEvent,
                out NumFrames);

            MeshroomCompute.PhotogrammImages(
                MESHROOM_COMPUTE_BIN, SENSOR_DATABASE, VOC_TREE,
                PrepVideo.GetImagesDir(videoFile),
                TIME_BASE, NumFrames, MeshroomProgress,
                AbortEvent);

            /*
             * create positions file last, we use it to
             * figure out if a video have been imported
             */
            PrepVideo.ExtractSubtitles(FFMPEG_BIN, videoFile, AbortEvent);

            ImportFinishedEvent?.Invoke();
            VideoOpenedEvent?.Invoke(videoFile);
        }
        catch (ProcessAborted)
        {
            ImportCanceledEvent?.Invoke();
        }
    }