From f48632c105f95bdb000b119da226b99827743c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=91=D0=B0=D0=B3?= =?UTF-8?q?=D1=80=D1=8F=D0=BD=D1=86=D0=B5=D0=B2?= Date: Tue, 28 Apr 2020 15:44:27 +0300 Subject: [PATCH] FromStream method to Video Info & added comments to FFprobe methods with stream Former-commit-id: f56ea098a5afe05861dc008aee7836ab1726a925 --- FFMpegCore/FFMPEG/FFProbe.cs | 10 ++++++++++ FFMpegCore/VideoInfo.cs | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/FFMpegCore/FFMPEG/FFProbe.cs b/FFMpegCore/FFMPEG/FFProbe.cs index 7c683bf..a7aec84 100644 --- a/FFMpegCore/FFMPEG/FFProbe.cs +++ b/FFMpegCore/FFMPEG/FFProbe.cs @@ -67,6 +67,11 @@ public async Task ParseVideoInfoAsync(VideoInfo info) return ParseVideoInfoInternal(info, output); } + /// + /// Probes the targeted video stream and retrieves all available details. + /// + /// Encoded video stream. + /// A video info object containing all details necessary. public VideoInfo ParseVideoInfo(System.IO.Stream stream) { var info = new VideoInfo(); @@ -92,6 +97,11 @@ public VideoInfo ParseVideoInfo(System.IO.Stream stream) return ParseVideoInfoInternal(info, output); } + /// + /// Probes the targeted video stream asynchronously and retrieves all available details. + /// + /// Encoded video stream. + /// A video info object containing all details necessary. public async Task ParseVideoInfoAsync(System.IO.Stream stream) { var info = new VideoInfo(); diff --git a/FFMpegCore/VideoInfo.cs b/FFMpegCore/VideoInfo.cs index 4e6c226..3bacdb9 100644 --- a/FFMpegCore/VideoInfo.cs +++ b/FFMpegCore/VideoInfo.cs @@ -132,6 +132,16 @@ public static VideoInfo FromPath(string path) return new VideoInfo(path); } + /// + /// Create a video information object from a encoded stream. + /// + /// Encoded video stream. + /// + public static VideoInfo FromStream(System.IO.Stream stream) + { + return new FFProbe().ParseVideoInfo(stream); + } + /// /// Pretty prints the video information. ///