From b63258217d4bffa4f6ab525acf73c8eb2ea8a4a0 Mon Sep 17 00:00:00 2001 From: Dimitri Vranken Date: Mon, 20 Feb 2023 13:18:14 +0100 Subject: [PATCH] Updated example program to avoid commented-out code --- FFMpegCore.Examples/Program.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/FFMpegCore.Examples/Program.cs b/FFMpegCore.Examples/Program.cs index 24d29d5..e89de17 100644 --- a/FFMpegCore.Examples/Program.cs +++ b/FFMpegCore.Examples/Program.cs @@ -2,7 +2,10 @@ using FFMpegCore; using FFMpegCore.Enums; using FFMpegCore.Extensions.System.Drawing.Common; +using FFMpegCore.Extensions.SkiaSharp; using FFMpegCore.Pipes; +using SkiaSharp; +using FFMpegImage = FFMpegCore.Extensions.System.Drawing.Common.FFMpegImage; var inputPath = "/path/to/input"; var outputPath = "/path/to/output"; @@ -77,12 +80,14 @@ await FFMpegArguments var inputImagePath = "/path/to/input/image"; { FFMpeg.PosterWithAudio(inputPath, inputAudioPath, outputPath); - // or + // or using FFMpegCore.Extensions.System.Drawing.Common #pragma warning disable CA1416 - using var image = Image.FromFile(inputImagePath); // Using FFMpegCore.Extensions.System.Drawing.Common - //using var image = SKBitmap.Decode(inputImagePath); // Using FFMpegCore.Extensions.SkiaSharp + using var image = Image.FromFile(inputImagePath); image.AddAudio(inputAudioPath, outputPath); #pragma warning restore CA1416 + // or using FFMpegCore.Extensions.SkiaSharp + using var skiaSharpImage = SKBitmap.Decode(inputImagePath); + skiaSharpImage.AddAudio(inputAudioPath, outputPath); } IVideoFrame GetNextFrame() => throw new NotImplementedException();