📄 src/Infrastructure/Ffmpeg/FfmpegExtensions.cs
using FFMpegCore;
using FFMpegCore.Arguments;

namespace Slopper.Infrastructure.Ffmpeg;

internal static class FfmpegExtensions
{
    extension(FFMpegArgumentOptions options)
    {
        public FFMpegArgumentOptions WithArgument(string argument) =>
            options.WithArgument(new CustomArgument(argument));
    }

    extension(VideoFilterOptions filter)
    {
        public VideoFilterOptions Add(string key, string value) =>
            filter.Add(new CustomVideoFilterArgument(key, value));

        public VideoFilterOptions Add(IVideoFilterArgument argument)
        {
            filter.Arguments.Add(argument);
            return filter;
        }
    }
}

internal sealed record CustomVideoFilterArgument(string Key, string Value) : IVideoFilterArgument;