Exemplo n.º 1
0
        public static void DatabaseUpdater(LogInformation informations)
        {
            DatabaseConfiguration databaseConfiguration = LoadDatabaseConfiguration();

            throw new NotImplementedException("Function is not yet implemented!");
        }
Exemplo n.º 2
0
        public static void WriteLogToDatabase(LogInformation information)
        {
            DatabaseConfiguration configuration = LoadDatabaseConfiguration();
            string SQLCommand = "USE " + configuration.databaseName + ";";

            SQLCommand += "INSERT INTO " + configuration.tableName + " (";
            SQLCommand += "UserID, " +
                          "RequestTime, " +
                          "ProcessedVideoLocation, " +
                          "IsDeleteWhenCompleteRequested, " +
                          "IsOriginalFileDeleted, " +
                          "TotalProcessingDuration, " +
                          "AudioProcessingDuration, " +
                          "VideoProcessingDuration, " +
                          "OriginalVideoWidth, " +
                          "OriginalVideoHeight, " +
                          "OriginalFrameRate, " +
                          "FPSRequest, " +
                          "Scaled, " +
                          "ScaledVideoWidth, " +
                          "ScaledVideoHeight, " +
                          "WithAudio, " +
                          "VideoStartFrame, " +
                          "VideoEndFrame, " +
                          "VideoDuration, " +
                          "VideoStatus, " +
                          "ErrorCode, " +
                          "ErrorMessage, " +
                          "ProgramArguments, " +
                          "FFmpegLocation, " +
                          "FFProbeLocation, " +
                          " VALUES " +
                          information.userID + ", " +
                          information.requestTime + ", " +
                          //information.finishedTime + ", " +
                          information.processedVideoLocation + ", ";
            if (information.isDeleteWhenCompleteRequested)
            {
                SQLCommand += "1, ";
            }
            else
            {
                SQLCommand += "0, ";
            }

            SQLCommand += information.isOriginalFileDeleted + ", " +
                          information.originalVideoWidth + ", " +
                          information.originalVideoHeight + ", " +
                          information.originalFrameRate + ", " +
                          information.scaled + ", " +
                          information.withAudio + ", " +
                          information.scaledVideoWidth + ", " +
                          information.scaledVideoHeight + ", " +
                          information.totalProcessingDuration.TotalSeconds + ", " +
                          information.videoStartFrame + ", " +
                          information.videoEndFrame + ", " +
                          information.videoDuration + ", " +
                          information.status + ", 0, " +
                          information.errorMessage + ", " +
                          information.programArguments + ", " +
                          information.FFmpegLocation + ", " +
                          information.FFProbeLocation + ";";

            Peralatan.TambahKeDatabase(SQLCommand, configuration.databaseConnectionString);
            throw new NotImplementedException("Function is not completed yet");
        }
Exemplo n.º 3
0
        public static LogInformation GenerateLog(ProcessedVideoInformation videoInfo, VideoInformation processedVideoInformation, ProcessingInformation processingInfo, UserInformation userInfo, Requester requester)
        {
            #region Preparation
            DatabaseConfiguration configuration            = LoadDatabaseConfiguration();
            LogInformation        logInformation           = new LogInformation();
            FFmpegConfiguration   applicationConfiguration = LoadApplicationConfiguration();
            #endregion Preparation

            #region FFmpeg's log
            if (applicationConfiguration.useCustomFFmpeg)
            {
                logInformation.FFmpegLocation = applicationConfiguration.FFmpegLocation;
            }
            else
            {
                logInformation.FFmpegLocation = string.Empty;
            }
            #endregion FFmpeg's log

            #region FFProbe's log
            if (applicationConfiguration.useCustomFFProbe)
            {
                logInformation.FFProbeLocation = applicationConfiguration.FFProbeLocation;
            }
            else
            {
                logInformation.FFProbeLocation = string.Empty;
            }
            #endregion FFProbe's log

            #region Request time
            logInformation.requestTime  = processingInfo.processingStartTime;
            logInformation.finishedTime = processingInfo.processingEndTime;
            #endregion Request time

            #region UserID
            string userID = string.Empty;
            if (Peralatan.PeriksaDataDatabase(userInfo.UserSessionID, "SessionID", configuration.databaseName, configuration.userTableName, configuration.databaseConnectionString))
            {
                userID = Peralatan.MintaDataDatabase(configuration.databaseName, "UserID", configuration.userTableName, "SessionID", userInfo.UserSessionID, configuration.databaseConnectionString);
            }
            logInformation.userID = userID;
            #endregion UserID

            #region Processed video location
            logInformation.processedVideoLocation = videoInfo.target;
            #endregion Processed video location

            #region Delete original file
            logInformation.isDeleteWhenCompleteRequested = videoInfo.deleteOriginal;
            #endregion Delete original file

            #region Processing duration
            logInformation.totalProcessingDuration = processingInfo.totalVideoDuration;
            logInformation.audioProcessingDuration = processingInfo.processedAudioDuration;
            logInformation.videoProcessingDuration = processingInfo.processedVideoDuration;
            #endregion Processing duration

            #region Video information
            logInformation.originalVideoWidth  = processedVideoInformation.videoHeight;
            logInformation.originalVideoHeight = processedVideoInformation.videoHeight;
            logInformation.videoDuration       = processedVideoInformation.videoDuration;
            logInformation.scaledVideoWidth    = videoInfo.width;
            logInformation.scaledVideoHeight   = videoInfo.height;

            #endregion Video information
            return(logInformation);
        }