Skip to content

Commit 4651252

Browse files
authored
Merge pull request #582 from rosenbjerg/main
V.5.3.0
2 parents 6f1a8d7 + fc5e8a6 commit 4651252

File tree

173 files changed

+8215
-7096
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+8215
-7096
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ${{ matrix.os }}
1919
strategy:
2020
matrix:
21-
os: [windows-latest, ubuntu-latest, macos-13]
21+
os: [windows-latest, ubuntu-latest, macos-latest]
2222
timeout-minutes: 7
2323
steps:
2424

@@ -30,14 +30,15 @@ jobs:
3030
with:
3131
dotnet-version: '8.0.x'
3232

33-
- name: Lint with dotnet
33+
- if: matrix.os == 'ubuntu-latest'
34+
name: Lint with dotnet
3435
run: dotnet format FFMpegCore.sln --severity warn --verify-no-changes
3536

36-
- name: Prepare FFMpeg
37-
uses: FedericoCarboni/setup-ffmpeg@v3
37+
- name: Setup FFmpeg
38+
uses: AnimMouse/setup-ffmpeg@ae28d57dabbb148eff63170b6bf7f2b60062cbae # 1.1.0
3839
with:
39-
ffmpeg-version: 6.0.1
40-
github-token: ${{ secrets.GITHUB_TOKEN }}
40+
version: ${{ matrix.os != 'macos-latest' && '7.1' || '711' }}
41+
token: ${{ github.token }}
4142

4243
- name: Test with dotnet
4344
run: dotnet test FFMpegCore.sln --collect "XPlat Code Coverage" --logger GitHubActions

Directory.Build.props

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
<Project>
2-
<PropertyGroup>
3-
<TargetFramework>netstandard2.0</TargetFramework>
4-
<NeutralLanguage>en</NeutralLanguage>
5-
<AssemblyVersion>5.0.0.0</AssemblyVersion>
6-
<LangVersion>default</LangVersion>
7-
<Nullable>enable</Nullable>
8-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
9-
<ImplicitUsings>enable</ImplicitUsings>
2+
<PropertyGroup>
3+
<TargetFramework>netstandard2.0</TargetFramework>
4+
<NeutralLanguage>en</NeutralLanguage>
5+
<AssemblyVersion>5.0.0.0</AssemblyVersion>
6+
<LangVersion>default</LangVersion>
7+
<Nullable>enable</Nullable>
8+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
9+
<ImplicitUsings>enable</ImplicitUsings>
1010

11-
<RepositoryType>GitHub</RepositoryType>
12-
<RepositoryUrl>https://github.com/rosenbjerg/FFMpegCore</RepositoryUrl>
13-
<PackageProjectUrl>https://github.com/rosenbjerg/FFMpegCore</PackageProjectUrl>
14-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
15-
<NeutralLanguage>en</NeutralLanguage>
11+
<RepositoryType>GitHub</RepositoryType>
12+
<RepositoryUrl>https://github.com/rosenbjerg/FFMpegCore</RepositoryUrl>
13+
<PackageProjectUrl>https://github.com/rosenbjerg/FFMpegCore</PackageProjectUrl>
14+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
15+
<NeutralLanguage>en</NeutralLanguage>
1616

17-
<PublishRepositoryUrl>true</PublishRepositoryUrl>
18-
<IncludeSymbols>true</IncludeSymbols>
19-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
20-
<EmbedUntrackedSources>true</EmbedUntrackedSources>
21-
</PropertyGroup>
17+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
18+
<IncludeSymbols>true</IncludeSymbols>
19+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
20+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
21+
</PropertyGroup>
2222

23-
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
24-
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
25-
</PropertyGroup>
23+
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
24+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
25+
</PropertyGroup>
2626
</Project>

FFMpegCore.Examples/FFMpegCore.Examples.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<ProjectReference Include="..\FFMpegCore.Extensions.SkiaSharp\FFMpegCore.Extensions.SkiaSharp.csproj" />
10+
<ProjectReference Include="..\FFMpegCore.Extensions.SkiaSharp\FFMpegCore.Extensions.SkiaSharp.csproj"/>
1111
<ProjectReference Include="..\FFMpegCore.Extensions.System.Drawing.Common\FFMpegCore.Extensions.System.Drawing.Common.csproj"/>
1212
<ProjectReference Include="..\FFMpegCore\FFMpegCore.csproj"/>
1313
</ItemGroup>

FFMpegCore.Examples/Program.cs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ await FFMpegArguments
6161
}
6262

6363
{
64-
FFMpeg.JoinImageSequence(@"..\joined_video.mp4", frameRate: 1, @"..\1.png", @"..\2.png", @"..\3.png");
64+
FFMpeg.JoinImageSequence(@"..\joined_video.mp4", 1, @"..\1.png", @"..\2.png", @"..\3.png");
6565
}
6666

6767
{
@@ -90,7 +90,11 @@ await FFMpegArguments
9090
skiaSharpImage.AddAudio(inputAudioPath, outputPath);
9191
}
9292

93-
IVideoFrame GetNextFrame() => throw new NotImplementedException();
93+
IVideoFrame GetNextFrame()
94+
{
95+
throw new NotImplementedException();
96+
}
97+
9498
{
9599
IEnumerable<IVideoFrame> CreateFrames(int count)
96100
{
@@ -100,10 +104,11 @@ IEnumerable<IVideoFrame> CreateFrames(int count)
100104
}
101105
}
102106

103-
var videoFramesSource = new RawVideoPipeSource(CreateFrames(64)) //pass IEnumerable<IVideoFrame> or IEnumerator<IVideoFrame> to constructor of RawVideoPipeSource
104-
{
105-
FrameRate = 30 //set source frame rate
106-
};
107+
var videoFramesSource =
108+
new RawVideoPipeSource(CreateFrames(64)) //pass IEnumerable<IVideoFrame> or IEnumerator<IVideoFrame> to constructor of RawVideoPipeSource
109+
{
110+
FrameRate = 30 //set source frame rate
111+
};
107112
await FFMpegArguments
108113
.FromPipeInput(videoFramesSource)
109114
.OutputToFile(outputPath, false, options => options
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace FFMpegCore.Extensions.Downloader.Enums;
2+
3+
[Flags]
4+
public enum FFMpegBinaries : ushort
5+
{
6+
FFMpeg = 1,
7+
FFProbe = 2,
8+
FFPlay = 4
9+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using System.ComponentModel;
2+
3+
namespace FFMpegCore.Extensions.Downloader.Enums;
4+
5+
public enum FFMpegVersions : ushort
6+
{
7+
[Description("https://ffbinaries.com/api/v1/version/latest")]
8+
LatestAvailable,
9+
10+
[Description("https://ffbinaries.com/api/v1/version/6.1")]
11+
V6_1,
12+
13+
[Description("https://ffbinaries.com/api/v1/version/5.1")]
14+
V5_1,
15+
16+
[Description("https://ffbinaries.com/api/v1/version/4.4.1")]
17+
V4_4_1,
18+
19+
[Description("https://ffbinaries.com/api/v1/version/4.2.1")]
20+
V4_2_1,
21+
22+
[Description("https://ffbinaries.com/api/v1/version/4.2")]
23+
V4_2,
24+
25+
[Description("https://ffbinaries.com/api/v1/version/4.1")]
26+
V4_1,
27+
28+
[Description("https://ffbinaries.com/api/v1/version/4.0")]
29+
V4_0,
30+
31+
[Description("https://ffbinaries.com/api/v1/version/3.4")]
32+
V3_4,
33+
34+
[Description("https://ffbinaries.com/api/v1/version/3.3")]
35+
V3_3,
36+
37+
[Description("https://ffbinaries.com/api/v1/version/3.2")]
38+
V3_2
39+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace FFMpegCore.Extensions.Downloader.Enums;
2+
3+
public enum SupportedPlatforms : ushort
4+
{
5+
Windows64,
6+
Windows32,
7+
Linux64,
8+
Linux32,
9+
LinuxArmhf,
10+
LinuxArmel,
11+
LinuxArm64,
12+
Osx64
13+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
namespace FFMpegCore.Extensions.Downloader.Exceptions;
2+
3+
/// <summary>
4+
/// Custom exception for FFMpegDownloader
5+
/// </summary>
6+
public class FFMpegDownloaderException : Exception
7+
{
8+
public readonly string Detail = "";
9+
10+
public FFMpegDownloaderException(string message) : base(message)
11+
{
12+
}
13+
14+
public FFMpegDownloaderException(string message, string detail) : base(message)
15+
{
16+
Detail = detail;
17+
}
18+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using System.ComponentModel;
2+
3+
namespace FFMpegCore.Extensions.Downloader.Extensions;
4+
5+
public static class EnumExtensions
6+
{
7+
internal static string GetDescription(this Enum enumValue)
8+
{
9+
var field = enumValue.GetType().GetField(enumValue.ToString());
10+
if (field == null)
11+
{
12+
return enumValue.ToString();
13+
}
14+
15+
if (Attribute.GetCustomAttribute(field, typeof(DescriptionAttribute)) is DescriptionAttribute attribute)
16+
{
17+
return attribute.Description;
18+
}
19+
20+
return enumValue.ToString();
21+
}
22+
23+
public static TEnum[] GetFlags<TEnum>(this TEnum input) where TEnum : Enum
24+
{
25+
return Enum.GetValues(input.GetType())
26+
.Cast<Enum>()
27+
.Where(input.HasFlag)
28+
.Cast<TEnum>()
29+
.ToArray();
30+
}
31+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<IsPackable>true</IsPackable>
5+
<Description>FFMpeg downloader extension for FFMpegCore</Description>
6+
<PackageVersion>5.0.0</PackageVersion>
7+
<PackageOutputPath>../nupkg</PackageOutputPath>
8+
<PackageReleaseNotes>
9+
- Updated dependencies
10+
</PackageReleaseNotes>
11+
<PackageTags>ffmpeg ffprobe convert video audio mediafile resize analyze download install</PackageTags>
12+
<Authors>Kerry Cao, Malte Rosenbjerg</Authors>
13+
</PropertyGroup>
14+
15+
<ItemGroup>
16+
<ProjectReference Include="..\FFMpegCore\FFMpegCore.csproj"/>
17+
</ItemGroup>
18+
19+
</Project>

0 commit comments

Comments
 (0)