Exemple #1
0
        static void Main(string[] args)
        {
            //ARGUMENTS:
            //0	= UserID
            //1	= outObjectID
            //2	= SnapshotAfterSec
            //3	= ImgLActionProfile
            //4	= ImgSActionProfile
            //5	= ImgXSActionProfile
            // ENABLE FOR DEBUGGING
            //InfoHandler obj1 = new InfoHandler();
            //
            //obj1.WriteMonitoringLog("", strObjectID, "", 7, "generate image snapshot (Step 7 / 14)", _4screen.CSB.Common.MonitoringLogState.OKWithWarning, "Anzahl argumente: " + args.Length.ToString());

            if (args.Length == 6)
            {
                //Read Arguments
                strOutputPath         = ConfigurationSettings.AppSettings["ConverterLocalPathTarget"];
                strUserID             = args[0];
                strObjectID           = args[1];
                intSnapShotAfterSec   = Convert.ToInt32(args[2]) * 1000;
                strImgLActionProfile  = args[3];
                strImgSActionProfile  = args[4];
                strImgXSActionProfile = args[5];


                string[] strArchiveFile = Directory.GetFiles(ConfigurationSettings.AppSettings["ConverterRootPath"] + "\\Media\\" + strUserID + "\\" + Helper.GetMediaFolder(ObjectType.Video) + "\\a", "*" + strObjectID + ".*");
                if (strArchiveFile.Length == 1)
                {
                    strVideoFile = strArchiveFile[0];
                }

                if (File.Exists(strVideoFile))
                {
                    // set outputfiles
                    strOutputFileSnap = System.IO.Path.Combine(strOutputPath, strObjectID + "_Snap.jpg");
                    try
                    {
                        // generate the thumbnails
                        GenerateSnapshot();
                    }
                    catch (Exception ex)
                    {
                        InfoHandler obj2 = new InfoHandler();

                        obj2.WriteMonitoringLog("", strObjectID, "", 7, "generate image snapshot (Step 7 / 14)", _4screen.CSB.Common.MonitoringLogState.OKWithWarning, "System exception: " + ex.Message);
                    }
                }
                else
                {
                    InfoHandler obj3 = new InfoHandler();

                    obj3.WriteMonitoringLog("", strObjectID, "", 7, "generate image snapshot (Step 7 / 14)", _4screen.CSB.Common.MonitoringLogState.OKWithWarning, "input FLV file not found: " + strVideoFile);
                }
            }
        }