public FFmpegFileSource(string path, bool repeat, IAudioEncoder audioEncoder) { if (!File.Exists(path)) { throw new ApplicationException($"Requested path for FFmpeg file source could not be found {path}."); } _audioFormatManager = new MediaFormatManager <AudioFormat>(_supportedAudioFormats); _videoFormatManager = new MediaFormatManager <VideoFormat>(_supportedVideoFormats); _audioEncoder = audioEncoder; _fileSourceDecoder = new FileSourceDecoder(path, repeat); _videoEncoder = new FFmpegVideoEncoder(); _fileSourceDecoder.OnVideoFrame += FileSourceDecoder_OnVideoFrame; _fileSourceDecoder.OnAudioFrame += FileSourceDecoder_OnAudioFrame; _fileSourceDecoder.OnEndOfFile += () => { logger.LogDebug($"File source decode complete for {path}."); OnEndOfFile?.Invoke(); _fileSourceDecoder.Dispose(); }; }
#pragma warning disable CS0067 //public event EncodedSampleDelegate? OnVideoSourceEncodedSample; //public event RawExtVideoSampleDelegate? OnVideoSourceRawExtSample; //public event RawVideoSampleDelegate? OnVideoSourceRawSample; //public event SourceErrorDelegate? OnVideoSourceError; #pragma warning restore CS0067 public FFmpegVideoEndPoint() { _videoFormatManager = new MediaFormatManager <VideoFormat>(_supportedFormats); _ffmpegEncoder = new FFmpegVideoEncoder(); }
public FFmpegVideoSource() { _videoFormatManager = new MediaFormatManager <VideoFormat>(_supportedVideoFormats); _videoEncoder = new FFmpegVideoEncoder(); }