public FFMpeg(string urn, ITimeProvider timeProvider, ILogging logging, IFFMpegService ffmpegService, IAudioPresetProvider presetProvider) : base(urn, Type, timeProvider, logging) { if (logging == null) { throw new ArgumentNullException(nameof(logging)); } if (ffmpegService == null) { throw new ArgumentNullException(nameof(ffmpegService)); } if (presetProvider == null) { throw new ArgumentNullException(nameof(presetProvider)); } _ffmpegService = ffmpegService; _audioDestinations = presetProvider.AsDictionary(); }
public FFMpegService(string uri, int threadsPerMachine, IAudioPresetProvider audioPresetProvider, ITimeProvider timeProvider) { _httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(60) }; _serviceUri = uri; _audioClient = new AudioJobClient(_httpClient) { BaseUrl = _serviceUri }; _audioMuxClient = new MuxJobClient(_httpClient) { BaseUrl = _serviceUri }; _hardSubtitlesClient = new HardSubtitlesJobClient(_httpClient) { BaseUrl = _serviceUri }; _statusClient = new StatusClient(_httpClient) { BaseUrl = _serviceUri }; _healthClient = new HealthCheckClient(_httpClient) { BaseUrl = _serviceUri }; _jobClient = new JobClient(_httpClient) { BaseUrl = _serviceUri }; _timeProvider = timeProvider; _threadsPerMachine = threadsPerMachine; _tasksPerAudioJob = audioPresetProvider.AsDictionary()[StateFormat.audio_od_standard].Count; RetryCount = 3; RetrySleepMs = 10 * 1000; }