src/FFmpeg.NET/Engine/RegexEngine.cs
/// <summary>
///     <para> ---- </para>
///     <para>Establishes whether the data contains progress information.</para>
/// </summary>
/// <param name="data">Event data from the FFmpeg console.</param>
/// <param name="progressData">
///     <para>If successful, outputs a <see cref="ProgressData" /> which is </para>
///     <para>generated from the data. </para>
/// </param>
Establishes whether the data contains progress information.
Establishes whether the data contains progress information .
internal static bool IsProgressData(string data, out ProgressData progressData)
        {
            progressData = null;
            var matchFrame = Index[Find.ConvertProgressFrame].Match(data);
            var matchFps = Index[Find.ConvertProgressFps].Match(data);
            var matchSize = Index[Find.ConvertProgressSize].Match(data);
            var matchTime = Index[Find.ConvertProgressTime].Match(data);
            var matchBitrate = Index[Find.ConvertProgressBitrate].Match(data);
            if (!matchSize.Success || !matchTime.Success || !matchBitrate.Success)
                return false;
            TimeSpan.TryParse(matchTime.Groups[1].Value, out var processedDuration);
            var frame = GetLongValue(matchFrame);
            var fps = GetDoubleValue(matchFps);
            var sizeKb = GetIntValue(matchSize);
            var bitrate = GetDoubleValue(matchBitrate);
            progressData = new ProgressData(processedDuration, TimeSpan.Zero, frame, fps, sizeKb, bitrate);
            return true;
        }
internal static bool IsProgressData ( string data , out ProgressData progressData ) { progressData = null ; var matchFrame = Index [ Find . ConvertProgressFrame ] . Match ( data ) ; var matchFps = Index [ Find . ConvertProgressFps ] . Match ( data ) ; var matchSize = Index [ Find . ConvertProgressSize ] . Match ( data ) ; var matchTime = Index [ Find . ConvertProgressTime ] . Match ( data ) ; var matchBitrate = Index [ Find . ConvertProgressBitrate ] . Match ( data ) ; if ( ! matchSize . Success || ! matchTime . Success || ! matchBitrate . Success ) return false ; TimeSpan . TryParse ( matchTime . Groups [ 1 ] . Value , out var processedDuration ) ; var frame = GetLongValue ( matchFrame ) ; var fps = GetDoubleValue ( matchFps ) ; var sizeKb = GetIntValue ( matchSize ) ; var bitrate = GetDoubleValue ( matchBitrate ) ; progressData = new ProgressData ( processedDuration , TimeSpan . Zero , frame , fps , sizeKb , bitrate ) ; return true ; }
Establishes whether the data contains progress information.
Establishes whether the data contains progress information .
data
string
Event data from the FFmpeg console.
Event data from the FFmpeg console .
ProgressData
out
progressData
If successful, outputs a
which is generated from the data.
If successful outputs a which is generated from the data .