-
Notifications
You must be signed in to change notification settings - Fork 341
Description
I have the following code that handles conversion and adding a watermark text in the center of the video
await FFMpegArguments
.FromFileInput(input)
.OutputToFile(output, true, options => options
.WithVideoCodec(VideoCodec.LibX264)
.WithConstantRateFactor(rateFactor)
.WithAudioCodec(AudioCodec.Aac)
.WithVariableBitrate(4)
.WithVideoFilters(filterOptions => filterOptions
.Scale(1280, 768)
.Watermark(fontLoc, "Watermark Test"))
.WithFastStart())
.ProcessAsynchronously();
public static VideoFilterOptions Watermark(this VideoFilterOptions videoFilterOptions, string fontLoc, string text) {
fontLoc = fontLoc.Replace("\", "/");
videoFilterOptions.DrawText(DrawTextOptions.Create(text, fontLoc)
.WithParameter("fontcolor", "[email protected]")
.WithParameter("fontsize", "h/10")
.WithParameter("borderw", "1")
.WithParameter("bordercolor", "[email protected]")
.WithParameter("x", "(w-text_w)/2")
.WithParameter("y", "(h-text_h)/2")
);
return videoFilterOptions;
}
`
Everything works, but I need the text to be rotated, and all the web examples show how to do it in the command line
Could anyone give me an example of doing rotated text?
Thanks