diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94a858f..91fbab6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,23 +22,23 @@ 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: - 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: '7.0.x' + dotnet-version: '8.0.x' - name: Lint with dotnet 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 }} @@ -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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 00a1ea7..f832def 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,12 +8,12 @@ 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: '7.0.x' + dotnet-version: '8.0.x' - name: Build solution run: dotnet pack FFMpegCore.sln -c Release 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.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 diff --git a/FFMpegCore.Test/FFMpegCore.Test.csproj b/FFMpegCore.Test/FFMpegCore.Test.csproj index 7abd5df..84b863f 100644 --- a/FFMpegCore.Test/FFMpegCore.Test.csproj +++ b/FFMpegCore.Test/FFMpegCore.Test.csproj @@ -1,25 +1,25 @@  - net6.0 + net8.0 false disable default - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + 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); } diff --git a/FFMpegCore/FFMpegCore.csproj b/FFMpegCore/FFMpegCore.csproj index ed3b71c..2c02502 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.