Skip to content

.WithVideoFilters Watermark but with rotated text #610

@reaua001

Description

@reaua001

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions