mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
Updated example program to avoid commented-out code
This commit is contained in:
parent
01a33f9a1f
commit
b63258217d
1 changed files with 8 additions and 3 deletions
|
@ -2,7 +2,10 @@
|
||||||
using FFMpegCore;
|
using FFMpegCore;
|
||||||
using FFMpegCore.Enums;
|
using FFMpegCore.Enums;
|
||||||
using FFMpegCore.Extensions.System.Drawing.Common;
|
using FFMpegCore.Extensions.System.Drawing.Common;
|
||||||
|
using FFMpegCore.Extensions.SkiaSharp;
|
||||||
using FFMpegCore.Pipes;
|
using FFMpegCore.Pipes;
|
||||||
|
using SkiaSharp;
|
||||||
|
using FFMpegImage = FFMpegCore.Extensions.System.Drawing.Common.FFMpegImage;
|
||||||
|
|
||||||
var inputPath = "/path/to/input";
|
var inputPath = "/path/to/input";
|
||||||
var outputPath = "/path/to/output";
|
var outputPath = "/path/to/output";
|
||||||
|
@ -77,12 +80,14 @@ await FFMpegArguments
|
||||||
var inputImagePath = "/path/to/input/image";
|
var inputImagePath = "/path/to/input/image";
|
||||||
{
|
{
|
||||||
FFMpeg.PosterWithAudio(inputPath, inputAudioPath, outputPath);
|
FFMpeg.PosterWithAudio(inputPath, inputAudioPath, outputPath);
|
||||||
// or
|
// or using FFMpegCore.Extensions.System.Drawing.Common
|
||||||
#pragma warning disable CA1416
|
#pragma warning disable CA1416
|
||||||
using var image = Image.FromFile(inputImagePath); // Using FFMpegCore.Extensions.System.Drawing.Common
|
using var image = Image.FromFile(inputImagePath);
|
||||||
//using var image = SKBitmap.Decode(inputImagePath); // Using FFMpegCore.Extensions.SkiaSharp
|
|
||||||
image.AddAudio(inputAudioPath, outputPath);
|
image.AddAudio(inputAudioPath, outputPath);
|
||||||
#pragma warning restore CA1416
|
#pragma warning restore CA1416
|
||||||
|
// or using FFMpegCore.Extensions.SkiaSharp
|
||||||
|
using var skiaSharpImage = SKBitmap.Decode(inputImagePath);
|
||||||
|
skiaSharpImage.AddAudio(inputAudioPath, outputPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
IVideoFrame GetNextFrame() => throw new NotImplementedException();
|
IVideoFrame GetNextFrame() => throw new NotImplementedException();
|
||||||
|
|
Loading…
Reference in a new issue