Example #1
0
        /// <summary>
        /// Reason : To get Video file details
        /// </summary>
        /// <param name="fileInputObj">Accepts input object of VideoFileInput</param>
        /// <returns>object of VideoContent</returns>
        public VideoContent GetVideoDetails(VideoFileDetail fileInputObj)
        {
            try
            {
                VideoContent      videoContent = new VideoContent();
                List <ColorModel> colorList = new List <ColorModel>();
                string            contentMessage = ""; string videoInfo = ""; string audioMessage = "";
                _videoGrab.GetVideoDetails(fileInputObj.ApplicationStartupPath, fileInputObj.OutputImagePath, fileInputObj.InputFilePath, fileInputObj.BatchFilePath, Guid.NewGuid().ToString(), ref contentMessage, ref colorList, ref videoInfo, ref audioMessage);

                videoContent.AudioMessage   = audioMessage;
                videoContent.ContentMessage = contentMessage;
                videoContent.VideoInfo      = videoInfo;
                videoContent.ColorList      = PrepareColorModel(colorList);
                return(videoContent);
            }
            catch (Exception)
            {
                throw;
            }
        }
        /// <summary>
        /// Reason : To get Video file details
        /// </summary>
        /// <param name="fileInputObj">Accepts input object of VideoFileInput</param>
        /// <returns>object of VideoContent</returns>
        public VideoContent GetVideoDetails(VideoFileDetail fileInputObj)
        {
            try
            {
                VideoContent videoContent = new VideoContent();
                List<ColorModel> colorList = new List<ColorModel>();
                string contentMessage = ""; string videoInfo = ""; string audioMessage = "";
                _videoGrab.GetVideoDetails(fileInputObj.ApplicationStartupPath, fileInputObj.OutputImagePath, fileInputObj.InputFilePath, fileInputObj.BatchFilePath, Guid.NewGuid().ToString(), ref contentMessage, ref colorList, ref videoInfo, ref audioMessage);

                videoContent.AudioMessage = audioMessage;
                videoContent.ContentMessage = contentMessage;
                videoContent.VideoInfo = videoInfo;
                videoContent.ColorList = PrepareColorModel(colorList);
                return videoContent;
            }
            catch (Exception)
            {
                throw;
            }
        }
        public void Stub()
        {
            IGrabber imageGrab = new ImageVideoGrabber.Grabber();
            ImageFile fileInput = new ImageFile();
            fileInput.FileName = txtFilePath.Text;
            //test1
             
            var result = imageGrab.ExtractTextFromImage(fileInput);
            var v = result;
            //test2
            fileInput.FileName = txtFilePath.Text; 
            List<Colors> result2= imageGrab.GetImageColors(fileInput);
            var v2 = result2;

            //test3
            VideoFileDetail videoFielOutput = new VideoFileDetail();
            string frameName = Guid.NewGuid().ToString();
            string outputImgFilePath = appStartPath + @"\bin\img\";
            string filePath = txtFilePath.Text.ToString().Trim();
            string batchFilePath = appStartPath + @"\ff-prompt.bat";

            videoFielOutput.ApplicationStartupPath = appStartPath;
            videoFielOutput.OutputImagePath = outputImgFilePath;
            videoFielOutput.InputFilePath = filePath;
            videoFielOutput.BatchFilePath = batchFilePath;          
             
            var result3 = imageGrab.GetVideoDetails(videoFielOutput);
            var v3 = result3;

            //test4
            ImageFileDetails imageFileDupCheck = new ImageFileDetails();
            string targetDirPath = @"D:\git-code\ImageProcessing\KantarImageProcessing\ImageProcessing\bin\Debug\bin\img";
            imageFileDupCheck.FilePath = txtFilePath.Text.ToString();
            imageFileDupCheck.FileLength = 100000;
            imageFileDupCheck.FolderPath = targetDirPath;
            imageFileDupCheck.ApplicationStartupPath = appStartPath;
            var result4 = imageGrab.GetAllSimilarImages(imageFileDupCheck);
            var v4 = result4;

            //upload image
            imageGrab.UploadImageFile(txtFilePath.Text.ToString(),appStartPath);

            //download file
            string imagePath = txtFilePath.Text.ToString();
            imageGrab.DownloadFile(imagePath.Contains("\\") ? imagePath.Split('\\')[imagePath.Split('\\').Count() - 1] : imagePath);

        }