mirror of https://github.com/ErsatzTV/ErsatzTV.git
5 changed files with 34 additions and 22 deletions
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
using System.Text.RegularExpressions; |
||||
|
||||
namespace ErsatzTV.Core.FFmpeg; |
||||
|
||||
public partial class FFmpegProgressParser |
||||
{ |
||||
public Option<double> Speed { get; private set; } = Option<double>.None; |
||||
|
||||
public void ParseLine(string line) |
||||
{ |
||||
Match match = FFmpegSpeed().Match(line); |
||||
if (match.Success && double.TryParse(match.Groups[1].Value, out double speed)) |
||||
{ |
||||
Speed = speed; |
||||
} |
||||
} |
||||
|
||||
[GeneratedRegex(@"speed=\s*([\d\.]+)x", RegexOptions.IgnoreCase)]
|
||||
private static partial Regex FFmpegSpeed(); |
||||
} |
||||
@ -0,0 +1,6 @@
@@ -0,0 +1,6 @@
|
||||
namespace ErsatzTV.FFmpeg.GlobalOption; |
||||
|
||||
public class ProgressOption : GlobalOption |
||||
{ |
||||
public override string[] GlobalOptions => ["-progress", "-"]; |
||||
} |
||||
Loading…
Reference in new issue