FFMpegCore/FFMpegCore.Extensions.System.Drawing.Common/BitmapExtensions.cs
Malte Rosenbjerg 53651a0275 Init
2023-01-29 20:52:59 +01:00

23 lines
No EOL
610 B
C#

using System;
using System.Drawing;
using System.IO;
namespace FFMpegCore.Extensions.System.Drawing.Common
{
public static class BitmapExtensions
{
public static bool AddAudio(this Image poster, string audio, string output)
{
var destination = $"{Environment.TickCount}.png";
poster.Save(destination);
try
{
return FFMpeg.PosterWithAudio(destination, audio, output);
}
finally
{
if (File.Exists(destination)) File.Delete(destination);
}
}
}
}