Exemple #1
0
        private void ExtractTry(VideoFileInfoExtractRequest request)
        {
            var ffprobeResult = RunFfprobe(request);
            var json          = GetJsonFromFfprobeResult(ffprobeResult);

            _response.VideoFileInformation = _ffprobeResultParser.Parse(json);
        }
Exemple #2
0
        private ProcessResult RunFfprobe(VideoFileInfoExtractRequest request)
        {
            var arguments = $"-v quiet -print_format json -show_format -show_streams \"{request.VideoFilePath}\"";

            _response.FfprobeArguments = arguments;

            var app = new CommandLineApplication();

            return(app.Run(_config.FfprobePath, arguments));
        }
Exemple #3
0
        public void Should_ExtractVideoFileInformation_WithNoSound()
        {
            GivenAVideoWithNoSoundFile();
            WhenTheServiceIsCalled();
            ThenVideoFileInformationIsExtracted();

            void GivenAVideoWithNoSoundFile()
            {
                _request = new VideoFileInfoExtractRequest(VideoFileNoSoundPathValid, Guid.NewGuid().ToString());
            }
        }
Exemple #4
0
        private VideoFileInfoExtractResponse ExtractVideoFileInformation(CreateThumbnailSheetOptions options)
        {
            var request  = new VideoFileInfoExtractRequest(options.VideoFilePath, _correlationId);
            var response = _videoFileInfoExtractionService.Extract(request);


            if (response.IsValid)
            {
                _auditor.AuditSuccess("VideoFile", options.VideoFilePath, "InfoExtracted", response);
            }
            else
            {
                _auditor.AuditFailure("VideoFile", options.VideoFilePath, "InfoExtractionFailed", response);
            }
            return(response);
        }
Exemple #5
0
 public VideoFileInfoExtractResponse Extract(VideoFileInfoExtractRequest request)
 {
     _response = new Response(request);
     try
     {
         ExtractTry(request);
     }
     catch (HqvException ex)
     {
         _response.AddError(ex);
     }
     catch (Exception ex)
     {
         const string message = "Unhandled exception in VideoFileInfoExtractionService";
         _response.AddError(new Exception(message, ex));
     }
     return(_response);
 }
Exemple #6
0
 private void GivenAVideoFile()
 {
     _request = new VideoFileInfoExtractRequest(VideoFilePathValid, Guid.NewGuid().ToString());
 }
Exemple #7
0
 public Response(VideoFileInfoExtractRequest request) : base(request)
 {
 }