private void ExtractTry(VideoFileInfoExtractRequest request) { var ffprobeResult = RunFfprobe(request); var json = GetJsonFromFfprobeResult(ffprobeResult); _response.VideoFileInformation = _ffprobeResultParser.Parse(json); }
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)); }
public void Should_ExtractVideoFileInformation_WithNoSound() { GivenAVideoWithNoSoundFile(); WhenTheServiceIsCalled(); ThenVideoFileInformationIsExtracted(); void GivenAVideoWithNoSoundFile() { _request = new VideoFileInfoExtractRequest(VideoFileNoSoundPathValid, Guid.NewGuid().ToString()); } }
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); }
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); }
private void GivenAVideoFile() { _request = new VideoFileInfoExtractRequest(VideoFilePathValid, Guid.NewGuid().ToString()); }
public Response(VideoFileInfoExtractRequest request) : base(request) { }