mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-01-18 12:36:44 +00:00
Compare commits
No commits in common. "5d654af5f8c288e54aa96c75a6c7d079ea6fac1c" and "ff42378834422244e3076a6a7cc791cc548d1cc5" have entirely different histories.
5d654af5f8
...
ff42378834
16 changed files with 23 additions and 73 deletions
15
.github/workflows/ci.yml
vendored
15
.github/workflows/ci.yml
vendored
|
@ -22,23 +22,23 @@ jobs:
|
|||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [windows-latest, ubuntu-latest, macos-13]
|
||||
os: [windows-latest, ubuntu-latest, macos-latest]
|
||||
timeout-minutes: 7
|
||||
steps:
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Prepare .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
dotnet-version: '7.0.x'
|
||||
|
||||
- name: Lint with dotnet
|
||||
run: dotnet format FFMpegCore.sln --severity warn --verify-no-changes
|
||||
|
||||
- name: Prepare FFMpeg
|
||||
uses: FedericoCarboni/setup-ffmpeg@v3
|
||||
uses: FedericoCarboni/setup-ffmpeg@v2
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
@ -47,8 +47,7 @@ jobs:
|
|||
|
||||
- if: matrix.os == 'windows-latest'
|
||||
name: Upload coverage reports to Codecov
|
||||
uses: codecov/codecov-action@v5
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
fail_ci_if_error: true
|
||||
directory: FFMpegCore.Test/TestResults
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
fail_ci_if_error: true
|
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
|
@ -8,12 +8,12 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Prepare .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
dotnet-version: '7.0.x'
|
||||
|
||||
- name: Build solution
|
||||
run: dotnet pack FFMpegCore.sln -c Release
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
</PackageReleaseNotes>
|
||||
<PackageTags>ffmpeg ffprobe convert video audio mediafile resize analyze muxing skiasharp</PackageTags>
|
||||
<Authors>Malte Rosenbjerg, Vlad Jerca, Max Bagryantsev, Dimitri Vranken</Authors>
|
||||
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
</PackageReleaseNotes>
|
||||
<PackageTags>ffmpeg ffprobe convert video audio mediafile resize analyze muxing</PackageTags>
|
||||
<Authors>Malte Rosenbjerg, Vlad Jerca, Max Bagryantsev</Authors>
|
||||
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
<Nullable>disable</Nullable>
|
||||
<LangVersion>default</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.2">
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="FluentAssertions" Version="7.0.0" />
|
||||
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1">
|
||||
<PackageReference Include="FluentAssertions" Version="6.12.0" />
|
||||
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
|
||||
<PackageReference Include="SkiaSharp" Version="2.88.6" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -54,9 +54,6 @@
|
|||
<None Update="Resources\input_audio_only_10sec.mp4">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Resources\input_hdr.mov">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Resources\input_video_only_3sec.mp4">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
|
|
@ -173,18 +173,6 @@ public async Task Probe_Success_FromStream_Async()
|
|||
Assert.AreEqual(3, info.Duration.Seconds);
|
||||
}
|
||||
|
||||
[TestMethod, Timeout(10000)]
|
||||
public void Probe_HDR()
|
||||
{
|
||||
var info = FFProbe.Analyse(TestResources.HdrVideo);
|
||||
|
||||
Assert.IsNotNull(info.PrimaryVideoStream);
|
||||
Assert.AreEqual("tv", info.PrimaryVideoStream.ColorRange);
|
||||
Assert.AreEqual("bt2020nc", info.PrimaryVideoStream.ColorSpace);
|
||||
Assert.AreEqual("arib-std-b67", info.PrimaryVideoStream.ColorTransfer);
|
||||
Assert.AreEqual("bt2020", info.PrimaryVideoStream.ColorPrimaries);
|
||||
}
|
||||
|
||||
[TestMethod, Timeout(10000)]
|
||||
public async Task Probe_Success_Subtitle_Async()
|
||||
{
|
||||
|
|
|
@ -5,7 +5,6 @@ public static class TestResources
|
|||
public static readonly string Mp4Video = "./Resources/input_3sec.mp4";
|
||||
public static readonly string Mp4VideoRotation = "./Resources/input_3sec_rotation_90deg.mp4";
|
||||
public static readonly string WebmVideo = "./Resources/input_3sec.webm";
|
||||
public static readonly string HdrVideo = "./Resources/input_hdr.mov";
|
||||
public static readonly string Mp4WithoutVideo = "./Resources/input_audio_only_10sec.mp4";
|
||||
public static readonly string Mp4WithoutAudio = "./Resources/input_video_only_3sec.mp4";
|
||||
public static readonly string RawAudio = "./Resources/audio.raw";
|
||||
|
|
Binary file not shown.
|
@ -6,7 +6,7 @@ public class CropArgument : IArgument
|
|||
{
|
||||
public readonly Size? Size;
|
||||
public readonly int Top;
|
||||
public readonly int Left;
|
||||
public readonly int Left;
|
||||
|
||||
public CropArgument(Size? size, int top, int left)
|
||||
{
|
||||
|
|
|
@ -27,7 +27,7 @@ public string GetStreamArguments()
|
|||
|
||||
public async Task WriteAsync(Stream outputStream, CancellationToken cancellationToken)
|
||||
{
|
||||
if (_sampleEnumerator.MoveNext() && _sampleEnumerator.Current != null)
|
||||
if (_sampleEnumerator.Current != null)
|
||||
{
|
||||
await _sampleEnumerator.Current.SerializeAsync(outputStream, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Instances" Version="3.0.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="9.0.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="8.0.5" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
using FFMpegCore.Enums;
|
||||
|
||||
namespace FFMpegCore
|
||||
|
@ -21,20 +20,10 @@ public class FFOptions : ICloneable
|
|||
/// </summary>
|
||||
public string TemporaryFilesFolder { get; set; } = Path.GetTempPath();
|
||||
|
||||
/// <summary>
|
||||
/// Encoding web name used to persist encoding <see cref="Encoding"/>
|
||||
/// </summary>
|
||||
public string EncodingWebName { get; set; } = Encoding.Default.WebName;
|
||||
|
||||
/// <summary>
|
||||
/// Encoding used for parsing stdout/stderr on ffmpeg and ffprobe processes
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public Encoding Encoding
|
||||
{
|
||||
get => Encoding.GetEncoding(EncodingWebName);
|
||||
set => EncodingWebName = value?.WebName ?? Encoding.Default.WebName;
|
||||
}
|
||||
public Encoding Encoding { get; set; } = Encoding.Default;
|
||||
|
||||
/// <summary>
|
||||
/// The log level to use when calling of the ffmpeg executable.
|
||||
|
|
|
@ -94,18 +94,6 @@ public class FFProbeStream : ITagsContainer, IDispositionContainer
|
|||
|
||||
[JsonPropertyName("side_data_list")]
|
||||
public List<Dictionary<string, JsonValue>> SideData { get; set; } = null!;
|
||||
|
||||
[JsonPropertyName("color_range")]
|
||||
public string ColorRange { get; set; } = null!;
|
||||
|
||||
[JsonPropertyName("color_space")]
|
||||
public string ColorSpace { get; set; } = null!;
|
||||
|
||||
[JsonPropertyName("color_transfer")]
|
||||
public string ColorTransfer { get; set; } = null!;
|
||||
|
||||
[JsonPropertyName("color_primaries")]
|
||||
public string ColorPrimaries { get; set; } = null!;
|
||||
}
|
||||
|
||||
public class Format : ITagsContainer
|
||||
|
|
|
@ -31,7 +31,7 @@ private MediaFormat ParseFormat(Format analysisFormat)
|
|||
}
|
||||
|
||||
private string GetValue(string tagName, Dictionary<string, string>? tags, string defaultValue) =>
|
||||
tags == null ? defaultValue : tags.TryGetValue(tagName, out var value) ? value : defaultValue;
|
||||
tags == null ? defaultValue : tags.TryGetValue(tagName, out var value) ? value : defaultValue;
|
||||
|
||||
private ChapterData ParseChapter(Chapter analysisChapter)
|
||||
{
|
||||
|
@ -90,10 +90,6 @@ private VideoStream ParseVideoStream(FFProbeStream stream)
|
|||
Width = stream.Width ?? 0,
|
||||
Profile = stream.Profile,
|
||||
PixelFormat = stream.PixelFormat,
|
||||
ColorRange = stream.ColorRange,
|
||||
ColorSpace = stream.ColorSpace,
|
||||
ColorTransfer = stream.ColorTransfer,
|
||||
ColorPrimaries = stream.ColorPrimaries,
|
||||
Rotation = MediaAnalysisUtils.ParseRotation(stream),
|
||||
Language = stream.GetLanguage(),
|
||||
Disposition = MediaAnalysisUtils.FormatDisposition(stream.Disposition),
|
||||
|
|
|
@ -15,10 +15,6 @@ public class VideoStream : MediaStream
|
|||
public string PixelFormat { get; set; } = null!;
|
||||
public int Rotation { get; set; }
|
||||
public double AverageFrameRate { get; set; }
|
||||
public string ColorRange { get; set; } = null!;
|
||||
public string ColorSpace { get; set; } = null!;
|
||||
public string ColorTransfer { get; set; } = null!;
|
||||
public string ColorPrimaries { get; set; } = null!;
|
||||
|
||||
public PixelFormat GetPixelFormatInfo() => FFMpeg.GetPixelFormat(PixelFormat);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue