Skip to content

Add FFMpegCore.Extensions.SkiaSharp - #396

Merged
rosenbjerg merged 29 commits into
rosenbjerg:mainfrom
drasive:feature/net7-windows-support-v5
Feb 21, 2023
Merged

rosenbjerg merged 29 commits into
rosenbjerg:mainfrom
drasive:feature/net7-windows-support-v5

Conversation

@drasive

@drasive drasive commented Feb 16, 2023 •

Copy link
Copy Markdown

Adds a new project and corresponding NuGet package FFMpegCore.Extensions.SkiaSharp. It is based on FFMpegCore.Extensions.SystemDrawingCommon but uses SkiaSharp instead of SystemDrawingCommon, the former being supported on Windows when using .NET 7. See also #381.

FFMpegCore.Test was adjusted so that the tests contibue to be executed for Extensions.SystemDrawingCommon as-is but are also executed for the new Extensions.SkiaSharp implementation.

I have little familiarity with SkiaSharp and cannot vouch for the correctness of the implementation. If it does not pass the bar for being merged, it may still be useful to some or as a starting point.
Areas that could be improved:

  • There could be more tests that check if the output of Extensions.SkiaSharp looks visually correct.
  • FFMpegCore.Extensions.SkiaSharp duplicates a lot of code from FFMpegCore.Extensions.SystemDrawingCommon.
  • FFMpegCore.Test is now more complex because it tests both implementations.

I may publish this version of FFMpegCore.Extensions.SkiaSharp to NuGet under the package name "**DimitriVranken.**FFMpegCore.Extensions.SkiaSharp" as not to cause a conflict with a potential later "official" release called "FFMpegCore.Extensions.SkiaSharp".

Dimitri Vranken added 18 commits February 13, 2023 11:07
Changes can be made in a single place if neeeded
Required for successful test execution on my rather slow machine
They are now also supported on Linux because we are using SkiaSharp instead of System.Drawing.Common
Required for execution on Linux, otherwise we get the following error: Unable to load shared library 'libSkiaSharp' or one of its dependencies
See mono/SkiaSharp#1341 for more information
The two constructors were causing issues with ambiguous method calls but are a good idea, so this is more of a workaround.
Error message:
The call is ambiguous between the following methods or properties:
'FFMpegCore.Pipes.RawVideoPipeSource.RawVideoPipeSource(System.Collections.Generic.IEnumerator<FFMpegCore.Pipes.IVideoFrame>)' and
'FFMpegCore.Pipes.RawVideoPipeSource.RawVideoPipeSource(System.Collections.Generic.IEnumerable<FFMpegCore.Pipes.IVideoFrame>)'
@rosenbjerg

Copy link
Copy Markdown
Owner

Hey Dimitri, looks very interesting :)
If it has enough test coverage and passes CI, I don't see a reason not to merge it

Comment thread FFMpegCore.Examples/Program.cs Outdated
Comment thread FFMpegCore.Extensions.SkiaSharp/FFMpegCore.Extensions.SkiaSharp.csproj Outdated
Comment thread FFMpegCore.Extensions.SkiaSharp/FFMpegCore.Extensions.SkiaSharp.csproj Outdated
Comment thread FFMpegCore.Extensions.SkiaSharp/FFMpegCore.Extensions.SkiaSharp.csproj Outdated
Comment thread testenvironments.json
@rosenbjerg

rosenbjerg commented Feb 17, 2023 •

Copy link
Copy Markdown
Owner

I cannot push changes to your PR btw, although I could resolve the conflicts

@codecov-commenter

codecov-commenter commented Feb 20, 2023 •

Copy link
Copy Markdown

Codecov Report

Base: 74.85% // Head: 74.18% // Decreases project coverage by -0.67% ⚠️

Coverage data is based on head (46a8ec7) compared to base (8fff02d).
Patch coverage: 50.72% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #396      +/-   ##
==========================================
- Coverage   74.85%   74.18%   -0.67%     
==========================================
  Files         106      109       +3     
  Lines        2708     2774      +66     
==========================================
+ Hits         2027     2058      +31     
- Misses        681      716      +35     
Impacted Files Coverage Δ
...FMpegCore.Extensions.SkiaSharp/BitmapExtensions.cs 0.00% <0.00%> (ø)
...re.Extensions.System.Drawing.Common/FFMpegImage.cs 52.17% <ø> (ø)
FFMpegCore.Extensions.SkiaSharp/FFMpegImage.cs 52.17% <52.17%> (ø)
...re.Extensions.SkiaSharp/BitmapVideoFrameWrapper.cs 72.41% <72.41%> (ø)
FFMpegCore/FFMpeg/Pipes/RawVideoPipeSource.cs 95.34% <100.00%> (-0.11%) ⬇️
...s.System.Drawing.Common/BitmapVideoFrameWrapper.cs 63.04% <0.00%> (-2.18%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Dimitri Vranken added 4 commits February 20, 2023 13:48
Execution time is now approximately one fifth of what it was previously
Existing (untouched) tests are not stable in CI test execution
@drasive
drasive marked this pull request as ready for review February 20, 2023 13:31
@drasive

drasive commented Feb 20, 2023

Copy link
Copy Markdown
Author

I have verified the visual output with some of my actual uses cases, in addition to the unit tests, and everything seems to work fine. The Codecov checks fail but the code coverage seems fine to me and is on par with the existing code.

@rosenbjerg

Copy link
Copy Markdown
Owner

Looks great @drasive
Thanks for the contribution to the project

@rosenbjerg
rosenbjerg merged commit 3ca1e98 into rosenbjerg:main Feb 21, 2023
evgenygunko pushed a commit to evgenygunko/Translations that referenced this pull request Sep 26, 2026
> ℹ️ **Note**
> 
> This PR body was truncated due to platform limits.

This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [FFMpegCore](https://github.com/rosenbjerg/FFMpegCore) | `5.4.0` → `5.5.0` | ![age](https://developer.mend.io/api/mc/badges/age/nuget/FFMpegCore/5.5.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/FFMpegCore/5.4.0/5.5.0?slim=true) |
| [LaunchDarkly.ServerSdk](https://github.com/launchdarkly/dotnet-core) | `8.16.2` → `8.17.1` | ![age](https://developer.mend.io/api/mc/badges/age/nuget/LaunchDarkly.ServerSdk/8.17.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/LaunchDarkly.ServerSdk/8.16.2/8.17.1?slim=true) |
| [Moq](https://github.com/moq/moq) | `4.20.72` → `4.21.0` | ![age](https://developer.mend.io/api/mc/badges/age/nuget/Moq/4.21.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/Moq/4.20.72/4.21.0?slim=true) |
| [OpenAI](https://github.com/openai/openai-dotnet/tree/OpenAI_2.14.0) ([source](https://github.com/openai/openai-dotnet)) | `2.13.0` → `2.14.0` | ![age](https://developer.mend.io/api/mc/badges/age/nuget/OpenAI/2.14.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/OpenAI/2.13.0/2.14.0?slim=true) |

---

### Release Notes

<details>
<summary>rosenbjerg/FFMpegCore (FFMpegCore)</summary>

### [`v5.5.0`](https://github.com/rosenbjerg/FFMpegCore/releases/tag/v5.5.0): FFMpegCore 5.5.0

#### What's Changed

- \[Bugfix] Handle joining of non png images by [@&#8203;rosenbjerg](https://github.com/rosenbjerg) in [#&#8203;397](rosenbjerg/FFMpegCore#397)
- Add PackageOutputPath by [@&#8203;rosenbjerg](https://github.com/rosenbjerg) in [#&#8203;398](rosenbjerg/FFMpegCore#398)
- Only upload to codecov on windows by [@&#8203;rosenbjerg](https://github.com/rosenbjerg) in [#&#8203;406](rosenbjerg/FFMpegCore#406)
- Sub video function by [@&#8203;slugger7](https://github.com/slugger7) in [#&#8203;403](rosenbjerg/FFMpegCore#403)
- Add FFMpegCore.Extensions.SkiaSharp by [@&#8203;drasive](https://github.com/drasive) in [#&#8203;396](rosenbjerg/FFMpegCore#396)
- Bump nuget version and cleanup by [@&#8203;rosenbjerg](https://github.com/rosenbjerg) in [#&#8203;407](rosenbjerg/FFMpegCore#407)
- Add a helper method to generate GIF Snapshots by [@&#8203;rpaschoal](https://github.com/rpaschoal) in [#&#8203;419](rosenbjerg/FFMpegCore#419)
- fix: readme minor mistakes. by [@&#8203;NaBian](https://github.com/NaBian) in [#&#8203;433](rosenbjerg/FFMpegCore#433)
- Update SaveM3U8Stream method to use "-codec copy" argument by [@&#8203;rpaschoal](https://github.com/rpaschoal)...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants