Former-commit-id: 2abb2a1e6b
This commit is contained in:
Malte Rosenbjerg 2023-01-28 13:37:20 +01:00
parent 844753b1ed
commit 11dfaa6e71
3 changed files with 10 additions and 2 deletions

View file

@ -16,13 +16,17 @@
<PackageTags>ffmpeg ffprobe convert video audio mediafile resize analyze muxing</PackageTags>
<RepositoryType>GitHub</RepositoryType>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<IsPackable>true</IsPackable>
<Nullable>enable</Nullable>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FFMpegCore" Version="4.7.0" />
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FFMpegCore\FFMpegCore.csproj" />
</ItemGroup>
</Project>

View file

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
@ -27,7 +28,7 @@ public static bool JoinImageSequence(string output, double frameRate = 30, param
var temporaryImageFiles = images.Select((imageInfo, index) =>
{
using var image = Image.FromFile(imageInfo.FullName);
FFMpegHelper.ConversionSizeExceptionCheck(image);
FFMpegHelper.ConversionSizeExceptionCheck(image.Width, image.Height);
var destinationPath = Path.Combine(tempFolderName, $"{index.ToString().PadLeft(9, '0')}{imageInfo.Extension}");
Directory.CreateDirectory(tempFolderName);
File.Copy(imageInfo.FullName, destinationPath);
@ -74,6 +75,8 @@ public static bool PosterWithAudio(string image, string audio, string output)
.WithAudioBitrate(AudioQuality.Normal)
.UsingShortest())
.ProcessSynchronously();
}
/// <summary>
/// Saves a 'png' thumbnail to an in-memory bitmap

View file

@ -25,6 +25,7 @@
<PackageTags>ffmpeg ffprobe convert video audio mediafile resize analyze muxing</PackageTags>
<RepositoryType>GitHub</RepositoryType>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<IsPackable>true</IsPackable>
<Nullable>enable</Nullable>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>