Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FFMpegCore C# custom args

I am evaluating using FFMpegCore C# to do some video manipulations. I am not seeing a way of passing in a custom argument string. I fear the answer is staring right at me but I definitely read all documentation and cannot find a way to do it.

Below my signature is the string I would like to pass in, though it should not matter. Anyone know how to pass a custom string arguments to FFMpegCore C#?

Thanks, Dan

public static string GetFlipBookArgs(string convertedVideoFilePath, int frameCountCalc, string flipbookFilePath)
{
    return $"-y -i \"{convertedVideoFilePath}\" -vf \"select = not(mod(n\\, {frameCountCalc})),scale = 128:128,tile = 4x4\" -frames:v 1 -q:v 10 \"{flipbookFilePath}\"";
}
like image 530
DapperDanh Avatar asked Nov 28 '25 12:11

DapperDanh


1 Answers

Try FFmpegArgs.Executes

string your_arguments = "-y -i ......";
var render = FFmpegRender.FromArguments(
  your_arguments,
  new FFmpegRenderConfig()
    .WithFFmpegBinaryPath("path to ffmpeg")//default from PATH or current dir
    //.WithWorkingDirectory("your working dir or not")//default current dir
  );
//render.OnEncodingProgress += your update action
//var result = render.Execute(); 
var result = await render.ExecuteAsync();
like image 137
Trương Quốc Khánh Avatar answered Nov 30 '25 02:11

Trương Quốc Khánh