mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-14 02:04:14 +01:00
24 lines
636 B
C#
24 lines
636 B
C#
using System.Drawing;
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|