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> <PackageTags>ffmpeg ffprobe convert video audio mediafile resize analyze muxing</PackageTags>
<RepositoryType>GitHub</RepositoryType> <RepositoryType>GitHub</RepositoryType>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<IsPackable>true</IsPackable>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="FFMpegCore" Version="4.7.0" />
<PackageReference Include="System.Drawing.Common" Version="6.0.0" /> <PackageReference Include="System.Drawing.Common" Version="6.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FFMpegCore\FFMpegCore.csproj" />
</ItemGroup>
</Project> </Project>

View file

@ -1,4 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@ -27,7 +28,7 @@ public static bool JoinImageSequence(string output, double frameRate = 30, param
var temporaryImageFiles = images.Select((imageInfo, index) => var temporaryImageFiles = images.Select((imageInfo, index) =>
{ {
using var image = Image.FromFile(imageInfo.FullName); 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}"); var destinationPath = Path.Combine(tempFolderName, $"{index.ToString().PadLeft(9, '0')}{imageInfo.Extension}");
Directory.CreateDirectory(tempFolderName); Directory.CreateDirectory(tempFolderName);
File.Copy(imageInfo.FullName, destinationPath); File.Copy(imageInfo.FullName, destinationPath);
@ -74,6 +75,8 @@ public static bool PosterWithAudio(string image, string audio, string output)
.WithAudioBitrate(AudioQuality.Normal) .WithAudioBitrate(AudioQuality.Normal)
.UsingShortest()) .UsingShortest())
.ProcessSynchronously(); .ProcessSynchronously();
} }
/// <summary> /// <summary>
/// Saves a 'png' thumbnail to an in-memory bitmap /// 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> <PackageTags>ffmpeg ffprobe convert video audio mediafile resize analyze muxing</PackageTags>
<RepositoryType>GitHub</RepositoryType> <RepositoryType>GitHub</RepositoryType>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<IsPackable>true</IsPackable>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup> </PropertyGroup>