コード例 #1
0
        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();
            };
        }
コード例 #2
0
#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();
        }
コード例 #3
0
 public FFmpegVideoSource()
 {
     _videoFormatManager = new MediaFormatManager <VideoFormat>(_supportedVideoFormats);
     _videoEncoder       = new FFmpegVideoEncoder();
 }