From d5a2e5cbe6483573635bdb105a4fae3e8490d358 Mon Sep 17 00:00:00 2001 From: Kaaybi Date: Wed, 18 Sep 2024 12:13:25 +0200 Subject: [PATCH 01/10] chore: bump system.text.json to v8.0.4 --- FFMpegCore/FFMpegCore.csproj | 2 +- FFMpegCore/FFOptions.cs | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/FFMpegCore/FFMpegCore.csproj b/FFMpegCore/FFMpegCore.csproj index ed3b71c..7e279fb 100644 --- a/FFMpegCore/FFMpegCore.csproj +++ b/FFMpegCore/FFMpegCore.csproj @@ -18,7 +18,7 @@ - + diff --git a/FFMpegCore/FFOptions.cs b/FFMpegCore/FFOptions.cs index 3194874..2d4e4c9 100644 --- a/FFMpegCore/FFOptions.cs +++ b/FFMpegCore/FFOptions.cs @@ -1,4 +1,5 @@ using System.Text; +using System.Text.Json.Serialization; using FFMpegCore.Enums; namespace FFMpegCore @@ -20,10 +21,20 @@ public class FFOptions : ICloneable /// public string TemporaryFilesFolder { get; set; } = Path.GetTempPath(); + /// + /// Encoding web name used to persist encoding + /// + public string EncodingWebName { get; set; } = Encoding.Default.WebName; + /// /// Encoding used for parsing stdout/stderr on ffmpeg and ffprobe processes /// - public Encoding Encoding { get; set; } = Encoding.Default; + [JsonIgnore] + public Encoding Encoding + { + get => Encoding.GetEncoding(EncodingWebName); + set => EncodingWebName = value?.WebName ?? Encoding.Default.WebName; + } /// /// The log level to use when calling of the ffmpeg executable. From cf513aac0f12e8d89c7716e5c1f6ce3def3f0d0f Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Wed, 4 Dec 2024 20:43:32 +0200 Subject: [PATCH 02/10] Use .NET 8 in workflows --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94a858f..597c0bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: - name: Prepare .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: '7.0.x' + dotnet-version: '8.0.x' - name: Lint with dotnet run: dotnet format FFMpegCore.sln --severity warn --verify-no-changes diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 00a1ea7..ebf61f3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: - name: Prepare .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: '7.0.x' + dotnet-version: '8.0.x' - name: Build solution run: dotnet pack FFMpegCore.sln -c Release From 410e940b7e92bd1e325fe8b7df1566a7eac2919a Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Wed, 4 Dec 2024 20:43:47 +0200 Subject: [PATCH 03/10] Use .NET 8 for Examples and Test --- FFMpegCore.Examples/FFMpegCore.Examples.csproj | 2 +- FFMpegCore.Test/FFMpegCore.Test.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/FFMpegCore.Examples/FFMpegCore.Examples.csproj b/FFMpegCore.Examples/FFMpegCore.Examples.csproj index f4a2b9b..1aa7d46 100644 --- a/FFMpegCore.Examples/FFMpegCore.Examples.csproj +++ b/FFMpegCore.Examples/FFMpegCore.Examples.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 false diff --git a/FFMpegCore.Test/FFMpegCore.Test.csproj b/FFMpegCore.Test/FFMpegCore.Test.csproj index 8562139..2373fe8 100644 --- a/FFMpegCore.Test/FFMpegCore.Test.csproj +++ b/FFMpegCore.Test/FFMpegCore.Test.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 false disable default From 79ea2a97976c50f46707de3c750a5945a9ec7deb Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Wed, 4 Dec 2024 20:44:05 +0200 Subject: [PATCH 04/10] Bump System.Text.Json to 9.0.0 --- FFMpegCore/FFMpegCore.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FFMpegCore/FFMpegCore.csproj b/FFMpegCore/FFMpegCore.csproj index 7e279fb..2c02502 100644 --- a/FFMpegCore/FFMpegCore.csproj +++ b/FFMpegCore/FFMpegCore.csproj @@ -18,7 +18,7 @@ - + From 63fe3a6e3d0a853e9204bac46efad4cd0a3f0c3d Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Wed, 4 Dec 2024 20:46:29 +0200 Subject: [PATCH 05/10] Set ProduceReferenceAssembly to true --- .../FFMpegCore.Extensions.SkiaSharp.csproj | 1 + .../FFMpegCore.Extensions.System.Drawing.Common.csproj | 1 + 2 files changed, 2 insertions(+) diff --git a/FFMpegCore.Extensions.SkiaSharp/FFMpegCore.Extensions.SkiaSharp.csproj b/FFMpegCore.Extensions.SkiaSharp/FFMpegCore.Extensions.SkiaSharp.csproj index 87710cc..3b16e06 100644 --- a/FFMpegCore.Extensions.SkiaSharp/FFMpegCore.Extensions.SkiaSharp.csproj +++ b/FFMpegCore.Extensions.SkiaSharp/FFMpegCore.Extensions.SkiaSharp.csproj @@ -9,6 +9,7 @@ ffmpeg ffprobe convert video audio mediafile resize analyze muxing skiasharp Malte Rosenbjerg, Vlad Jerca, Max Bagryantsev, Dimitri Vranken + true diff --git a/FFMpegCore.Extensions.System.Drawing.Common/FFMpegCore.Extensions.System.Drawing.Common.csproj b/FFMpegCore.Extensions.System.Drawing.Common/FFMpegCore.Extensions.System.Drawing.Common.csproj index 13cdc1a..ebd7c9a 100644 --- a/FFMpegCore.Extensions.System.Drawing.Common/FFMpegCore.Extensions.System.Drawing.Common.csproj +++ b/FFMpegCore.Extensions.System.Drawing.Common/FFMpegCore.Extensions.System.Drawing.Common.csproj @@ -9,6 +9,7 @@ ffmpeg ffprobe convert video audio mediafile resize analyze muxing Malte Rosenbjerg, Vlad Jerca, Max Bagryantsev + true From dc165f9eae9853b8c02a07c4f2720a97f968e993 Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Wed, 4 Dec 2024 20:48:59 +0200 Subject: [PATCH 06/10] Bump workflow actions --- .github/workflows/ci.yml | 6 +++--- .github/workflows/release.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 597c0bb..b160e6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,10 +27,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Prepare .NET - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: '8.0.x' @@ -38,7 +38,7 @@ jobs: run: dotnet format FFMpegCore.sln --severity warn --verify-no-changes - name: Prepare FFMpeg - uses: FedericoCarboni/setup-ffmpeg@v2 + uses: FedericoCarboni/setup-ffmpeg@v3 with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ebf61f3..f832def 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,10 +8,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Prepare .NET - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: '8.0.x' From d4dcf86a362349c26dcf501161bc1e7c9009495f Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Wed, 4 Dec 2024 20:51:12 +0200 Subject: [PATCH 07/10] Use macos-13 runner --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b160e6d..bef0a0e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [windows-latest, ubuntu-latest, macos-latest] + os: [windows-latest, ubuntu-latest, macos-13] timeout-minutes: 7 steps: From 0cd4e076ffc085d08ff7479846cb8440aa25b5df Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Wed, 4 Dec 2024 20:55:31 +0200 Subject: [PATCH 08/10] Bump test packages --- FFMpegCore.Test/FFMpegCore.Test.csproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/FFMpegCore.Test/FFMpegCore.Test.csproj b/FFMpegCore.Test/FFMpegCore.Test.csproj index 2373fe8..22cc7dc 100644 --- a/FFMpegCore.Test/FFMpegCore.Test.csproj +++ b/FFMpegCore.Test/FFMpegCore.Test.csproj @@ -8,18 +8,18 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + From cf8f7cc674a51321fb09b0d9ad23904a10c2d8d2 Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Wed, 4 Dec 2024 21:29:37 +0200 Subject: [PATCH 09/10] Call MoveNext before accessing Current --- FFMpegCore/FFMpeg/Pipes/RawAudioPipeSource.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FFMpegCore/FFMpeg/Pipes/RawAudioPipeSource.cs b/FFMpegCore/FFMpeg/Pipes/RawAudioPipeSource.cs index 653e252..cfe31ef 100644 --- a/FFMpegCore/FFMpeg/Pipes/RawAudioPipeSource.cs +++ b/FFMpegCore/FFMpeg/Pipes/RawAudioPipeSource.cs @@ -27,7 +27,7 @@ public string GetStreamArguments() public async Task WriteAsync(Stream outputStream, CancellationToken cancellationToken) { - if (_sampleEnumerator.Current != null) + if (_sampleEnumerator.MoveNext() && _sampleEnumerator.Current != null) { await _sampleEnumerator.Current.SerializeAsync(outputStream, cancellationToken).ConfigureAwait(false); } From a3a3144aacf198ebe8f9783fa6ceaef9fac1d5ef Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Wed, 4 Dec 2024 21:38:41 +0200 Subject: [PATCH 10/10] Bump codecov/codecov-action and set CODECOV_TOKEN --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bef0a0e..91fbab6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,8 @@ jobs: - if: matrix.os == 'windows-latest' name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v5 with: + fail_ci_if_error: true directory: FFMpegCore.Test/TestResults - fail_ci_if_error: true \ No newline at end of file + token: ${{ secrets.CODECOV_TOKEN }}