From f20c25d2ee3de1149c21ef7231659c25949efdea Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Sat, 6 Mar 2021 23:26:15 +0100 Subject: [PATCH] change FrameRate on RawVideoPipeSource to double Former-commit-id: cfda317883432f399d9520a495c9d6425d27fe3e --- FFMpegCore/FFMpeg/Pipes/RawVideoPipeSource.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/FFMpegCore/FFMpeg/Pipes/RawVideoPipeSource.cs b/FFMpegCore/FFMpeg/Pipes/RawVideoPipeSource.cs index f61bb7c..378cead 100644 --- a/FFMpegCore/FFMpeg/Pipes/RawVideoPipeSource.cs +++ b/FFMpegCore/FFMpeg/Pipes/RawVideoPipeSource.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Threading; using System.Threading.Tasks; using FFMpegCore.Exceptions; @@ -14,7 +15,7 @@ public class RawVideoPipeSource : IPipeSource public string StreamFormat { get; private set; } = null!; public int Width { get; private set; } public int Height { get; private set; } - public int FrameRate { get; set; } = 25; + public double FrameRate { get; set; } = 25; private bool _formatInitialized; private readonly IEnumerator _framesEnumerator; @@ -42,7 +43,7 @@ public string GetStreamArguments() _formatInitialized = true; } - return $"-f rawvideo -r {FrameRate} -pix_fmt {StreamFormat} -s {Width}x{Height}"; + return $"-f rawvideo -r {FrameRate.ToString(CultureInfo.InvariantCulture)} -pix_fmt {StreamFormat} -s {Width}x{Height}"; } public async Task WriteAsync(System.IO.Stream outputStream, CancellationToken cancellationToken)